Statistics
| Branch: | Revision:

root / src / sim / ccommbuffer.cc @ 08285dff

History | View | Annotate | Download (1.13 KB)

1 01873262 Georg Kunz
//=========================================================================
2
//  CCOMMBUFFER.CC - part of
3
//
4
//                  OMNeT++/OMNEST
5
//           Discrete System Simulation in C++
6
//
7
//  Author: Andras Varga, 2003
8
//
9
//=========================================================================
10
11
/*--------------------------------------------------------------*
12
  Copyright (C) 2003-2008 Andras Varga
13
  Copyright (C) 2006-2008 OpenSim Ltd.
14
  Monash University, Dept. of Electrical and Computer Systems Eng.
15
  Melbourne, Australia
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
22
#include "ccommbuffer.h"
23
#include "simutil.h"
24
#include "cobject.h"
25
#include "cobjectfactory.h"    // createOne()
26
27
USING_NAMESPACE
28
29
30
void cCommBuffer::packObject(cObject *obj)
31
{
32
    pack(obj->getClassName());
33
    obj->parsimPack(this);
34
}
35
36
cObject *cCommBuffer::unpackObject()
37
{
38
    char *classname;
39
    unpack(classname);
40
    cObject *obj = createOne(classname);
41
    delete [] classname;
42
43
    obj->parsimUnpack(this);
44
    return obj;
45
}