#include <BinaryValue.h>
Definition at line 29 of file BinaryValue.h.
Public Member Functions | |
| BinaryValue (const char *s="") | |
| BinaryValue (const std::string &str) | |
| BinaryValue (const std::vector< char > &v) | |
| bool | 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) |
| 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 38 of file BinaryValue.cc.
00039 { 00040 *this = BinaryValue(str.c_str()); 00041 }
| BinaryValue::BinaryValue | ( | const std::vector< char > & | v | ) |
| virtual BinaryValue::~BinaryValue | ( | ) | [inline, virtual] |
| bool BinaryValue::operator< | ( | const BinaryValue & | rhs | ) |
Definition at line 58 of file BinaryValue.cc.
00059 { 00060 size_type minSize = min(this->size(), rhs.size()); 00061 for (size_type i=0; i<minSize; i++) { 00062 if ((*this)[i] < rhs[i]) { 00063 return true; 00064 } else if ((*this)[i] > rhs[i]) { 00065 return false; 00066 } 00067 } 00068 00069 return (this->size() < rhs.size()) ? true : false; 00070 }
| void BinaryValue::netPack | ( | cCommBuffer * | b | ) | [virtual] |
| void BinaryValue::netUnpack | ( | cCommBuffer * | b | ) | [virtual] |
Definition at line 78 of file BinaryValue.cc.
Referenced by doUnpacking().
00079 { 00080 int size; 00081 doUnpacking(b, size); 00082 resize(size); 00083 doUnpacking(b, (char*)(&(*begin())), size); 00084 }
| bool BinaryValue::isUnspecified | ( | ) | const |
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const BinaryValue & | v | |||
| ) | [friend] |
Definition at line 53 of file BinaryValue.cc.
00053 { 00054 copy(v.begin(), v.end(), ostream_iterator<char>(os, "")); 00055 return os; // To allow (cout << a) << b; 00056 }
const BinaryValue BinaryValue::UNSPECIFIED_VALUE [static] |
Definition at line 31 of file BinaryValue.h.
Referenced by P2pnsCache::getData(), DHTDataStorage::getData(), GlobalDhtTestMap::getRandomKey(), DHT::handleGetRequest(), DHT::handleGetResponse(), DHT::handleLookupResponse(), and DHT::handleRpcTimeout().
1.5.5