#include <cnamedobject.h>

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) |
| virtual void | parsimUnpack (cCommBuffer *buffer) |
Handling the name string. | |
| virtual void | setName (const char *s) |
| virtual const char * | getName () const |
| virtual void | setNamePooling (bool b) |
| virtual bool | getNamePooling () |
| cNamedObject::cNamedObject | ( | ) |
Create object without a name.
| cNamedObject::cNamedObject | ( | const char * | name, | |
| bool | namepooling = true | |||
| ) | [explicit] |
Create object with given name.
Name pooling is an optimization feature.
| cNamedObject::cNamedObject | ( | const cNamedObject & | obj | ) |
Copy constructor.
| virtual cNamedObject::~cNamedObject | ( | ) | [virtual] |
Destructor.
| cNamedObject& 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()).
| virtual void cNamedObject::parsimPack | ( | cCommBuffer * | buffer | ) | [virtual] |
Serializes the object into a buffer.
Reimplemented from cObject.
Reimplemented in cArray, cBoolParImpl, cChannel, cDefaultList, cDensityEstBase, cDoubleParImpl, cFSM, cHistogramBase, cHistogram, cKSplit, cLinkedList, cLongParImpl, cMessage, cPacket, cMsgPar, cOutVector, cOwnedObject, cNoncopyableOwnedObject, cPacketQueue, cParImpl, cProperty, cPSquare, cQueue, cStatistic, cStdDev, cWeightedStdDev, cStringParImpl, cTopology, cVarHistogram, and cXMLParImpl.
| virtual void cNamedObject::parsimUnpack | ( | cCommBuffer * | buffer | ) | [virtual] |
Deserializes the object from a buffer.
Reimplemented from cObject.
Reimplemented in cArray, cBoolParImpl, cChannel, cDefaultList, cDensityEstBase, cDoubleParImpl, cFSM, cHistogramBase, cHistogram, cKSplit, cLinkedList, cLongParImpl, cMessage, cPacket, cMsgPar, cOutVector, cOwnedObject, cNoncopyableOwnedObject, cPacketQueue, cParImpl, cProperty, cPSquare, cQueue, cStatistic, cStdDev, cWeightedStdDev, cStringParImpl, cTopology, cVarHistogram, and cXMLParImpl.
| virtual void cNamedObject::setName | ( | const char * | s | ) | [virtual] |
Sets object's name.
The object creates its own copy of the string. NULL pointer may also be passed, which will be interpreted as an empty string ("").
Reimplemented in cModule, cOutVector, and cProperty.
| virtual const char* cNamedObject::getName | ( | ) | const [inline, virtual] |
Returns pointer to the object's name, a string stored in the object.
This function never returns NULL.
Reimplemented from cObject.
Referenced by cObject::getFullName(), and cObject::isName().
| virtual void cNamedObject::setNamePooling | ( | bool | b | ) | [virtual] |
Turn name pooling on/off.
Name pooling is an optimization technique that saves memory if several objects have identical names.
| virtual bool cNamedObject::getNamePooling | ( | ) | [inline, virtual] |
Returns whether name pooling is turned on for this object.
1.5.5