CEPS  24.01
Cardiac ElectroPhysiology Simulator
ceps::HoldsCells< CellType > Class Template Reference

Detailed Description

template<class CellType>
class ceps::HoldsCells< CellType >

An abstract class for objects that regroup pointers to cells (eg a mesh, a finite elements discretization, a finite volume discretization)

Definition at line 45 of file HoldsCells.hpp.

#include <HoldsCells.hpp>

Public Member Functions

 HoldsCells (const CepsVector< CellType * > &cells)
 Constructor with a vector of cells. More...
 
 HoldsCells (CellType **cells, const CepsUInt &n)
 Constructor with a vector of cells. More...
 
 HoldsCells ()=default
 Default constructor. More...
 
 HoldsCells (const HoldsCells &)=default
 Copy constructor. More...
 
 HoldsCells (HoldsCells &&) noexcept=default
 Copy constructor. More...
 
virtual ~HoldsCells ()=default
 Destructor. More...
 
HoldsCellsoperator= (const HoldsCells &)=default
 Assignment operator. More...
 
HoldsCellsoperator= (HoldsCells &&) noexcept=default
 Assignment operator. More...
 
CepsUInt getNumberOfCells () const
 Returns the number of cells in the object. More...
 
CepsUInt countValidCells ()
 Get the number of cells that are not nullptr. More...
 
CepsVector< CellType * > getValidCells ()
 Reference to the valid cells. More...
 
CepsVector< CellType * > & getCells ()
 Reference to the cells. More...
 
const CepsVector< CellType * > & getCells () const
 Reference to the cells, const version. More...
 
CellType *& getCellAt (const CepsUInt &i)
 Pointer to the i-th cell. More...
 
const CellType *& getCellAt (const CepsUInt &i) const
 Pointer to the i-th cell , const version. More...
 
void setCells (const CepsVector< CellType * > &cells)
 Replaces currently held cell pointers. More...
 
void setCells (CellType **cells, const CepsUInt &n)
 Replaces currently held cell pointers. More...
 
template<class _It >
void setCells (_It first, _It last)
 Replaces currently held cell pointers. More...
 
void setCellAt (const CepsUInt &i, CellType *neigh)
 Set a cell pointer in the vector of currently held cells, at given index. More...
 
void addCell (CellType *&name)
 Adds a cell to the list. More...
 
void addCells (const CepsVector< CellType * > &cells)
 Adds several cells to the list. More...
 
void addCells (CellType **cells, const CepsUInt &n)
 Adds several cells to the list. More...
 
template<class _It >
void addCells (_It first, _It last)
 Adds several cells to the list. More...
 
void removeCell (CellType *&name)
 Removes a given cell pointer from the list. More...
 
void removeCells (const CepsVector< CellType * > &cells)
 Removes several cell pointers from the list. More...
 
void removeCells (CellType **cells, const CepsUInt &n)
 Removes several cell pointers from the list. More...
 
template<class _It >
void removeCells (_It first, _It last)
 Removes several cell pointers from the list. More...
 
void clearCells ()
 Wipes the current list of cell pointers. More...
 
CepsBool hasCell (CellType *&neigh)
 Tells if object has the cell given in argument. More...
 
CepsBool hasAllCells (const CepsVector< CellType * > &cells)
 Tells if object has all cells given in argument. More...
 
CepsBool hasAllCells (CellType **cells, const CepsUInt &n)
 Tells if object has all cells given in argument. More...
 
template<class _It >
CepsBool hasAllCells (_It first, _It last)
 Tells if object has all cells given in argument. More...
 
CepsBool hasOneOfCells (const CepsVector< CellType * > &cells)
 Tells if object has one of the cells given in argument. More...
 
CepsBool hasOneOfCells (CellType **cells, const CepsUInt &n)
 Tells if object has one of the cells given in argument. More...
 
template<class _It >
CepsBool hasOneOfCells (_It first, _It last)
 Tells if object has one of the cells given in argument. More...
 
CepsIndex getCellIndex (CepsUInt i) const
 Get the index of i-th cell. More...
 
