#include <BinaryValue.h>
Public Member Functions | |
| BinaryValue (const char *s="") | |
| BinaryValue (const std::string &str) | |
| BinaryValue (const std::vector< char > &v) | |
| BinaryValue (size_t n) | |
| BinaryValue (const char *b, const char *e) | |
| bool | operator< (const BinaryValue &rhs) |
| BinaryValue & | operator+= (const BinaryValue &rhs) |
| virtual | ~BinaryValue () |
| virtual void | netPack (cCommBuffer *b) |
| virtual void | netUnpack (cCommBuffer *b) |
| bool | isUnspecified () const |
Static Public Attributes | |
| static const BinaryValue | UNSPECIFIED_VALUE |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const BinaryValue &v) |
Definition at line 29 of file BinaryValue.h.
| BinaryValue::BinaryValue | ( | const char * | s = "" |
) |
Definition at line 33 of file BinaryValue.cc.
Referenced by BinaryValue().
00033 : vector<char>(strlen(s)) 00034 { 00035 copy(s, s+strlen(s), begin()); // Inherits vector<char>::begin() 00036 }
| BinaryValue::BinaryValue | ( | const std::string & | str | ) |
Definition at line 42 of file BinaryValue.cc.
00043 { 00044 *this = BinaryValue(str.c_str()); 00045 }
| BinaryValue::BinaryValue | ( | const std::vector< char > & | v | ) |
| BinaryValue::BinaryValue | ( | size_t | n | ) |
| BinaryValue::BinaryValue | ( | const char * | b, | |
| const char * | e | |||
| ) |
| virtual BinaryValue::~BinaryValue | ( | ) | [inline, virtual] |
| bool BinaryValue::isUnspecified | ( | ) | const |
| void BinaryValue::netPack | ( | cCommBuffer * | b | ) | [virtual] |
Definition at line 86 of file BinaryValue.cc.
Referenced by doPacking().
00087 { 00088 doPacking(b,(uint16_t)size()); 00089 doPacking(b, (const char*)(&(*begin())), size()); 00090 }
| void BinaryValue::netUnpack | ( | cCommBuffer * | b | ) | [virtual] |
Definition at line 92 of file BinaryValue.cc.
Referenced by doUnpacking().
00093 { 00094 uint16_t size; 00095 doUnpacking(b, size); 00096 resize(size); 00097 doUnpacking(b, (char*)(&(*begin())), size); 00098 }
| BinaryValue & BinaryValue::operator+= | ( | const BinaryValue & | rhs | ) |
| bool BinaryValue::operator< | ( | const BinaryValue & | rhs | ) |
Definition at line 72 of file BinaryValue.cc.
00073 { 00074 size_type minSize = min(this->size(), rhs.size()); 00075 for (size_type i=0; i<minSize; i++) { 00076 if ((*this)[i] < rhs[i]) { 00077 return true; 00078 } else if ((*this)[i] > rhs[i]) { 00079 return false; 00080 } 00081 } 00082 00083 return (this->size() < rhs.size()) ? true : false; 00084 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const BinaryValue & | v | |||
| ) | [friend] |
Definition at line 67 of file BinaryValue.cc.
00067 { 00068 copy(v.begin(), v.end(), ostream_iterator<char>(os, "")); 00069 return os; // To allow (cout << a) << b; 00070 }
const BinaryValue BinaryValue::UNSPECIFIED_VALUE [static] |
Definition at line 31 of file BinaryValue.h.
Referenced by P2pnsCache::getData(), GlobalDhtTestMap::getRandomKey(), DHT::handleGetRequest(), CBRDHT::handleGetRequest(), DHT::handleGetResponse(), CBRDHT::handleGetResponse(), DHT::handleLookupResponse(), CBRDHT::handleLookupResponse(), and CBRDHT::handleRpcTimeout().
1.5.8