Project

General

Profile

Statistics
| Branch: | Revision:

root / src / sim / parsim / cmemcommbuffer.h @ 81ad8b66

History | View | Annotate | Download (4.36 KB)

1
//=========================================================================
2
//  CMEMCOMMBUFFER.H - part of
3
//
4
//                  OMNeT++/OMNEST
5
//           Discrete System Simulation in C++
6
//
7
//  Author: Andras Varga, 2003
8
//          Dept. of Electrical and Computer Systems Engineering,
9
//          Monash University, Melbourne, Australia
10
//
11
//=========================================================================
12

    
13
/*--------------------------------------------------------------*
14
  Copyright (C) 2003-2008 Andras Varga
15
  Copyright (C) 2006-2008 OpenSim Ltd.
16

17
  This file is distributed WITHOUT ANY WARRANTY. See the file
18
  `license' for details on this and other legal matters.
19
*--------------------------------------------------------------*/
20

    
21
#ifndef __CMEMCOMMBUFFER_H__
22
#define __CMEMCOMMBUFFER_H__
23

    
24
#include "ccommbufferbase.h"
25

    
26
NAMESPACE_BEGIN
27

    
28

    
29
/**
30
 * Communication buffer that packs data into a memory buffer without any
31
 * transformation.
32
 *
33
 * @ingroup Parsim
34
 */
35
class SIM_API cMemCommBuffer : public cCommBufferBase
36
{
37
  public:
38
    /**
39
     * Constructor.
40
     */
41
    cMemCommBuffer();
42

    
43
    /**
44
     * Destructor.
45
     */
46
    virtual ~cMemCommBuffer();
47

    
48
    /** @name Pack basic types */
49
    //@{
50
    virtual void pack(char d);
51
    virtual void pack(unsigned char d);
52
    virtual void pack(bool d);
53
    virtual void pack(short d);
54
    virtual void pack(unsigned short d);
55
    virtual void pack(int d);
56
    virtual void pack(unsigned int d);
57
    virtual void pack(long d);
58
    virtual void pack(unsigned long d);
59
    virtual void pack(opp_long_long d);
60
    virtual void pack(opp_unsigned_long_long d);
61
    virtual void pack(float d);
62
    virtual void pack(double d);
63
    virtual void pack(long double d);
64
    virtual void pack(const char *d);
65
    virtual void pack(const opp_string& d);
66
    virtual void pack(SimTime d);
67
    //@}
68

    
69
    /** @name Pack arrays of basic types */
70
    //@{
71
    virtual void pack(const char *d, int size);
72
    virtual void pack(const unsigned char *d, int size);
73
    virtual void pack(const bool *d, int size);
74
    virtual void pack(const short *d, int size);
75
    virtual void pack(const unsigned short *d, int size);
76
    virtual void pack(const int *d, int size);
77
    virtual void pack(const unsigned int *d, int size);
78
    virtual void pack(const long *d, int size);
79
    virtual void pack(const unsigned long *d, int size);
80
    virtual void pack(const opp_long_long *d, int size);
81
    virtual void pack(const opp_unsigned_long_long *d, int size);
82
    virtual void pack(const float *d, int size);
83
    virtual void pack(const double *d, int size);
84
    virtual void pack(const long double *d, int size);
85
    virtual void pack(const char **d, int size);
86
    virtual void pack(const opp_string *d, int size);
87
    virtual void pack(const SimTime *d, int size);
88
    //@}
89

    
90
    /** @name Unpack basic types */
91
    //@{
92
    virtual void unpack(char& d);
93
    virtual void unpack(unsigned char& d);
94
    virtual void unpack(bool& d);
95
    virtual void unpack(short& d);
96
    virtual void unpack(unsigned short& d);
97
    virtual void unpack(int& d);
98
    virtual void unpack(unsigned int& d);
99
    virtual void unpack(long& d);
100
    virtual void unpack(unsigned long& d);
101
    virtual void unpack(opp_long_long& d);
102
    virtual void unpack(opp_unsigned_long_long& d);
103
    virtual void unpack(float& d);
104
    virtual void unpack(double& d);
105
    virtual void unpack(long double& d);
106
    virtual void unpack(const char *&d);
107
    virtual void unpack(opp_string& d);
108
    virtual void unpack(SimTime& d);
109
    //@}
110

    
111
    /** @name Unpack arrays of basic types */
112
    //@{
113
    virtual void unpack(char *d, int size);
114
    virtual void unpack(unsigned char *d, int size);
115
    virtual void unpack(bool *d, int size);
116
    virtual void unpack(short *d, int size);
117
    virtual void unpack(unsigned short *d, int size);
118
    virtual void unpack(int *d, int size);
119
    virtual void unpack(unsigned int *d, int size);
120
    virtual void unpack(long *d, int size);
121
    virtual void unpack(unsigned long *d, int size);
122
    virtual void unpack(opp_long_long *d, int size);
123
    virtual void unpack(opp_unsigned_long_long *d, int size);
124
    virtual void unpack(float *d, int size);
125
    virtual void unpack(double *d, int size);
126
    virtual void unpack(long double *d, int size);
127
    virtual void unpack(const char **d, int size);
128
    virtual void unpack(opp_string *d, int size);
129
    virtual void unpack(SimTime *d, int size);
130
    //@}
131
};
132

    
133
NAMESPACE_END
134

    
135

    
136
#endif
137