CEPS  24.01
Cardiac ElectroPhysiology Simulator
ceps::HoldsNodes< NodeType > Class Template Reference

Detailed Description

template<class NodeType>
class ceps::HoldsNodes< NodeType >

Abstract class for objects that contain node pointers

Definition at line 44 of file HoldsNodes.hpp.

#include <HoldsNodes.hpp>

Public Member Functions

 HoldsNodes (const CepsVector< NodeType * > &nodes)
 Constructor with nodes. More...
 
 HoldsNodes (NodeType **nodes, const CepsUInt &n)
 Constructor with nodes. More...
 
 HoldsNodes ()=default
 Default constructor. More...
 
 HoldsNodes (const HoldsNodes &)=default
 Copy constructor. More...
 
 HoldsNodes (HoldsNodes &&) noexcept=default
 Copy constructor. More...
 
virtual ~HoldsNodes ()=default
 Destructor. More...
 
HoldsNodesoperator= (const HoldsNodes &)=default
 Assignment operator. More...
 
HoldsNodesoperator= (HoldsNodes &&) noexcept=default
 Assignment operator. More...
 
CepsUInt getNumberOfNodes () const
 Returns the total number of nodes. More...
 
CepsUInt countValidNodes ()
 Returns the number of nodes that are not nullptr. More...
 
CepsVector< NodeType * > & getNodes ()
 Reference to the node pointers array. More...
 
const CepsVector< NodeType * > & getNodes () const
 Reference to the node pointers array, const version. More...
 
NodeType * getNodeAt (const CepsUInt &i)
 Pointer to the i-th node. More...
 
const NodeType * getNodeAt (const CepsUInt &i) const
 Pointer to the i-th node, const version. More...
 
void setNodes (const CepsVector< NodeType * > &nodes)
 Assign all nodes. More...
 
void setNodes (NodeType **nodes, const CepsUInt &n)
 Assign all nodes. More...
 
template<class _It >
void setNodes (_It first, _It last)
 Assign all nodes. More...
 
void setNodeAt (const CepsUInt &i, NodeType *neigh)
 Set the i-th node. If i>nNodes, nullptrs fill the vector. More...
 
void addNode (NodeType *name)
 Add a single node to the vector. More...
 
void addNodes (const CepsVector< NodeType * > &nodes)
 Add several nodes to the vector. More...
 
void addNodes (NodeType **nodes, const CepsUInt &n)
 Add several nodes to the vector. More...
 
template<class _It >
void addNodes (_It first, _It last)
 Add several nodes to the vector. More...
 
void removeNode (NodeType *&name)
 Removes the given node from the list. More...
 
void removeNodes (const CepsVector< NodeType * > &nodes)
 Removes several nodes from the list. More...
 
void removeNodes (NodeType **nodes, const CepsUInt &n)
 Removes several nodes from the list. More...
 
template<class _It >
void removeNodes (_It first, _It last)
 Removes several nodes from the list. More...
 
void clearNodes ()
 Wipes the vector of nodes. More...
 
CepsBool hasNode (NodeType *&neigh)
 Tells if object has the given node. More...
 
CepsBool hasAllNodes (const CepsVector< NodeType * > &nodes)
 Tells if object has all the given nodes. More...
 
CepsBool hasAllNodes (NodeType **nodes, const CepsUInt &n)
 Tells if object has all the given nodes. More...
 
template<class _It >
CepsBool hasAllNodes (_It first, _It last)
 Tells if object has all the given nodes. More...
 
CepsBool hasOneOfNodes (const CepsVector< NodeType * > &nodes)
 Tells if object has one of the given nodes. More...
 
CepsBool hasOneOfNodes (NodeType **nodes, const CepsUInt &n)
 Tells if object has one of the given nodes. More...
 
template<class _It >
CepsBool hasOneOfNodes (_It first, _It last)
 Tells if object has one of the given nodes. More...
 
CepsVector< NodeType * > getValidNodes () const
 Get pointers on all valid nodes. More...
 
CepsGlobalIndex getNodeIndex (CepsUInt i) const
 Get the index of i-th node. More...
 
CepsVector< CepsGlobalIndexgetNodeIndices () const
 Get indices of all nodes. More...
 
void getNodeIndices (CepsGlobalIndex *nodesIndices, const CepsSize &nAllocated) const
 Get indices of all nodes. More...
 
void reset ()
 Equivalent to HoldsNodes::clearNodes. More...
 

Protected Member Functions

