CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
OdRxAttributeCollection Class Reference

#include <RxAttribute.h>

Public Member Functions

 OdRxAttributeCollection ()
 
 ~OdRxAttributeCollection ()
 
int count () const
 
const OdRxAttributegetAt (int index) const
 
OdRxAttributegetAt (int index)
 
const OdRxAttributeget (const OdRxClass *type) const
 
OdRxAttributeget (const OdRxClass *type)
 
OdResult add (const OdRxAttribute *attribute)
 
OdResult override (const OdRxAttribute *attribute)
 
OdResult remove (const OdRxAttribute *attribute)
 

Friends

class OdRxAttributeCollectionImpl
 

Detailed Description

<group OdRx_Classes>

Container for the attributes of a member (OdRxMember). Attribute collection may have only one attribute of the given class.

Definition at line 72 of file RxAttribute.h.

Constructor & Destructor Documentation

◆ OdRxAttributeCollection()

OdRxAttributeCollection::OdRxAttributeCollection ( )

Default constructor. Creates an OdRxAttributeCollection instance with default parameters.

◆ ~OdRxAttributeCollection()

OdRxAttributeCollection::~OdRxAttributeCollection ( )

Default destructor. Destroys the OdRxAttributeCollection object.

Member Function Documentation

◆ add()

OdResult OdRxAttributeCollection::add ( const OdRxAttribute attribute)

Add an attribute to the collection. If the collection already has an attribute of this class, it will not be replaced.

Parameters
attribute[in] Attribute to be added to the collection.
Returns
eOk if an attribute is added to the collection successfully; eInvalidInput if the attribute parameter is invalid; eDuplicateKey if the collection already has an attribute of this type.

◆ count()

int OdRxAttributeCollection::count ( ) const

Gets the number of elements in the collection.

Returns
Number of elements in the collection.

◆ get() [1/2]

OdRxAttribute * OdRxAttributeCollection::get ( const OdRxClass type)

Finds the attribute of the given class in the collection.

Parameters
type[in] Class of the attribute to be found.
Returns
Pointer to the attribute of the given class.
Remarks
Returns 0 if the attribute of the given class in the collection is not found.

◆ get() [2/2]

const OdRxAttribute * OdRxAttributeCollection::get ( const OdRxClass type) const

Finds the attribute of the given class in the collection (constant version).

Parameters
type[in] Class of the attribute to be found.
Returns
Pointer to the attribute of the given class.
Remarks
Returns 0 if the attribute of the given class in the collection is not found.

◆ getAt() [1/2]

OdRxAttribute * OdRxAttributeCollection::getAt ( int  index)

Retrieves the attribute at the specified index (non-constant version).

Parameters
index[in] Index of the attribute to be retrieved.
Returns
Pointer to the attribute at the given index.

◆ getAt() [2/2]

const OdRxAttribute * OdRxAttributeCollection::getAt ( int  index) const

Retrieves the attribute at the specified index (constant version).

Parameters
index[in] Index of the attribute to be retrieved.
Returns
Pointer to the attribute at the given index.

◆ override()

OdResult OdRxAttributeCollection::override ( const OdRxAttribute attribute)

Adds an attribute to the collection. If the collection already has an attribute of this class, it will be replaced.

Parameters
attribute[in] Attribute to be added to the collection.
Returns
eOk if the attribute is added to the collection successfully, or eInvalidInput if the attribute parameter is invalid.

◆ remove()

OdResult OdRxAttributeCollection::remove ( const OdRxAttribute attribute)

Removes the attribute of that type from the collection.

Parameters
attribute[in] Attribute to be removed from the collection.
Returns
eOk if the attribute is removed successfully, or eKeyNotFound otherwise.

Friends And Related Function Documentation

◆ OdRxAttributeCollectionImpl

friend class OdRxAttributeCollectionImpl
friend

Definition at line 75 of file RxAttribute.h.


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