OMNeT++ Simulation Library  5.4.1
cProperties Class Reference

#include <cproperties.h>

Description

A collection of properties (cProperty).

Inheritance diagram for cProperties:
cObject

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)
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
bool isName (const char *s) const
 
virtual const char * getFullName () const
 
virtual std::string getFullPath () const
 
const cObjectgetThisPtr () const
 
virtual _OPPDEPRECATED std::string info () const
 
virtual _OPPDEPRECATED std::string detailedInfo () const
 
virtual cObjectgetOwner () const
 
virtual bool isOwnedObject () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (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)
 

Constructor & Destructor Documentation

cProperties ( )
explicit

Constructor.

cProperties ( const cProperties other)
inline

Copy constructor.

virtual ~cProperties ( )
virtual

Destructor.

Member Function Documentation

cProperties& operator= ( const cProperties other)

Assignment operator.

virtual cProperties* dup ( ) const
inlineoverridevirtual

Creates and returns an exact copy of this object.

Reimplemented from cObject.

virtual const char* getName ( ) const
inlineoverridevirtual

Returns object name.

Reimplemented from cObject.

virtual std::string str ( ) const
overridevirtual

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

Reimplemented from cObject.

virtual void parsimPack ( cCommBuffer buffer) const
overridevirtual

Serializes the object into a buffer.

Reimplemented from cObject.

virtual void parsimUnpack ( cCommBuffer buffer)
overridevirtual

Deserializes the object from a buffer.

Reimplemented from cObject.

virtual int getNumProperties ( ) const
inlinevirtual

Returns the number of properties.

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.

virtual cProperty* get ( int  k) const
virtual

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

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.

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 (!)

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.

virtual void add ( cProperty p)
virtual

Adds the given property to this object.

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: