00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 #include "jaus/core/discovery/queryidentification.h" 00041 00042 using namespace JAUS; 00043 00052 QueryIdentification::QueryIdentification(const Address& dest, 00053 const Address& src) : Message(QUERY_IDENTIFICATION, dest, src) 00054 { 00055 mQueryType = Reserved; 00056 } 00057 00058 00064 QueryIdentification::QueryIdentification(const QueryIdentification& message) : Message(QUERY_IDENTIFICATION) 00065 { 00066 mQueryType = Reserved; 00067 *this = message; 00068 } 00069 00070 00076 QueryIdentification::~QueryIdentification() 00077 { 00078 00079 } 00080 00081 00093 int QueryIdentification::WriteMessageBody(Packet& packet) const 00094 { 00095 int total = 0; 00096 int expected = BYTE_SIZE; 00097 total += packet.WriteByte((Byte)mQueryType); 00098 return total == expected ? total : -1; 00099 } 00100 00101 00113 int QueryIdentification::ReadMessageBody(const Packet& packet) 00114 { 00115 int total = 0; 00116 int expected = BYTE_SIZE; 00117 total += packet.Read((Byte &)mQueryType); 00118 return total == expected ? total : -1; 00119 } 00120 00121 00127 void QueryIdentification::ClearMessageBody() 00128 { 00129 mQueryType = Reserved; 00130 } 00131 00132 00138 QueryIdentification& QueryIdentification::operator =(const QueryIdentification& message) 00139 { 00140 if(this != &message) 00141 { 00142 CopyHeaderData(&message); 00143 mQueryType = message.mQueryType; 00144 } 00145 return *this; 00146 } 00147 00148 00149 /* End of File */