OMNeT++ Simulation Library
5.6.1
|
#include <cnamedobject.h>
Extends cObject with a name string. Also includes a "flags" member, with bits open for use by subclasses.
Public Member Functions | |
Constructors, destructor, assignment. | |
cNamedObject () | |
cNamedObject (const char *name, bool namepooling=true) | |
cNamedObject (const cNamedObject &obj) | |
virtual | ~cNamedObject () |
cNamedObject & | operator= (const cNamedObject &o) |
virtual void | parsimPack (cCommBuffer *buffer) const override |
virtual void | parsimUnpack (cCommBuffer *buffer) override |
Handling the name string. | |
virtual void | setName (const char *s) |
virtual const char * | getName () const override |
virtual void | setNamePooling (bool b) |
virtual bool | getNamePooling () |
Public Member Functions inherited from cObject | |
cObject () | |
cObject (const cObject &other) | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
bool | isName (const char *s) const |
virtual const char * | getFullName () const |
virtual std::string | getFullPath () const |
const cObject * | getThisPtr () const |
virtual std::string | str () const |
virtual _OPPDEPRECATED std::string | info () const |
virtual _OPPDEPRECATED std::string | detailedInfo () const |
virtual cObject * | dup () const |
virtual cObject * | getOwner () const |
virtual bool | isOwnedObject () const |
virtual void | forEachChild (cVisitor *v) |
cObject * | findObject (const char *name, bool deep=true) |
void | copyNotSupported () const |
Additional Inherited Members | |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
cNamedObject | ( | ) |
Create object without a name.
|
explicit |
Create object with given name. Name pooling is an optimization feature.
cNamedObject | ( | const cNamedObject & | obj | ) |
Copy constructor.
|
virtual |
Destructor.
cNamedObject& operator= | ( | const cNamedObject & | o | ) |
The assignment operator. Derived classes should contain similar methods (cClassName& cClassName::operator=(cClassName&)
).
Assigment copies the contents of the object EXCEPT for the name string. If you want to copy the name string, you can do it by hand: setName(o.getName()
).
|
overridevirtual |
Serializes the object into a buffer.
Reimplemented from cObject.
Reimplemented in cTopology, cNoncopyableOwnedObject, cLegacyHistogram, cFSM, cKSplit, cMessage, cQueue, cArray, cMsgPar, cOwnedObject, cHistogram, cPacket, cChannel, cProperty, cPrecollectionBasedDensityEst, cEvent, cDefaultList, cVarHistogram, cParImpl, cOutVector, cPacketQueue, cStdDev, cPSquare, cLegacyHistogramBase, cStatistic, cBoolParImpl, cDoubleParImpl, cStringParImpl, cIntParImpl, and cXMLParImpl.
|
overridevirtual |
Deserializes the object from a buffer.
Reimplemented from cObject.
Reimplemented in cTopology, cNoncopyableOwnedObject, cLegacyHistogram, cFSM, cKSplit, cMessage, cQueue, cArray, cMsgPar, cOwnedObject, cHistogram, cPacket, cChannel, cPrecollectionBasedDensityEst, cProperty, cEvent, cDefaultList, cVarHistogram, cParImpl, cPacketQueue, cOutVector, cStdDev, cPSquare, cLegacyHistogramBase, cStatistic, cBoolParImpl, cDoubleParImpl, cStringParImpl, cIntParImpl, and cXMLParImpl.
|
virtual |
Sets object's name. The object creates its own copy of the string. nullptr may also be passed, which will be interpreted as an empty string ("").
Reimplemented in cModule, cProperty, and cOutVector.
|
inlineoverridevirtual |
Returns pointer to the object's name, a string stored in the object. This function never returns nullptr.
Reimplemented from cObject.
|
virtual |
Turn name pooling on/off. Name pooling is an optimization technique that saves memory if several objects have identical names.
|
inlinevirtual |
Returns whether name pooling is turned on for this object.