|
OMNeT++ API 6.1
Discrete Event Simulation Library
|
|
16 #ifndef __OMNETPP_COBJECT_H
17 #define __OMNETPP_COBJECT_H
21 #include "simkerneldefs.h"
26 #include "regmacros.h"
31 class cClassDescriptor;
97 #ifdef SIMFRONTEND_SUPPORT
99 virtual bool hasChangedSince(int64_t refreshSerial);
100 static int64_t getChangeCounter() {
return changeCounter;}
104 #ifdef SIMFRONTEND_SUPPORT
106 static int64_t changeCounter;
146 virtual const char *getClassName()
const;
154 virtual const char *
getName()
const {
return "";}
159 bool isName(
const char *s)
const;
178 virtual std::string getFullPath()
const;
186 virtual std::string getClassAndFullName()
const;
194 virtual std::string getClassAndFullPath()
const;
207 virtual std::string str()
const;
217 virtual std::ostream& printOn(std::ostream& os)
const;
282 virtual void parsimPack(
cCommBuffer *buffer)
const;
329 virtual void forEachChild(
cVisitor *v);
343 cObject *findObject(
const char *name,
bool deep=
true);
359 void copyNotSupported()
const;
366 typename std::enable_if<std::is_base_of<cObject, T>::value, std::ostream&>::type
367 operator<<(std::ostream& os,
const T *p) {
369 return p->printOn(os);
371 return os <<
"<nullptr>";
375 typename std::enable_if<std::is_base_of<cObject, T>::value, std::ostream&>::type
376 operator<<(std::ostream& os,
const T& o) {
377 return o.printOn(os);
382 template <
typename T>
383 typename std::enable_if<std::is_polymorphic<T>::value, cObject*>::type
384 as_cObject(T *p) {
return dynamic_cast<cObject*
>(p); }
386 template <
typename T>
387 typename std::enable_if<!std::is_polymorphic<T>::value, cObject*>::type
388 as_cObject(T *p) {
return nullptr; }
390 template <
typename T>
391 typename std::enable_if<std::is_polymorphic<T>::value,
const cObject*>::type
392 as_cObject(
const T *p) {
return dynamic_cast<const cObject*
>(p); }
394 template <
typename T>
395 typename std::enable_if<!std::is_polymorphic<T>::value,
const cObject*>::type
396 as_cObject(
const T *p) {
return nullptr; }
Abstract base class for class descriptors.
Definition: cclassdescriptor.h:39
cObject is a lightweight class which serves as the root of the OMNeT++ class hierarchy....
Definition: cobject.h:92
Utility class, to make it impossible to call the operator= and copy constructor of any class derived ...
Definition: cobject.h:415
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
cObject()
Definition: cobject.h:124
virtual bool isOwnedObject() const
Definition: cobject.h:309
Internal class, used as a base class for modules and channels. It is not intended for subclassing out...
Definition: csoftowner.h:33
virtual cObject * getOwner() const
Definition: cobject.h:300
virtual const char * getFullName() const
Definition: cobject.h:169
virtual const char * getName() const
Definition: cobject.h:154
virtual bool isSoftOwner() const
Definition: cobject.h:319
const cObject * getThisPtr() const
Definition: cobject.h:199
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:105