CepsVector< CepsIndexgetCellsIndices () const
 Get indices of all cells. More...
 
void reset ()
 Equivalent to HoldsCells::clearCells. More...
 

Protected Member Functions

void errorOnCellIndex (CepsUInt i, const CepsString &funcName) const
 Aborts if object holds less than i cells. More...
 

Protected Attributes

CepsVector< CellType * > m_cells
 The cell pointers. More...
 

Constructor & Destructor Documentation

◆ HoldsCells() [1/5]

template<class CellType >
ceps::HoldsCells< CellType >::HoldsCells ( const CepsVector< CellType * > &  cells)
explicit

Constructor with a vector of cells.

◆ HoldsCells() [2/5]

template<class CellType >
ceps::HoldsCells< CellType >::HoldsCells ( CellType **  cells,
const CepsUInt n 
)

Constructor with a vector of cells.

◆ HoldsCells() [3/5]

template<class CellType >
ceps::HoldsCells< CellType >::HoldsCells ( )
default

Default constructor.

◆ HoldsCells() [4/5]

template<class CellType >
ceps::HoldsCells< CellType >::HoldsCells ( const HoldsCells< CellType > &  )
default

Copy constructor.

◆ HoldsCells() [5/5]

template<class CellType >
ceps::HoldsCells< CellType >::HoldsCells ( HoldsCells< CellType > &&  )
defaultnoexcept

Copy constructor.

◆ ~HoldsCells()

template<class CellType >
virtual ceps::HoldsCells< CellType >::~HoldsCells ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addCell()

template<class CellType >
void ceps::HoldsCells< CellType >::addCell ( CellType *&  name)

Adds a cell to the list.

◆ addCells() [1/3]

template<class CellType >
template<class _It >
void ceps::HoldsCells< CellType >::addCells ( _It  first,
_It  last 
)

Adds several cells to the list.

◆ addCells() [2/3]

template<class CellType >
void ceps::HoldsCells< CellType >::addCells ( CellType **  cells,
const CepsUInt n 
)

Adds several cells to the list.

◆ addCells() [3/3]

template<class CellType >
void ceps::HoldsCells< CellType >::addCells ( const CepsVector< CellType * > &  cells)

Adds several cells to the list.

◆ clearCells()

template<class CellType >
void ceps::HoldsCells< CellType >::clearCells ( )

Wipes the current list of cell pointers.

◆ countValidCells()

template<class CellType >
CepsUInt ceps::HoldsCells< CellType >::countValidCells ( )

Get the number of cells that are not nullptr.

◆ errorOnCellIndex()

template<class CellType >
void ceps::HoldsCells< CellType >::errorOnCellIndex ( CepsUInt  i,
const CepsString funcName 
) const
protected

Aborts if object holds less than i cells.

◆ getCellAt() [1/2]

template<class CellType >
CellType*& ceps::HoldsCells< CellType >::getCellAt ( const CepsUInt i)

Pointer to the i-th cell.

◆ getCellAt() [2/2]

template<class CellType >
const CellType*& ceps::HoldsCells< CellType >::getCellAt ( const CepsUInt i) const

Pointer to the i-th cell , const version.

◆ getCellIndex()

template<class CellType >
CepsIndex ceps::HoldsCells< CellType >::getCellIndex ( CepsUInt  i) const

Get the index of i-th cell.

◆ getCells() [1/2]

template<class CellType >
CepsVector<CellType*>& ceps::HoldsCells< CellType >::getCells ( )

Reference to the cells.

◆ getCells() [2/2]

template<class CellType >
const CepsVector<CellType*>& ceps::HoldsCells< CellType >::getCells ( ) const

Reference to the cells, const version.

◆ getCellsIndices()

template<class CellType >
CepsVector<CepsIndex> ceps::HoldsCells< CellType >::getCellsIndices ( ) const

Get indices of all cells.

◆ getNumberOfCells()

template<class CellType >
CepsUInt ceps::HoldsCells< CellType >::getNumberOfCells ( ) const

Returns the number of cells in the object.

◆ getValidCells()

