How can i send c++ class object via boost::interprocess::message_queue?
//Class Defination
#define MQ_DATA IPCMsg
class IPCMsg
{
public:
IPCMsg() { data = NULL; }
int len;
void* data;
};
// Initialize message Queue
mSendMq = new message_queue(OPEN_OR_CREATE, "MQ", 1024, sizeof(MQ_DATA));
mReceiveMq = new message_queue(OPEN_ONLY, "MQ");
// Send Data to message Queue
MQ_DATA* inData = new IPCMsg();
mSendMq->send(inData, sizeof(*inData), 0);
// Receive Data from message Queue
MQ_DATA* outdata = NULL;
mReceiveMq->receive(&outdata, sizeof(*outdata), 1024, priority);