#include <string.h>#include <platdep/sockets.h>#include <stdexcept>#include <omnetpp.h>#include "cnetcommbuffer.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 | ) |
Value:
{\
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 | ) |
Value:
{\
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);} |
| #define STOREARRAY | ( | type, | |||
| d, | |||||
| size | ) | {memcpy(mBuffer+mMsgSize,d,size*sizeof(type)); mMsgSize+=size*sizeof(type);} |
1.5.8