template<class CellType >
CepsVector<CellType*> ceps::HoldsCells< CellType >::getValidCells ( )

Reference to the valid cells.

◆ hasAllCells() [1/3]

template<class CellType >
template<class _It >
CepsBool ceps::HoldsCells< CellType >::hasAllCells ( _It  first,
_It  last 
)

Tells if object has all cells given in argument.

◆ hasAllCells() [2/3]

template<class CellType >
CepsBool ceps::HoldsCells< CellType >::hasAllCells ( CellType **  cells,
const CepsUInt n 
)

Tells if object has all cells given in argument.

◆ hasAllCells() [3/3]

template<class CellType >
CepsBool ceps::HoldsCells< CellType >::hasAllCells ( const CepsVector< CellType * > &  cells)

Tells if object has all cells given in argument.

◆ hasCell()

template<class CellType >
CepsBool ceps::HoldsCells< CellType >::hasCell ( CellType *&  neigh)

Tells if object has the cell given in argument.

◆ hasOneOfCells() [1/3]

template<class CellType >
template<class _It >
CepsBool ceps::HoldsCells< CellType >::hasOneOfCells ( _It  first,
_It  last 
)

Tells if object has one of the cells given in argument.

◆ hasOneOfCells() [2/3]

template<class CellType >
CepsBool ceps::HoldsCells< CellType >::hasOneOfCells ( CellType **  cells,
const CepsUInt n 
)

Tells if object has one of the cells given in argument.

◆ hasOneOfCells() [3/3]

template<class CellType >
CepsBool ceps::HoldsCells< CellType >::hasOneOfCells ( const CepsVector< CellType * > &  cells)

Tells if object has one of the cells given in argument.

◆ operator=() [1/2]

template<class CellType >
HoldsCells& ceps::HoldsCells< CellType >::operator= ( const HoldsCells< CellType > &  )
default

Assignment operator.

◆ operator=() [2/2]

template<class CellType >
HoldsCells& ceps::HoldsCells< CellType >::operator= ( HoldsCells< CellType > &&  )
defaultnoexcept

Assignment operator.

◆ removeCell()

template<class CellType >
void ceps::HoldsCells< CellType >::removeCell ( CellType *&  name)

Removes a given cell pointer from the list.

◆ removeCells() [1/3]

template<class CellType >
template<class _It >
void ceps::HoldsCells< CellType >::removeCells ( _It  first,
_It  last 
)

Removes several cell pointers from the list.

◆ removeCells() [2/3]

template<class CellType >
void ceps::HoldsCells< CellType >::removeCells ( CellType **  cells,
const CepsUInt n 
)

Removes several cell pointers from the list.

◆ removeCells() [3/3]

template<class CellType >
void ceps::HoldsCells< CellType >::removeCells ( const CepsVector< CellType * > &  cells)

Removes several cell pointers from the list.

◆ reset()

template<class CellType >
void ceps::HoldsCells< CellType >::reset ( )

Equivalent to HoldsCells::clearCells.

◆ setCellAt()

template<class CellType >
void ceps::HoldsCells< CellType >::setCellAt ( const CepsUInt i,
CellType *  neigh 
)

Set a cell pointer in the vector of currently held cells, at given index.

If the index is larger than the current size of vector, the vector is filled with nullptrs until the given index.

◆ setCells() [1/3]

template<class CellType >
template<class _It >
void ceps::HoldsCells< CellType >::setCells ( _It  first,
_It  last 
)

Replaces currently held cell pointers.

◆ setCells() [2/3]

template<class CellType >
void ceps::HoldsCells< CellType >::setCells ( CellType **  cells,
const CepsUInt n 
)

Replaces currently held cell pointers.

◆ setCells() [3/3]

template<class CellType >
void ceps::HoldsCells< CellType >::setCells ( const CepsVector< CellType * > &  cells)

Replaces currently held cell pointers.

Field Documentation

◆ m_cells

template<class CellType >
CepsVector<CellType*> ceps::HoldsCells< CellType >::m_cells
protected

The cell pointers.

Definition at line 215 of file HoldsCells.hpp.


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