cStdVectorDescriptor< E > Class Template Reference¶

API: cStdVectorDescriptor< E > Class Template Reference
API
cStdVectorDescriptor< E > Class Template Reference
Inheritance diagram for cStdVectorDescriptor< E >:
[legend]

Public Member Functions

virtual std::string getValueAsString (any_ptr object) const override
virtual int getFieldCount () const override
virtual const char * getFieldName (int field) const override
virtual unsigned int getFieldTypeFlags (int field) const override
virtual const char * getFieldTypeString (int field) const override
virtual int getFieldArraySize (any_ptr object, int field) const override
virtual void setFieldArraySize (any_ptr object, int field, int size) const override
virtual std::string getFieldValueAsString (any_ptr object, int field, int i) const override
virtual void setFieldValueAsString (any_ptr object, int field, int i, const char *value) const override
virtual const char * getFieldStructName (int field) const override
virtual any_ptr getFieldStructValuePointer (any_ptr object, int field, int i) const override
Public Member Functions inherited from cDynamicDescriptor
virtual const char ** getPropertyNames () const override
virtual const char * getProperty (const char *propertyName) const override
virtual const char ** getFieldPropertyNames (int field) const override
virtual const char * getFieldProperty (int field, const char *propertyName) const override
virtual cValue getFieldValue (any_ptr object, int field, int i) const override
virtual void setFieldValue (any_ptr object, int field, int i, const cValue &value) const override
virtual void setFieldStructValuePointer (any_ptr object, int field, int i, any_ptr ptr) const override
Public Member Functions inherited from cClassDescriptor
 cClassDescriptor (const char *className, const char *baseClassName=nullptr)
virtual ~cClassDescriptor ()
virtual bool doesSupport (cObject *obj) const
virtual cClassDescriptorgetBaseClassDescriptor () const
bool extendsCObject () const
std::string getNamespace () const
int getInheritanceChainLength () const
virtual void setValueAsString (any_ptr object, const char *value) const
virtual int findField (const char *fieldName) const
virtual const char * getFieldDeclaredOn (int field) const
virtual const char * getFieldDynamicTypeString (any_ptr object, int field, int i) const
virtual std::string getFieldArrayIndexString (any_ptr object, int field, int arrayIndex) const
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::string str () const
virtual std::ostream & printOn (std::ostream &os) 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

Public Types inherited from cClassDescriptor
enum  {
  FD_ISARRAY = 0x01 , FD_ISCOMPOUND = 0x02 , FD_ISPOINTER = 0x04 , FD_ISCOBJECT = 0x08 ,
  FD_ISCOWNEDOBJECT = 0x10 , FD_ISEDITABLE = 0x20 , FD_ISREPLACEABLE = 0x40 , FD_ISRESIZABLE = 0x80 ,
  FD_NONE = 0x0
}
 Field types. More...
Static Public Member Functions inherited from cClassDescriptor
static cClassDescriptorgetDescriptorFor (const char *classname)
static cClassDescriptorgetDescriptorFor (const cObject *object)
Static Public Member Functions inherited from cOwnedObject
static long getTotalObjectCount ()
static long getLiveObjectCount ()
static void resetObjectCounters ()
static cSoftOwnergetOwningContext ()
Static Public Attributes inherited from cClassDescriptor
static constexpr const char * UNPRINTABLE = "(unprintable)"
 Returned by getValueAsString() and getFieldValueAsString() for types that have no text representation.
Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
virtual void drop (cOwnedObject *obj)
void dropAndDelete (cOwnedObject *obj)

Description

template<typename E>
class omnetpp::internal::cStdVectorDescriptor< E >

Descriptor for std::vector<E>. Pretends to have a single "elements[]" array field of type E.

Member Function Documentation

◆ getValueAsString()

template<typename E>
virtual std::string getValueAsString ( any_ptr object) const
inlineoverridevirtual

Returns the value of the given object as a string.

Reimplemented from cClassDescriptor.

◆ getFieldCount()

template<typename E>
virtual int getFieldCount ( ) const
inlineoverridevirtual

Returns the number of fields in the described class.

Reimplemented from cDynamicDescriptor.

◆ getFieldName()

template<typename E>
virtual const char * getFieldName ( int field) const
inlineoverridevirtual

