Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
XAO::Group Class Reference

Class to represent a Geometrical Group.

#include <XAO_Group.hxx>

Public Member Functions

 Group (const XAO::Dimension &dim, const int &nbElements, const std::string &name=std::string("")) throw (XAO_Exception)
 Constructor. More...
 
virtual ~Group ()
 Destructor. More...
 
const std::string getName ()
 Gets the name of the group. More...
 
void setName (const std::string &name)
 Sets the name of the group. More...
 
const XAO::Dimension getDimension ()
 Gets the dimension of the group. More...
 
const int getNbElements ()
 Gets the numbers of elements in the geometry of the same type than the group. More...
 
const int count () const
 Gets the number of elements in the group. More...
 
const int get (const int &index)
 Gets the reference of an element. More...
 
void add (const int &value)
 Adds an element to the group. More...
 
void remove (const int &value)
 Removes an element from the group. More...
 
std::set< int >::iterator begin ()
 Gets an iterator on the first element in the group. More...
 
std::set< int >::iterator end ()
 Gets an iterator on the last element in the group. More...
 

Private Member Functions

void checkIndex (const int &element) throw (XAO_Exception)
 Ensures that the given element is valid. More...
 

Private Attributes

std::string m_name
 The name of the group. More...
 
int m_nbElements
 The number of elements in the associated geometry. More...
 
XAO::Dimension m_dimension
 The dimension of the group. More...
 
int m_count
 The number of elements in the group. More...
 
std::set< int > m_elements
 The elements of the group. More...
 

Constructor & Destructor Documentation

Group::Group ( const XAO::Dimension dim,
const int &  nbElements,
const std::string &  name = std::string("") 
) throw (XAO_Exception)
Parameters
dimthe dimension of the group.
nbElementsthe number of geometrical elements for the dimension in the geometry.
namethe name of the group.

References XAO::WHOLE.

Group::~Group ( )
virtual

Member Function Documentation

void Group::add ( const int &  value)
Parameters
valuethe index of the element to add.

References m_elements.

std::set<int>::iterator XAO::Group::begin ( )
inline
Returns
an iterator on the first element.
void Group::checkIndex ( const int &  element) throw (XAO_Exception)
private
Parameters
element
Exceptions
XAO_Exceptionif element is bigger than the number of elements.
const int XAO::Group::count ( ) const
inline
Returns
the number of elements.
std::set<int>::iterator XAO::Group::end ( )
inline
Returns
an iterator on the last element.
const int XAO::Group::get ( const int &  index)
inline
Parameters
indexthe index of the element.
Returns
the reference of the element.
Note
use begin() and end() if you need to iterate.

References it().

const XAO::Dimension XAO::Group::getDimension ( )
inline
Returns
the dimension of the group.
const std::string XAO::Group::getName ( )
inline
Returns
the name of the group.
const int XAO::Group::getNbElements ( )
inline
Returns
the number of elements in the associated geometry.
void Group::remove ( const int &  value)
Parameters
valuethe index of the element to remove.

References m_elements.

void XAO::Group::setName ( const std::string &  name)
inline
Parameters
namethe name to set.

Member Data Documentation

int XAO::Group::m_count
private
XAO::Dimension XAO::Group::m_dimension
private
std::set<int> XAO::Group::m_elements
private
std::string XAO::Group::m_name
private
int XAO::Group::m_nbElements
private

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