#include <string.h>
#include <platdep/sockets.h>
#include <stdexcept>
#include <omnetpp.h>
#include "cnetcommbuffer.h"
#include <ccommbufferbase.h>
Go to the source code of this file.
Defines | |
#define | STOREARRAY(type, d, size) {memcpy(mBuffer+mMsgSize,d,size*sizeof(type)); mMsgSize+=size*sizeof(type);} |
#define | EXTRACTARRAY(type, d, size) |
#define | STORE(type, d) {memcpy(mBuffer+mMsgSize,(void*)&d,sizeof(type)); mMsgSize+=sizeof(type);} |
#define | EXTRACT(type, d) |
#define EXTRACT | ( | type, | |||
d | ) |
{\ if ((mPosition + sizeof(type)) <= (uint32_t)mBufferSize) {\ memcpy((void*)&d,mBuffer+mPosition,sizeof(type)); mPosition+=sizeof(type);\ } else {\ throw cRuntimeError("OverSim cnetcommbuffer.cc: EXTRACT buffer overflow!");\ }\ }
Definition at line 40 of file cnetcommbuffer.cc.
Referenced by cNetCommBuffer::unpack().
#define EXTRACTARRAY | ( | type, | |||
d, | |||||
size | ) |
{\ if ((mPosition + size*sizeof(type)) <= (uint32_t)mBufferSize) {\ memcpy(d,mBuffer+mPosition,size*sizeof(type)); mPosition+=size*sizeof(type);\ } else {\ throw cRuntimeError("OverSim cnetcommbuffer.cc: EXTRACTARRAY buffer overflow!");\ }\ }
Definition at line 31 of file cnetcommbuffer.cc.
Referenced by cNetCommBuffer::unpack().
#define STORE | ( | type, | |||
d | ) | {memcpy(mBuffer+mMsgSize,(void*)&d,sizeof(type)); mMsgSize+=sizeof(type);} |
Definition at line 39 of file cnetcommbuffer.cc.
Referenced by cNetCommBuffer::pack().
#define STOREARRAY | ( | type, | |||
d, | |||||
size | ) | {memcpy(mBuffer+mMsgSize,d,size*sizeof(type)); mMsgSize+=size*sizeof(type);} |
Definition at line 30 of file cnetcommbuffer.cc.
Referenced by cNetCommBuffer::pack().