Returns the name of a field in the described class. The argument must be in the 0..getFieldCount()-1 range, inclusive.

Reimplemented from cDynamicDescriptor.

◆ getFieldTypeFlags()

template<typename E>
virtual unsigned int getFieldTypeFlags ( int field) const
inlineoverridevirtual

Returns the type flags of a field in the described class. Flags is a binary OR of the following: FD_ISARRAY, FD_ISCOMPOUND, FD_ISPOINTER, FD_ISCOWNEDOBJECT, FD_ISCOBJECT. The argument must be in the 0..getFieldCount()-1 range, inclusive.

Reimplemented from cDynamicDescriptor.

References cClassDescriptor::cClassDescriptor(), cClassDescriptor::extendsCObject(), cClassDescriptor::FD_ISARRAY, cClassDescriptor::FD_ISCOBJECT, cClassDescriptor::FD_ISCOMPOUND, cClassDescriptor::FD_ISPOINTER, and cClassDescriptor::getDescriptorFor().

◆ getFieldTypeString()

template<typename E>
virtual const char * getFieldTypeString ( int field) const
inlineoverridevirtual

Returns the declared type of a field in the described class as a string. The argument must be in the 0..getFieldCount()-1 range, inclusive.

See also
getFieldDynamicTypeString()

Reimplemented from cDynamicDescriptor.

◆ getFieldArraySize()

template<typename E>
virtual int getFieldArraySize ( any_ptr object,
int field ) const
inlineoverridevirtual

Returns the array size of a field in the given object. If the field is not an array, it returns 0.

Reimplemented from cDynamicDescriptor.

◆ setFieldArraySize()

template<typename E>
virtual void setFieldArraySize ( any_ptr object,
int field,
int size ) const
inlineoverridevirtual

Sets the array size of a field in the given object. If the operation is not successful, an exception is thrown.

The field argument must be in the 0..getFieldCount()-1 range. The i argument must be in the 0..getFieldArraySize()-1 range, or 0 if the field is not an array.

Reimplemented from cDynamicDescriptor.

References cDynamicDescriptor::setFieldArraySize().

◆ getFieldValueAsString()

template<typename E>
virtual std::string getFieldValueAsString ( any_ptr object,
int field,
int i ) const
inlineoverridevirtual

Returns the value of the given field in the given object as a string. For compound fields, the message compiler generates code which calls operator<<.

The field argument must be in the 0..getFieldCount()-1 range. The i argument must be in the 0..getFieldArraySize()-1 range, or 0 if the field is not an array.

Reimplemented from cDynamicDescriptor.

References cClassDescriptor::cClassDescriptor(), cObject::getDescriptor(), cClassDescriptor::getDescriptorFor(), cClassDescriptor::getValueAsString(), and cClassDescriptor::UNPRINTABLE.

◆ setFieldValueAsString()

template<typename E>
virtual void setFieldValueAsString ( any_ptr object,
int field,
int i,
const char * value ) const
inlineoverridevirtual

Sets the value of a field in the given object by parsing the given value string. If the operation is not successful, an exception is thrown.

The field argument must be in the 0..getFieldCount()-1 range. The i argument must be in the 0..getFieldArraySize()-1 range, or 0 if the field is not an array.

Reimplemented from cDynamicDescriptor.

References cClassDescriptor::cClassDescriptor(), cObject::getDescriptor(), cClassDescriptor::getDescriptorFor(), cDynamicDescriptor::setFieldValueAsString(), and cClassDescriptor::setValueAsString().

◆ getFieldStructName()

template<typename E>
virtual const char * getFieldStructName ( int field) const
inlineoverridevirtual

Returns the declared type name of a compound field in the described class. The field is a pointer, the "*" is removed. The return value may be used as class name to obtain a class descriptor for this compound field.

Reimplemented from cDynamicDescriptor.

◆ getFieldStructValuePointer()

template<typename E>
virtual any_ptr getFieldStructValuePointer ( any_ptr object,
int field,
int i ) const
inlineoverridevirtual

Returns the pointer to the value of a compound field in the given object. The field argument must be in the 0..getFieldCount()-1 range. The i argument must be in the 0..getFieldArraySize()-1 range, or 0 if the field is not an array.

Reimplemented from cDynamicDescriptor.