29 #ifndef BLOB_MESSAGE_BLOB_H 30 #define BLOB_MESSAGE_BLOB_H 38 #include <boost/shared_ptr.hpp> 47 template <
class ContainerAllocator>
54 typedef std::vector<value_type>
Buffer;
64 Blob_(
const ContainerAllocator& _alloc)
125 size_ = data->size();
133 std::copy(
begin(),
end(), copy->data());
152 template<
typename Stream>
160 stream.next(static_cast<uint8_t>(
true));
167 stream.next(static_cast<uint8_t>(
false));
168 stream.next(static_cast<uint32_t>(
size()));
172 template<
typename Stream>
175 uint8_t is_compressed;
177 stream.next(is_compressed);
179 ROS_DEBUG_NAMED(
"blob",
"Reading %s blob of size %u at address %p from the stream", std::string(is_compressed ?
"a compressed" :
"an uncompressed").c_str(), size, stream.getData());
204 return length +
size();
209 template <
typename M>
218 template <
typename M>
238 return decompress(reinterpret_cast<const uint8_t *>(data), size);
246 BufferPtr temp(
new Buffer());
263 BufferPtr temp(
new Buffer());
266 ROS_WARN_NAMED(
"blob",
"Error during decompression of a blob of size %u", size);
283 typedef ::blob::Blob_<std::allocator<void> >
Blob;
287 template<
typename ContainerAllocator>
288 std::ostream& operator<<(std::ostream& s, const ::blob::Blob_<ContainerAllocator> & v)
298 namespace message_traits
301 template <
class ContainerAllocator>
306 template <
class ContainerAllocator>
311 template <
class ContainerAllocator>
316 template <
class ContainerAllocator>
321 template <
class ContainerAllocator>
326 template <
class ContainerAllocator>
332 template<
class ContainerAllocator>
337 return "8115c3ed9d7b2e23c47c6ecaff2d4b13";
340 static const char*
value(const ::blob::Blob_<ContainerAllocator>&) {
return value(); }
341 static const uint64_t static_value1 = 0x8115c3ed9d7b2e23ULL;
342 static const uint64_t static_value2 = 0xc47c6ecaff2d4b13ULL;
345 template<
class ContainerAllocator>
353 static const char*
value(const ::blob::Blob_<ContainerAllocator>&) {
return value(); }
356 template<
class ContainerAllocator>
361 return "bool compressed\n\ 367 static const char*
value(const ::blob::Blob_<ContainerAllocator>&) {
return value(); }
376 namespace serialization
381 template<
typename Stream,
typename T>
387 template<
typename Stream,
typename T>
396 return t.serializedLength();
405 namespace message_operations
408 template<
class ContainerAllocator>
411 template<
typename Stream>
static void stream(Stream& s,
const std::string& indent, const ::blob::Blob_<ContainerAllocator>& v)
413 s << indent <<
"(blob)";
420 #endif // BLOB_MESSAGE_BLOB_H
static void stream(Stream &s, const std::string &indent, const ::blob::Blob_< ContainerAllocator > &v)
boost::shared_ptr< const Buffer > ConstBufferPtr
boost::shared_ptr< std::map< std::string, std::string > > __connection_header
#define ROS_WARN_NAMED(name,...)
void read(Stream &stream)
boost::shared_ptr< ::blob::Blob > BlobPtr
boost::shared_ptr< ::blob::Blob_< ContainerAllocator > > Ptr
bool setFromCompressedData(const void *data, uint32_t size)
Blob_(const void *data, size_type size, bool compressed=false)
void setCompressed(bool compressed)
static const char * value(const ::blob::Blob_< ContainerAllocator > &)
static const char * value()
const value_type * pointer_
static const char * value()
std::vector< value_type > Buffer
boost::shared_ptr< M > instantiate() const
uint32_t serializedLength() const
static const char * value(const ::blob::Blob_< ContainerAllocator > &)
#define ROS_DEBUG_NAMED(name,...)
boost::shared_ptr< ::blob::Blob const > BlobConstPtr
void write(Stream &stream) const
Blob_(const ContainerAllocator &_alloc)
static const char * value()
const value_type * data() const
void copy(const value_type *data, size_type size)
void serialize(const M &message)
void serialize(Stream &stream, const T &t)
const value_type * end() const
bool isCompressed() const
static void read(Stream &stream, T &t)
Blob_< ContainerAllocator > Type
boost::shared_ptr< Buffer > BufferPtr
ConstBufferPtr compressed_blob_
bool inflate(const uint8_t *data, uint32_t size, std::vector< uint8_t > &inflated)
const value_type * begin() const
ConstBufferPtr getCompressedBlob() const
uint32_t serializationLength(const T &t)
bool deflate(const uint8_t *data, uint32_t size, std::vector< uint8_t > &deflated)
static const char * value(const ::blob::Blob_< ContainerAllocator > &)
bool decompress(const uint8_t *data, uint32_t size)
ShapeShifter asMessage() const
void deserialize(Stream &stream, T &t)
static uint32_t serializedLength(const T &t)
::blob::Blob_< std::allocator< void > > Blob
Blob_< ContainerAllocator > & operator=(const Blob_< ContainerAllocator > &other)
boost::shared_ptr< ::blob::Blob_< ContainerAllocator > const > ConstPtr
static void write(Stream &stream, const T &t)