Version: 9.12.0
XAO::GeometricElementList Class Reference

Generic class to manipulate a list of topologic element.

#include <XAO_GeometricElement.hxx>

Public Types

typedef std::map< int, GeometricElement >::iterator iterator
 Iterator on the element of the list. More...
 

Public Member Functions

 GeometricElementList ()
 Default constructor. More...
 
 GeometricElementList (int nb)
 Constructor with size. More...
 
virtual ~GeometricElementList ()
 Destructor. More...
 
int getSize () const
 Gets the size of the list. More...
 
void setSize (int nb)
 Sets the size of the list. More...
 
void setElement (int index, const std::string &name, const std::string &reference)
 Sets the name and the reference of an element. More...
 
const std::string getName (int index)
 Gets the name of an element. More...
 
void setName (int index, const std::string &name)
 Sets the name of an element. More...
 
bool hasName (int index)
 Checks if an element has a name. More...
 
const std::string getReference (int index)
 Gets the reference of an element. More...
 
void setReference (int index, const std::string &reference)
 Sets the reference of an element. More...
 
int getIndexByReference (const std::string &reference)
 Gets the index of an element using its reference. More...
 
iterator begin ()
 Gets an iterator on the first element. More...
 
iterator end ()
 Gets an iterator on the last element. More...
 

Private Member Functions

void checkElementIndex (int index) const
 

Private Attributes

int m_count
 
std::map< int, GeometricElementm_elements
 

Member Typedef Documentation

◆ iterator

Constructor & Destructor Documentation

◆ GeometricElementList() [1/2]

GeometricElementList::GeometricElementList ( )

References setSize().

◆ GeometricElementList() [2/2]

GeometricElementList::GeometricElementList ( int  nb)
Parameters
nbthe size to set.

References setSize().

◆ ~GeometricElementList()

virtual XAO::GeometricElementList::~GeometricElementList ( )
inlinevirtual

Member Function Documentation

◆ begin()

iterator XAO::GeometricElementList::begin ( )
inline
Returns
an iterator on the first element.

◆ checkElementIndex()

void GeometricElementList::checkElementIndex ( int  index) const
private

References m_count.

◆ end()

iterator XAO::GeometricElementList::end ( )
inline
Returns
an iterator on the last element.

◆ getIndexByReference()

int GeometricElementList::getIndexByReference ( const std::string &  reference)
Parameters
referencethe searched reference.
Returns
the index of the element or -1 if no element found.

References getReference(), m_count, and m_elements.

◆ getName()

const std::string GeometricElementList::getName ( int  index)
Parameters
indexthe index of the element to set.
Returns
the name of the element with the given index.
Exceptions
XAO_Exceptionif index is bigger than the size of the list.

References checkElementIndex(), and m_elements.

◆ getReference()

const std::string GeometricElementList::getReference ( int  index)
Parameters
indexthe index of the element.
Returns
the reference of the element.
Exceptions
XAO_Exceptionif index is bigger than the size of the list.

References checkElementIndex(), and m_elements.

◆ getSize()

int XAO::GeometricElementList::getSize ( ) const
inline
Returns
the size of the list.

◆ hasName()

bool GeometricElementList::hasName ( int  index)
Parameters
indexthe index of the element.
Returns
true if the element has a name, false otherwise.

References checkElementIndex(), and m_elements.

◆ setElement()

void GeometricElementList::setElement ( int  index,
const std::string &  name,
const std::string &  reference 
)
Parameters
indexthe index of the element to set.
namethe name to set.
referencethe reference to set.
Exceptions
XAO_Exceptionif index is bigger than the size of the list.

References checkElementIndex(), and m_elements.

◆ setName()

void GeometricElementList::setName ( int  index,
const std::string &  name 
)
Parameters
indexthe index of the element.
namethe name to set.
Exceptions
XAO_Exceptionif index is bigger than the size of the list.

References checkElementIndex(), and m_elements.

◆ setReference()

void GeometricElementList::setReference ( int  index,
const std::string &  reference 
)
Parameters
indexthe index of the element to set.
referencethe reference to set.
Exceptions
XAO_Exceptionif index is bigger than the size of the list.

References checkElementIndex(), and m_elements.

◆ setSize()

void GeometricElementList::setSize ( int  nb)
Parameters
nbthe size to set.
Warning
the list will be cleared.

References m_count, and m_elements.

Member Data Documentation

◆ m_count

int XAO::GeometricElementList::m_count
private

◆ m_elements

std::map<int, GeometricElement> XAO::GeometricElementList::m_elements
private

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