packing.h Source File

API: packing.h Source File
API
packing.h
1//==========================================================================
2// PACKING.H - part of
3// OMNeT++/OMNEST
4// Discrete System Simulation in C++
5//
6//==========================================================================
7
8/*--------------------------------------------------------------*
9 Copyright (C) 1992-2017 Andras Varga
10 Copyright (C) 2006-2017 OpenSim Ltd.
11
12 This file is distributed WITHOUT ANY WARRANTY. See the file
13 `license' for details on this and other legal matters.
14*--------------------------------------------------------------*/
15
16#ifndef __OMNETPP_PACKING_H
17#define __OMNETPP_PACKING_H
18
19#include "ccommbuffer.h"
20
21namespace omnetpp {
22
23//
24// pack/unpack functions for primitive types
25//
26#define DOPACKING(T,R) \
27 inline void doParsimPacking(omnetpp::cCommBuffer *b, const T R a) {b->pack(a);} \
28 inline void doParsimPacking(omnetpp::cCommBuffer *b, const T *a, int n) {b->pack(a,n);} \
29 inline void doParsimUnpacking(omnetpp::cCommBuffer *b, T& a) {b->unpack(a);} \
30 inline void doParsimUnpacking(omnetpp::cCommBuffer *b, T *a, int n) {b->unpack(a,n);}
31#define _
32DOPACKING(char,_)
33DOPACKING(unsigned char,_)
34DOPACKING(bool,_)
35DOPACKING(short,_)
36DOPACKING(unsigned short,_)
37DOPACKING(int,_)
38DOPACKING(unsigned int,_)
39DOPACKING(long,_)
40DOPACKING(unsigned long,_)
41DOPACKING(float,_)
42DOPACKING(double,_)
43DOPACKING(long double,_)
44DOPACKING(char *,_)
45DOPACKING(SimTime,&)
46DOPACKING(opp_string,&)
47#undef _
48#undef DOPACKING
49
50} // namespace omnetpp
51
52#endif
53
int64_t-based, base-10 fixed-point simulation time.
Definition simtime.h:67
Lightweight string class, used internally in some parts of OMNeT++.
Definition opp_string.h:40