void errorOnNodeIndex (CepsUInt i, std::source_location loc=std::source_location::current()) const
 Aborts if requesting node with wrong index. More...
 

Protected Attributes

CepsVector< NodeType * > m_nodes
 The node pointers. More...
 
NodeType * m_dummyNode
 An empty node to be returned after abort when testing. More...
 

Constructor & Destructor Documentation

◆ HoldsNodes() [1/5]

template<class NodeType >
ceps::HoldsNodes< NodeType >::HoldsNodes ( const CepsVector< NodeType * > &  nodes)
explicit

Constructor with nodes.

◆ HoldsNodes() [2/5]

template<class NodeType >
ceps::HoldsNodes< NodeType >::HoldsNodes ( NodeType **  nodes,
const CepsUInt n 
)

Constructor with nodes.

◆ HoldsNodes() [3/5]

template<class NodeType >
ceps::HoldsNodes< NodeType >::HoldsNodes ( )
default

Default constructor.

◆ HoldsNodes() [4/5]

template<class NodeType >
ceps::HoldsNodes< NodeType >::HoldsNodes ( const HoldsNodes< NodeType > &  )
default

Copy constructor.

◆ HoldsNodes() [5/5]

template<class NodeType >
ceps::HoldsNodes< NodeType >::HoldsNodes ( HoldsNodes< NodeType > &&  )
defaultnoexcept

Copy constructor.

◆ ~HoldsNodes()

template<class NodeType >
virtual ceps::HoldsNodes< NodeType >::~HoldsNodes ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addNode()

template<class NodeType >
void ceps::HoldsNodes< NodeType >::addNode ( NodeType *  name)

Add a single node to the vector.

◆ addNodes() [1/3]

template<class NodeType >
template<class _It >
void ceps::HoldsNodes< NodeType >::addNodes ( _It  first,
_It  last 
)

Add several nodes to the vector.

◆ addNodes() [2/3]

template<class NodeType >
void ceps::HoldsNodes< NodeType >::addNodes ( const CepsVector< NodeType * > &  nodes)

Add several nodes to the vector.

◆ addNodes() [3/3]

template<class NodeType >
void ceps::HoldsNodes< NodeType >::addNodes ( NodeType **  nodes,
const CepsUInt n 
)

Add several nodes to the vector.

◆ clearNodes()

template<class NodeType >
void ceps::HoldsNodes< NodeType >::clearNodes ( )

Wipes the vector of nodes.

◆ countValidNodes()

template<class NodeType >
CepsUInt ceps::HoldsNodes< NodeType >::countValidNodes ( )

Returns the number of nodes that are not nullptr.

◆ errorOnNodeIndex()

template<class NodeType >
void ceps::HoldsNodes< NodeType >::errorOnNodeIndex ( CepsUInt  i,
std::source_location  loc = std::source_location::current() 
) const
protected

Aborts if requesting node with wrong index.

◆ getNodeAt() [1/2]

template<class NodeType >
NodeType* ceps::HoldsNodes< NodeType >::getNodeAt ( const CepsUInt i)

Pointer to the i-th node.

◆ getNodeAt() [2/2]

template<class NodeType >
const NodeType* ceps::HoldsNodes< NodeType >::getNodeAt ( const CepsUInt i) const

Pointer to the i-th node, const version.

◆ getNodeIndex()

template<class NodeType >
CepsGlobalIndex ceps::HoldsNodes< NodeType >::getNodeIndex ( CepsUInt  i) const

Get the index of i-th node.

◆ getNodeIndices() [1/2]

template<class NodeType >
CepsVector<CepsGlobalIndex> ceps::HoldsNodes< NodeType >::getNodeIndices ( ) const

Get indices of all nodes.

◆ getNodeIndices() [2/2]

template<class NodeType >
void ceps::HoldsNodes< NodeType >::getNodeIndices ( CepsGlobalIndex nodesIndices,
const CepsSize nAllocated 
) const

Get indices of all nodes.

◆ getNodes() [1/2]

template<class NodeType >
CepsVector<NodeType*>& ceps::HoldsNodes< NodeType >::getNodes ( )

Reference to the node pointers array.

◆ getNodes() [2/2]

template<class NodeType >
const CepsVector<NodeType*>& ceps::HoldsNodes< NodeType >::getNodes ( ) const

Reference to the node pointers array, const version.

◆ getNumberOfNodes()

template<class NodeType >
CepsUInt ceps::HoldsNodes< NodeType >::getNumberOfNodes ( ) const

Returns the total number of nodes.

