OMNeT++ Simulation Library  6.0.3
cSoftOwner Class Reference

#include <csoftowner.h>

Description

Internal class, used as a base class for modules and channels. It is not intended for subclassing outside the simulation kernel.

cSoftOwner acts as a "soft owner" (see object ownership discussion in cOwnedObject documentation).

Inheritance diagram for cSoftOwner:
cNoncopyableOwnedObject cOwnedObject noncopyable cNamedObject cObject cComponent cChannel cModule cDatarateChannel cDelayChannel cIdealChannel cSimpleModule

Public Member Functions

Constructors, destructor, assignment.
 cSoftOwner (const char *name=nullptr, bool namepooling=true)
 
virtual ~cSoftOwner ()
 
Redefined cObject methods.
virtual bool isSoftOwner () const override
 
virtual std::string str () const override
 
virtual void forEachChild (cVisitor *v) override
 
Container functions.
int getNumOwnedObjects () const
 
cOwnedObjectgetOwnedObject (int k)
 
- Public Member Functions inherited from cNoncopyableOwnedObject
 cNoncopyableOwnedObject (const char *name=nullptr, bool namepooling=true)
 
virtual cNoncopyableOwnedObjectdup () const override
 
- Public Member Functions inherited from cOwnedObject
 cOwnedObject ()
 
 cOwnedObject (const char *name, bool namepooling=true)
 
 cOwnedObject (const cOwnedObject &obj)
 
virtual ~cOwnedObject ()
 
cOwnedObjectoperator= (const cOwnedObject &o)
 
virtual cObjectgetOwner () const override
 
virtual bool isOwnedObject () const override
 
- Public Member Functions inherited from cNamedObject
 cNamedObject ()
 
 cNamedObject (const char *name, bool namepooling=true)
 
 cNamedObject (const cNamedObject &obj)
 
virtual ~cNamedObject ()
 
cNamedObjectoperator= (const cNamedObject &o)
 
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::ostream & printOn (std::ostream &os) const
 
cObjectfindObject (const char *name, bool deep=true)
 
virtual cClassDescriptorgetDescriptor () const
 
void copyNotSupported () const
 

Protected Member Functions

Redefined cObject member functions
virtual void take (cOwnedObject *obj) override
 
virtual void drop (cOwnedObject *obj) override
 
- Protected Member Functions inherited from cObject
void dropAndDelete (cOwnedObject *obj)
 

Additional Inherited Members

- Static Public Member Functions inherited from cOwnedObject
static long getTotalObjectCount ()
 
static long getLiveObjectCount ()
 
static void resetObjectCounters ()
 
static cSoftOwnergetOwningContext ()
 

Constructor & Destructor Documentation

◆ cSoftOwner()

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

Constructor.

◆ ~cSoftOwner()

virtual ~cSoftOwner ( )
virtual

Destructor. The contained objects will be reported as undisposed.

Member Function Documentation

◆ take()

virtual void take ( cOwnedObject obj)
overrideprotectedvirtual

Redefined.

Reimplemented from cObject.

◆ drop()

virtual void drop ( cOwnedObject obj)
overrideprotectedvirtual

Redefined.

Reimplemented from cObject.

◆ isSoftOwner()

virtual bool isSoftOwner ( ) const
inlineoverridevirtual

Returns true.

Reimplemented from cObject.

◆ str()

virtual std::string str ( ) const
overridevirtual

Produces a one-line description of the object's contents. See cObject for more details.

Reimplemented from cObject.

Reimplemented in cModule, cSimpleModule, cDatarateChannel, and cChannel.

◆ forEachChild()

virtual void forEachChild ( cVisitor v)
overridevirtual

Calls v->visit(this) for each contained object. See cObject for more details.

Reimplemented from cObject.

Reimplemented in cModule, cComponent, and cSimpleModule.

◆ getNumOwnedObjects()

int getNumOwnedObjects ( ) const
inline

Returns the number of owned objects.

◆ getOwnedObject()

cOwnedObject* getOwnedObject ( int  k)

Returns the kth owned object. k must be between 0 and getNumOwnedObjects()-1 (inclusive). If the index is out of bounds, nullptr is returned.


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