#include <string.h>
#include <arpa/inet.h>
#include "cnetcommbuffer.h"
#include "util.h"
#include "cobject.h"
#include "macros.h"
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) |
Functions | |
Register_Class (cNetCommBuffer) |
#define EXTRACT | ( | type, | |||
d | ) |
Value:
{\ if ((mPosition + sizeof(type)) <= (uint)mBufferSize) {\ memcpy((void*)&d,mBuffer+mPosition,sizeof(type)); mPosition+=sizeof(type);\ } else {\ throw new cRuntimeError("OverSim cnetcommbuffer.cc: EXTRACT buffer overflow!");\ }\ }
Referenced by cNetCommBuffer::unpack().
#define EXTRACTARRAY | ( | type, | |||
d, | |||||
size | ) |
Value:
{\ if ((mPosition + size*sizeof(type)) <= (uint)mBufferSize) {\ memcpy(d,mBuffer+mPosition,size*sizeof(type)); mPosition+=size*sizeof(type);\ } else {\ throw new cRuntimeError("OverSim cnetcommbuffer.cc: EXTRACTARRAY buffer overflow!");\ }\ }
Referenced by cNetCommBuffer::unpack().
#define STORE | ( | type, | |||
d | ) | {memcpy(mBuffer+mMsgSize,(void*)&d,sizeof(type)); mMsgSize+=sizeof(type);} |
Referenced by cNetCommBuffer::pack().
#define STOREARRAY | ( | type, | |||
d, | |||||
size | ) | {memcpy(mBuffer+mMsgSize,d,size*sizeof(type)); mMsgSize+=size*sizeof(type);} |
Referenced by cNetCommBuffer::pack().
Register_Class | ( | cNetCommBuffer | ) |