◆ getValidNodes()

template<class NodeType >
CepsVector<NodeType*> ceps::HoldsNodes< NodeType >::getValidNodes ( ) const

Get pointers on all valid nodes.

◆ hasAllNodes() [1/3]

template<class NodeType >
template<class _It >
CepsBool ceps::HoldsNodes< NodeType >::hasAllNodes ( _It  first,
_It  last 
)

Tells if object has all the given nodes.

◆ hasAllNodes() [2/3]

template<class NodeType >
CepsBool ceps::HoldsNodes< NodeType >::hasAllNodes ( const CepsVector< NodeType * > &  nodes)

Tells if object has all the given nodes.

◆ hasAllNodes() [3/3]

template<class NodeType >
CepsBool ceps::HoldsNodes< NodeType >::hasAllNodes ( NodeType **  nodes,
const CepsUInt n 
)

Tells if object has all the given nodes.

◆ hasNode()

template<class NodeType >
CepsBool ceps::HoldsNodes< NodeType >::hasNode ( NodeType *&  neigh)

Tells if object has the given node.

◆ hasOneOfNodes() [1/3]

template<class NodeType >
template<class _It >
CepsBool ceps::HoldsNodes< NodeType >::hasOneOfNodes ( _It  first,
_It  last 
)

Tells if object has one of the given nodes.

◆ hasOneOfNodes() [2/3]

template<class NodeType >
CepsBool ceps::HoldsNodes< NodeType >::hasOneOfNodes ( const CepsVector< NodeType * > &  nodes)

Tells if object has one of the given nodes.

◆ hasOneOfNodes() [3/3]

template<class NodeType >
CepsBool ceps::HoldsNodes< NodeType >::hasOneOfNodes ( NodeType **  nodes,
const CepsUInt n 
)

Tells if object has one of the given nodes.

◆ operator=() [1/2]

template<class NodeType >
HoldsNodes& ceps::HoldsNodes< NodeType >::operator= ( const HoldsNodes< NodeType > &  )
default

Assignment operator.

◆ operator=() [2/2]

template<class NodeType >
HoldsNodes& ceps::HoldsNodes< NodeType >::operator= ( HoldsNodes< NodeType > &&  )
defaultnoexcept

Assignment operator.

◆ removeNode()

template<class NodeType >
void ceps::HoldsNodes< NodeType >::removeNode ( NodeType *&  name)

Removes the given node from the list.

◆ removeNodes() [1/3]

template<class NodeType >
template<class _It >
void ceps::HoldsNodes< NodeType >::removeNodes ( _It  first,
_It  last 
)

Removes several nodes from the list.

◆ removeNodes() [2/3]

template<class NodeType >
void ceps::HoldsNodes< NodeType >::removeNodes ( const CepsVector< NodeType * > &  nodes)

Removes several nodes from the list.

◆ removeNodes() [3/3]

template<class NodeType >
void ceps::HoldsNodes< NodeType >::removeNodes ( NodeType **  nodes,
const CepsUInt n 
)

Removes several nodes from the list.

◆ reset()

template<class NodeType >
void ceps::HoldsNodes< NodeType >::reset ( )

Equivalent to HoldsNodes::clearNodes.

◆ setNodeAt()

template<class NodeType >
void ceps::HoldsNodes< NodeType >::setNodeAt ( const CepsUInt i,
NodeType *  neigh 
)

Set the i-th node. If i>nNodes, nullptrs fill the vector.

◆ setNodes() [1/3]

template<class NodeType >
template<class _It >
void ceps::HoldsNodes< NodeType >::setNodes ( _It  first,
_It  last 
)

Assign all nodes.

◆ setNodes() [2/3]

template<class NodeType >
void ceps::HoldsNodes< NodeType >::setNodes ( const CepsVector< NodeType * > &  nodes)

Assign all nodes.

◆ setNodes() [3/3]

template<class NodeType >
void ceps::HoldsNodes< NodeType >::setNodes ( NodeType **  nodes,
const CepsUInt n 
)

Assign all nodes.

Field Documentation

◆ m_dummyNode

template<class NodeType >
NodeType* ceps::HoldsNodes< NodeType >::m_dummyNode
protected

An empty node to be returned after abort when testing.

Definition at line 218 of file HoldsNodes.hpp.

◆ m_nodes

template<class NodeType >
CepsVector<NodeType*> ceps::HoldsNodes< NodeType >::m_nodes
protected

The node pointers.

Definition at line 215 of file HoldsNodes.hpp.


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