OMNeT++ Simulation Library  6.0.3
cNamedObject Class Reference

#include <cnamedobject.h>

Description

Extends cObject with a name string. Also includes a "flags" member, with bits open for use by subclasses.

Inheritance diagram for cNamedObject:
cObject cOwnedObject cProperty cRegistrationList cSimulation cParImpl cArray cCanvas cEnum cEvent cFigure cFSM cFutureEventSet cMsgPar cNoncopyableOwnedObject cOsgCanvas cOwnedDynamicExpression cQueue cRandom cTopology cValueContainer cBoolParImpl cDoubleParImpl cIntParImpl cObjectParImpl cStringParImpl cXMLParImpl

Public Member Functions

Constructors, destructor, assignment.
 cNamedObject ()
 
 cNamedObject (const char *name, bool namepooling=true)
 
 cNamedObject (const cNamedObject &obj)
 
virtual ~cNamedObject ()
 
cNamedObjectoperator= (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)=default
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
bool isName (const char *s) const
 
virtual const char * getFullName () const
 
virtual std::string getFullPath () const
 
virtual std::string getClassAndFullName () const
 
virtual std::string getClassAndFullPath () const
 
const cObjectgetThisPtr () const
 
virtual std::string str () const
 
virtual std::ostream & printOn (std::ostream &os) const
 
virtual cObjectdup () const
 
virtual cObjectgetOwner () const
 
virtual bool isOwnedObject () const
 
virtual bool isSoftOwner () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
virtual cClassDescriptorgetDescriptor () const
 
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)
 

Constructor & Destructor Documentation

◆ cNamedObject() [1/3]

cNamedObject ( )
inline

Create object without a name.

◆ cNamedObject() [2/3]

cNamedObject ( const char *  name,
bool  namepooling = true 
)
explicit

Create object with given name. Name pooling is an optimization feature.

◆ cNamedObject() [3/3]

cNamedObject ( const cNamedObject obj)

Copy constructor.

◆ ~cNamedObject()

virtual ~cNamedObject ( )
virtual

Destructor.

Member Function Documentation

◆ operator=()

cNamedObject& operator= ( const cNamedObject o)

The assignment operator. Derived classes should contain similar methods (cClassName& cClassName::operator=(cClassName&)).

Assignment 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()).

◆ parsimPack()

virtual void parsimPack ( cCommBuffer buffer) const
overridevirtual

Serializes the object into a buffer.

Reimplemented from cObject.

Reimplemented in cKSplit, cMessage, cQueue, cMsgPar, cArray, cOwnedObject, cHistogram, cPacket, cProperty, cPrecollectionBasedDensityEst, cEvent, cParImpl, cPacketQueue, cStdDev, cPSquare, and cStatistic.

◆ parsimUnpack()

virtual void parsimUnpack ( cCommBuffer buffer)
overridevirtual

Deserializes the object from a buffer.

Reimplemented from cObject.

Reimplemented in cKSplit, cMessage, cQueue, cMsgPar, cArray, cOwnedObject, cHistogram, cPacket, cProperty, cPrecollectionBasedDensityEst, cEvent, cParImpl, cPacketQueue, cStdDev, cPSquare, and cStatistic.

◆ setName()

virtual void setName ( const char *  s)
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.

◆ getName()

virtual const char* getName ( ) const
inlineoverridevirtual

Returns pointer to the object's name, a string stored in the object. This function never returns nullptr.

Reimplemented from cObject.

◆ setNamePooling()

virtual void setNamePooling ( bool  b)
virtual

Turn name pooling on/off. Name pooling is an optimization technique that saves memory if several objects have identical names.

◆ getNamePooling()

virtual bool getNamePooling ( )
inlinevirtual

Returns whether name pooling is turned on for this object.


The documentation for this class was generated from the following file: