OMNeT++ Simulation Library  6.0.3
cvaluecontainer.h
1 //==========================================================================
2 // CVALUECONTAINER.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_CVALUECONTAINER_H
17 #define __OMNETPP_CVALUECONTAINER_H
18 
19 #include <string>
20 #include <vector>
21 #include "cvalue.h"
22 #include "cownedobject.h"
23 
24 
25 namespace omnetpp {
26 
32 class SIM_API cValueContainer : public cOwnedObject
33 {
34  private:
35  virtual void parsimPack(cCommBuffer *) const override {throw cRuntimeError(this, E_CANTPACK);}
36  virtual void parsimUnpack(cCommBuffer *) override {throw cRuntimeError(this, E_CANTPACK);}
37 
38  protected:
39  void valueCloned(cValue& value, const cValueContainer& other);
40  void takeValue(cValue& value);
41  void dropValue(cValue& value);
42  void dropAndDeleteValue(cValue& value);
43 
44  public:
46 
49  explicit cValueContainer(const char *name=nullptr) : cOwnedObject(name) {}
51 };
52 
53 
54 } // namespace omnetpp
55 
56 #endif
57 
58 
omnetpp::cValueContainer
Common base class for cValue-based containers.
Definition: cvaluecontainer.h:32
omnetpp::cValue
A variant-like value class used during evaluating NED expressions.
Definition: cvalue.h:47
omnetpp::cValueContainer::cValueContainer
cValueContainer(const char *name=nullptr)
Definition: cvaluecontainer.h:49
omnetpp::cRuntimeError
Thrown when the simulation kernel or other components detect a runtime error.
Definition: cexception.h:286
omnetpp::cCommBuffer
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41
omnetpp::cOwnedObject
A cObject that keeps track of its owner. It serves as base class for many classes in the OMNeT++ libr...
Definition: cownedobject.h:105