OMNeT++ API 6.1
Discrete Event Simulation Library
cProperties Class Reference

Description

A collection of properties (cProperty).

Inheritance diagram for cProperties:
[legend]

Public Member Functions

Constructors, destructor, assignment.
 cProperties ()
 
 cProperties (const cProperties &other)
 
virtual ~cProperties ()
 
cPropertiesoperator= (const cProperties &other)
 
Redefined cObject functions
virtual cPropertiesdup () const override
 
virtual const char * getName () const override
 
virtual std::string str () const override
 
virtual void parsimPack (cCommBuffer *buffer) const override
 
virtual void parsimUnpack (cCommBuffer *buffer) override
 
Properties
virtual int getNumProperties () const
 
virtual const std::vector< const char * > getNames () const
 
virtual cPropertyget (int k) const
 
virtual cPropertyget (const char *name, const char *index=nullptr) const
 
virtual bool getAsBool (const char *name, const char *index=nullptr) const
 
virtual std::vector< const char * > getIndicesFor (const char *name) const
 
virtual void add (cProperty *p)
 
virtual void remove (int k)
 
- 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
 
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

◆ cProperties() [1/2]

cProperties ( )
inlineexplicit

Constructor.

◆ cProperties() [2/2]

cProperties ( const cProperties other)
inline

Copy constructor.

◆ ~cProperties()

virtual ~cProperties ( )
virtual

Destructor.

Member Function Documentation

◆ operator=()

cProperties& operator= ( const cProperties other)

Assignment operator.

◆ dup()

virtual cProperties* dup ( ) const
inlineoverridevirtual

Creates and returns an exact copy of this object.

Reimplemented from cObject.

◆ getName()

virtual const char* getName ( ) const
inlineoverridevirtual

Returns object name.

Reimplemented from cObject.

◆ str()

virtual std::string str ( ) const
overridevirtual

Produces a one-line description of the object's contents.

Reimplemented from cObject.

◆ parsimPack()

virtual void parsimPack ( cCommBuffer buffer) const
overridevirtual

Serializes the object into a buffer.

Reimplemented from cObject.

◆ parsimUnpack()

virtual void parsimUnpack ( cCommBuffer buffer)
overridevirtual

Deserializes the object from a buffer.

Reimplemented from cObject.

◆ getNumProperties()

virtual int getNumProperties ( ) const
inlinevirtual

Returns the number of properties.

◆ getNames()

virtual const std::vector<const char *> getNames ( ) const
virtual

Returns the names of cProperty object stored in this object. The strings in the returned array do not need to be deallocated and must not be modified.

◆ get() [1/2]

virtual cProperty* get ( int  k) const
virtual

Returns kth property, where 0 <= k < getNumProperties().

◆ get() [2/2]

virtual cProperty* get ( const char *  name,
const char *  index = nullptr 
) const
virtual

Returns the given property, or nullptr if it does not exist. Name and index correspond to the the NED syntax @propertyname[index](keys-and-values), where "[index]" is optional.

◆ getAsBool()

virtual bool getAsBool ( const char *  name,
const char *  index = nullptr 
) const
virtual

Returns the property as a boolean. If the property is missing, this method returns false; otherwise, only the first value in the default key ("") is examined. If it is "false", this method returns false; in all other cases (missing, empty, some other value) it returns true.

Examples: @foo: true, @foo(): true, @foo(false): false, @foo(true): true, @foo(any): true, @foo(a=x,b=y,c=z): true; @foo(somekey=false): true (!)

◆ getIndicesFor()

virtual std::vector<const char *> getIndicesFor ( const char *  name) const
virtual

Returns unique indices for a property. Name and index correspond to the NED syntax @propertyname[index](keys-and-values). The strings in the returned array do not need to be deallocated and must not be modified.

◆ add()

virtual void add ( cProperty p)
virtual

Adds the given property to this object.

◆ remove()

virtual void remove ( int  k)
virtual

Removes the given property from this object, and deletes it.


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