Overview Tutorial API reference Examples Build Download ZmqMessage 0.1 - 21 Oct 2011

include/zmqmessage/RawMessage.hpp

Go to the documentation of this file.
00001 
00009 #ifndef ZMQMESSAGE_RAWMESSAGE_HPP_
00010 #define ZMQMESSAGE_RAWMESSAGE_HPP_
00011 
00012 namespace ZmqMessage
00013 {
00023   struct RawMessage
00024   {
00025     union
00026     {
00027       void* ptr;
00028       const void* cptr;
00029     } data;
00030     size_t sz;
00031     zmq::free_fn* deleter;
00032 
00037     inline RawMessage(void* data_p, size_t sz_p, zmq::free_fn* deleter_p) :
00038       sz(sz_p), deleter(deleter_p)
00039     {
00040       data.ptr = data_p;
00041     }
00042 
00046     inline RawMessage(const void* data_p, size_t sz_p) :
00047       sz(sz_p), deleter(0)
00048     {
00049       data.cptr = data_p;
00050     }
00051   };
00052 }
00053 
00054 #endif /* ZMQMESSAGE_RAWMESSAGE_HPP_ */

ZmqMessage 0.1 — open source software, support@zmqmessage.org