16 #ifndef __OMNETPP_COWNEDOBJECT_H 17 #define __OMNETPP_COWNEDOBJECT_H 21 #include "simkerneldefs.h" 23 #include "cnamedobject.h" 24 #include "cexception.h" 122 static long totalObjectCount;
123 static long liveObjectCount;
130 virtual void removeFromOwnershipTree();
148 explicit cOwnedObject(
const char *name,
bool namepooling=
true);
178 virtual void parsimPack(
cCommBuffer *buffer)
const override;
183 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
265 virtual void parsimPack(
cCommBuffer *buffer)
const override;
270 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
277 class SIM_API cStaticFlag
280 static bool staticFlag;
281 static bool exitingFlag;
283 cStaticFlag() {staticFlag =
true;}
284 ~cStaticFlag() {staticFlag =
false;}
285 static bool insideMain() {
return staticFlag;}
286 static bool isExiting() {
return exitingFlag;}
287 static void setExiting() {exitingFlag =
true;}
290 SIM_API std::ostream& operator<< (std::ostream& os,
const cOwnedObject *p);
291 SIM_API std::ostream& operator<< (std::ostream& os,
const cOwnedObject& o);
293 inline std::ostream& operator<< (std::ostream& os,
cOwnedObject *p) {
297 inline std::ostream& operator<< (std::ostream& os,
cOwnedObject& o) {
static void resetObjectCounters()
Definition: cownedobject.h:237
Internal class, used as a base class for modules and channels. It is not intended for subclassing out...
Definition: cdefaultlist.h:33
static long getLiveObjectCount()
Definition: cownedobject.h:231
The message class in OMNeT++. cMessage objects may represent events, messages, jobs or other entities...
Definition: cmessage.h:95
virtual bool isOwnedObject() const override
Definition: cownedobject.h:196
Root of the OMNeT++ class hierarchy. cObject is a lightweight class without any data members...
Definition: cobject.h:58
Simulation manager class.
Definition: csimulation.h:62
Extends cObject with a name string. Also includes a "flags" member, with bits open for use by subclas...
Definition: cnamedobject.h:36
A subclass of cMessage to represent packets, frames, datagrams, application messages, and similar data.
Definition: cpacket.h:52
static long getTotalObjectCount()
Definition: cownedobject.h:223
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41
A cObject that keeps track of its owner. It serves as base class for many classes in the OMNeT++ libr...
Definition: cownedobject.h:104
Utility class, to make it impossible to call the operator= and copy constructor of any class derived ...
Definition: cobject.h:311
Definition: cabstracthistogram.h:21
Base class for cOwnedObject-based classes that do not wish to support assignment and duplication...
Definition: cownedobject.h:248
virtual bool isSoftOwner() const
Definition: cownedobject.h:204
virtual cObject * getOwner() const override
Definition: cownedobject.h:191
cNoncopyableOwnedObject(const char *name=nullptr, bool namepooling=true)
Definition: cownedobject.h:254