|
Urbi SDK Remote for C++
2.7.5
|
Binary data of known or unknown type. More...
#include <ubinary.hh>

Public Member Functions | |
| UBinary () | |
| UBinary (const UBinary &b, bool copy=true, bool temp=false) | |
| Deep copy constructor. | |
| UBinary (const UImage &, bool copy=true) | |
| UBinary (const USound &, bool copy=true) | |
| UBinary & | operator= (const UBinary &b) |
| Deep copy. | |
| void | buildMessage () |
| Store the result of getMessage() in member message. | |
| std::string | getMessage () const |
| Get header. | |
| void | clear () |
| Clear all the buffers that were allocated by the system. | |
| ~UBinary () | |
| Frees binary buffer. | |
| bool | parse (std::istringstream &is, const binaries_type &bins, binaries_type::const_iterator &binpos, bool copy=true) |
| Return true on success. | |
| int | parse (const char *message, int pos, const binaries_type &bins, binaries_type::const_iterator &binpos, bool copy=true) |
| std::ostream & | print (std::ostream &o, int kernelMajor=2) const |
| Used by UValue::print for serialization. | |
Public Attributes | |
| UBinaryType | type |
| union { | |
| struct { | |
| void * data | |
| binary data | |
| size_t size | |
| } common | |
| UImage image | |
| USound sound | |
| }; | |
| std::string | message |
| Headers (everything after "BIN theSize" and before ';' or ). | |
| bool | allocated_ |
| Whether the memory (common.data) is managed by this object, or by the user. | |
| bool | temporary_ |
| If true, content is a temporary value that can be stolen when copied. | |
Binary data of known or unknown type.
Handles its memory: the data field will be freed when the destructor is called.
Definition at line 63 of file ubinary.hh.
| urbi::UBinary::UBinary | ( | ) |
Definition at line 28 of file ubinary.cc.
References common.
| urbi::UBinary::UBinary | ( | const UBinary & | b, |
| bool | copy = true, |
||
| bool | temp = false |
||
| ) |
| urbi::UBinary::UBinary | ( | const UImage & | i, |
| bool | copy = true |
||
| ) | [explicit] |
Definition at line 55 of file ubinary.cc.
References urbi::UImage::data, image, and urbi::UImage::size.
| urbi::UBinary::UBinary | ( | const USound & | i, |
| bool | copy = true |
||
| ) | [explicit] |
Definition at line 68 of file ubinary.cc.
References urbi::USound::data, urbi::USound::size, and sound.
| urbi::UBinary::~UBinary | ( | ) |
| void urbi::UBinary::buildMessage | ( | ) |
Store the result of getMessage() in member message.
Definition at line 264 of file ubinary.cc.
References getMessage(), and message.
Referenced by urbi::UAbstractClient::send().
| void urbi::UBinary::clear | ( | ) |
Clear all the buffers that were allocated by the system.
Definition at line 82 of file ubinary.cc.
References allocated_, and common.
Referenced by operator=(), and ~UBinary().
| std::string urbi::UBinary::getMessage | ( | ) | const |
Get header.
Definition at line 269 of file ubinary.cc.
References urbi::BINARY_IMAGE, urbi::BINARY_NONE, urbi::BINARY_SOUND, urbi::BINARY_UNKNOWN, urbi::UImage::headers_(), urbi::USound::headers_(), image, message, sound, and type.
Referenced by buildMessage(), print(), urbi::saveUValue(), and urbi::impl::RemoteUVarImpl::transmit().
Deep copy.
Definition at line 97 of file ubinary.cc.
References urbi::BINARY_IMAGE, urbi::BINARY_NONE, urbi::BINARY_SOUND, urbi::BINARY_UNKNOWN, clear(), common, image, message, sound, temporary_, and type.
| bool urbi::UBinary::parse | ( | std::istringstream & | is, |
| const binaries_type & | bins, | ||
| binaries_type::const_iterator & | binpos, | ||
| bool | copy = true |
||
| ) |
Return true on success.
Definition at line 183 of file ubinary.cc.
References allocated_, urbi::BINARY_IMAGE, urbi::BINARY_SOUND, urbi::BINARY_UNKNOWN, urbi::USound::channels, common, urbi::UImage::height, image, urbi::IMAGE_UNKNOWN, urbi::UImage::imageFormat, message, urbi::parse_image_format(), urbi::parse_sound_format(), urbi::USound::rate, urbi::USound::sampleFormat, urbi::USound::sampleSize, urbi::UImage::size, urbi::USound::size, sound, urbi::USound::soundFormat, type, and urbi::UImage::width.
Referenced by urbi::loadUValue(), parse(), and urbi::UValue::parse().
| int urbi::UBinary::parse | ( | const char * | message, |
| int | pos, | ||
| const binaries_type & | bins, | ||
| binaries_type::const_iterator & | binpos, | ||
| bool | copy = true |
||
| ) |
Definition at line 137 of file ubinary.cc.
References parse().
| std::ostream & urbi::UBinary::print | ( | std::ostream & | o, |
| int | kernelMajor = 2 |
||
| ) | const |
Used by UValue::print for serialization.
Definition at line 305 of file ubinary.cc.
References common, and getMessage().
Referenced by urbi::operator<<().
| union { ... } |
Whether the memory (common.data) is managed by this object, or by the user.
Definition at line 112 of file ubinary.hh.
Referenced by clear(), urbi::loadUValue(), and parse().
| struct { ... } urbi::UBinary::common |
| void* urbi::UBinary::data |
binary data
Definition at line 101 of file ubinary.hh.
Definition at line 104 of file ubinary.hh.
Referenced by getMessage(), urbi::UValue::operator UImage(), operator=(), parse(), urbi::USyncClient::syncGetImage(), and UBinary().
| std::string urbi::UBinary::message |
Headers (everything after "BIN theSize" and before ';' or
).
Definition at line 108 of file ubinary.hh.
Referenced by buildMessage(), getMessage(), urbi::operator,(), operator=(), parse(), urbi::UAbstractClient::send(), and UBinary().
| size_t urbi::UBinary::size |
Definition at line 102 of file ubinary.hh.
Definition at line 105 of file ubinary.hh.
Referenced by getMessage(), urbi::UValue::operator USound(), operator=(), parse(), urbi::USyncClient::syncGetSound(), and UBinary().
If true, content is a temporary value that can be stolen when copied.
Assigning from a temporary will mark the target as temporary too. So the temporary_ property must be reset to false manually at some point.
Definition at line 118 of file ubinary.hh.
Referenced by operator=().
Definition at line 96 of file ubinary.hh.
Referenced by getMessage(), urbi::UValue::operator UImage(), urbi::UValue::operator USound(), operator=(), parse(), urbi::UAbstractClient::send(), urbi::USyncClient::syncGetImage(), urbi::USyncClient::syncGetSound(), and UBinary().