CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
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... | |
HoldsNodes & | operator= (const HoldsNodes &)=default |
Assignment operator. More... | |
HoldsNodes & | operator= (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< CepsGlobalIndex > | getNodeIndices () 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... | |
|
explicit |
Constructor with nodes.
ceps::HoldsNodes< NodeType >::HoldsNodes | ( | NodeType ** | nodes, |
const CepsUInt & | n | ||
) |
Constructor with nodes.
|
default |
Default constructor.
|
default |
Copy constructor.
|
defaultnoexcept |
Copy constructor.
|
virtualdefault |
Destructor.
void ceps::HoldsNodes< NodeType >::addNode | ( | NodeType * | name | ) |
Add a single node to the vector.
void ceps::HoldsNodes< NodeType >::addNodes | ( | _It | first, |
_It | last | ||
) |
Add several nodes to the vector.
void ceps::HoldsNodes< NodeType >::addNodes | ( | const CepsVector< NodeType * > & | nodes | ) |
Add several nodes to the vector.
void ceps::HoldsNodes< NodeType >::addNodes | ( | NodeType ** | nodes, |
const CepsUInt & | n | ||
) |
Add several nodes to the vector.
void ceps::HoldsNodes< NodeType >::clearNodes | ( | ) |
Wipes the vector of nodes.
CepsUInt ceps::HoldsNodes< NodeType >::countValidNodes | ( | ) |
Returns the number of nodes that are not nullptr.
|
protected |
Aborts if requesting node with wrong index.
NodeType* ceps::HoldsNodes< NodeType >::getNodeAt | ( | const CepsUInt & | i | ) |
Pointer to the i-th node.
const NodeType* ceps::HoldsNodes< NodeType >::getNodeAt | ( | const CepsUInt & | i | ) | const |
Pointer to the i-th node, const version.
CepsGlobalIndex ceps::HoldsNodes< NodeType >::getNodeIndex | ( | CepsUInt | i | ) | const |
Get the index of i-th node.
CepsVector<CepsGlobalIndex> ceps::HoldsNodes< NodeType >::getNodeIndices | ( | ) | const |
Get indices of all nodes.
void ceps::HoldsNodes< NodeType >::getNodeIndices | ( | CepsGlobalIndex * | nodesIndices, |
const CepsSize & | nAllocated | ||
) | const |
Get indices of all nodes.
CepsVector<NodeType*>& ceps::HoldsNodes< NodeType >::getNodes | ( | ) |
Reference to the node pointers array.
const CepsVector<NodeType*>& ceps::HoldsNodes< NodeType >::getNodes | ( | ) | const |
Reference to the node pointers array, const version.
CepsUInt ceps::HoldsNodes< NodeType >::getNumberOfNodes | ( | ) | const |
Returns the total number of nodes.
CepsVector<NodeType*> ceps::HoldsNodes< NodeType >::getValidNodes | ( | ) | const |
Get pointers on all valid nodes.
CepsBool ceps::HoldsNodes< NodeType >::hasAllNodes | ( | _It | first, |
_It | last | ||
) |
Tells if object has all the given nodes.
CepsBool ceps::HoldsNodes< NodeType >::hasAllNodes | ( | const CepsVector< NodeType * > & | nodes | ) |
Tells if object has all the given nodes.
CepsBool ceps::HoldsNodes< NodeType >::hasAllNodes | ( | NodeType ** | nodes, |
const CepsUInt & | n | ||
) |
Tells if object has all the given nodes.
CepsBool ceps::HoldsNodes< NodeType >::hasNode | ( | NodeType *& | neigh | ) |
Tells if object has the given node.
CepsBool ceps::HoldsNodes< NodeType >::hasOneOfNodes | ( | _It | first, |
_It | last | ||
) |
Tells if object has one of the given nodes.
CepsBool ceps::HoldsNodes< NodeType >::hasOneOfNodes | ( | const CepsVector< NodeType * > & | nodes | ) |
Tells if object has one of the given nodes.
CepsBool ceps::HoldsNodes< NodeType >::hasOneOfNodes | ( | NodeType ** | nodes, |
const CepsUInt & | n | ||
) |
Tells if object has one of the given nodes.
|
default |
Assignment operator.
|
defaultnoexcept |
Assignment operator.
void ceps::HoldsNodes< NodeType >::removeNode | ( | NodeType *& | name | ) |
Removes the given node from the list.
void ceps::HoldsNodes< NodeType >::removeNodes | ( | _It | first, |
_It | last | ||
) |
Removes several nodes from the list.
void ceps::HoldsNodes< NodeType >::removeNodes | ( | const CepsVector< NodeType * > & | nodes | ) |
Removes several nodes from the list.
void ceps::HoldsNodes< NodeType >::removeNodes | ( | NodeType ** | nodes, |
const CepsUInt & | n | ||
) |
Removes several nodes from the list.
void ceps::HoldsNodes< NodeType >::reset | ( | ) |
Equivalent to HoldsNodes::clearNodes.
void ceps::HoldsNodes< NodeType >::setNodeAt | ( | const CepsUInt & | i, |
NodeType * | neigh | ||
) |
Set the i-th node. If i>nNodes, nullptrs fill the vector.
void ceps::HoldsNodes< NodeType >::setNodes | ( | _It | first, |
_It | last | ||
) |
Assign all nodes.
void ceps::HoldsNodes< NodeType >::setNodes | ( | const CepsVector< NodeType * > & | nodes | ) |
Assign all nodes.
void ceps::HoldsNodes< NodeType >::setNodes | ( | NodeType ** | nodes, |
const CepsUInt & | n | ||
) |
Assign all nodes.
|
protected |
An empty node to be returned after abort when testing.
Definition at line 218 of file HoldsNodes.hpp.
|
protected |
The node pointers.
Definition at line 215 of file HoldsNodes.hpp.