#include <BinaryValue.h>
Detailed Description
Definition at line 29 of file BinaryValue.h.
Constructor & Destructor Documentation
BinaryValue::BinaryValue |
( |
| ) |
|
BinaryValue::BinaryValue |
( |
size_t |
n | ) |
|
BinaryValue::BinaryValue |
( |
const std::string & |
str | ) |
|
BinaryValue::BinaryValue |
( |
const std::vector< char > & |
v | ) |
|
BinaryValue::BinaryValue |
( |
const char * |
b, |
|
|
const size_t |
l |
|
) |
| |
BinaryValue::BinaryValue |
( |
const char * |
cStr | ) |
|
BinaryValue::BinaryValue |
( |
cObject * |
obj | ) |
|
virtual BinaryValue::~BinaryValue |
( |
| ) |
|
|
inlinevirtual |
Member Function Documentation
bool BinaryValue::isUnspecified |
( |
| ) |
const |
void BinaryValue::netPack |
( |
cCommBuffer * |
b | ) |
|
|
virtual |
void BinaryValue::netUnpack |
( |
cCommBuffer * |
b | ) |
|
|
virtual |
Definition at line 64 of file BinaryValue.cc.
{
insert(end(), rhs.begin(), rhs.end());
return *this;
}
Definition at line 81 of file BinaryValue.cc.
{
size_type minSize = min(this->size(), rhs.size());
for (size_type i=0; i<minSize; i++) {
if ((*this)[i] < rhs[i]) {
return true;
} else if ((*this)[i] > rhs[i]) {
return false;
}
}
return (this->size() < rhs.size()) ? true : false;
}
void BinaryValue::packObject |
( |
cObject * |
obj | ) |
|
Definition at line 109 of file BinaryValue.cc.
Referenced by BinaryValue().
{
b->reset();
resize(b->getMessageSize());
memcpy(data(), b->getBuffer(), b->getMessageSize());
delete b;
}
cObject * BinaryValue::unpackObject |
( |
| ) |
|
Definition at line 119 of file BinaryValue.cc.
{
cObject* obj;
b->reset();
b->allocateAtLeast(size());
memcpy(b->getBuffer(), data(), size());
b->setMessageSize(size());
delete b;
return obj;
}
Friends And Related Function Documentation
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const BinaryValue & |
v |
|
) |
| |
|
friend |
Definition at line 76 of file BinaryValue.cc.
{
copy(v.begin(), v.end(), ostream_iterator<char>(os, ""));
return os;
}
Member Data Documentation
The documentation for this class was generated from the following files: