![]() |
GranOO
3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
|
a util class for representing neighbouring (mainly DEM::Element) items More...
#include <NeighbourManager.hpp>
Public Member Functions | |
NeighbourManager (T &item) | |
constructor More... | |
~NeighbourManager () | |
destructor More... | |
void | add (T &item) |
add the item as a neighbour More... | |
void | add (T *item_ptr) |
similar as NeighbourManager::add(T& item) with a pointer instead of a reference More... | |
void | erase (T &item) |
erase the passed item from the neighbouring list More... | |
void | erase (T *item_ptr) |
similar as NeighbourManager::erase(T& item) with a pointer instead of a reference More... | |
void | clear () |
clear the neighouring list More... | |
size_t | number () const |
get the number of neighbours More... | |
Core::SetOfBase< T > & | set () |
get the neighbouring list More... | |
const Core::SetOfBase< T > & | set () const |
get the neighbouring list More... | |
Protected Attributes | |
T & | _item |
a reference to the main item which the neighbouring list is expected More... | |
Core::SetOfBase< T > | _neighbour |
the neighbouring list More... | |
Private Member Functions | |
NeighbourManager ()=delete | |
NeighbourManager (const NeighbourManager &)=delete | |
NeighbourManager & | operator= (const NeighbourManager &)=delete |
a util class for representing neighbouring (mainly DEM::Element) items
the | class T of the neighbouring items |
This class is a very simple class that manages a neighbouring relationship between two items. The aim of this class is to maintain a list of neighbouring item of a main item. This class is used into DEM::Element for representing a neighbouring relationship between two element.
GranOO3::DEM::NeighbourManager< T >::NeighbourManager | ( | T & | item | ) |
constructor
[in] | item | : the main item of the NeighbourManager |
GranOO3::DEM::NeighbourManager< T >::~NeighbourManager | ( | ) |
destructor
|
privatedelete |
|
privatedelete |
void GranOO3::DEM::NeighbourManager< T >::add | ( | T & | item | ) |
add the item
as a neighbour
[in] | item | : the new neighbour to add to the list |
void GranOO3::DEM::NeighbourManager< T >::add | ( | T * | item_ptr | ) |
similar as NeighbourManager::add(T& item) with a pointer instead of a reference
[in] | item_ptr | : the new neighbour to add to the list |
void GranOO3::DEM::NeighbourManager< T >::clear | ( | ) |
clear the neighouring list
void GranOO3::DEM::NeighbourManager< T >::erase | ( | T & | item | ) |
erase the passed item
from the neighbouring list
[in] | item | : the neighbour to erase |
Note that if the item
is not present in the neighbouring list, it raises an assertion
void GranOO3::DEM::NeighbourManager< T >::erase | ( | T * | item_ptr | ) |
similar as NeighbourManager::erase(T& item) with a pointer instead of a reference
[in] | item_ptr | : the neighbour to erase |
size_t GranOO3::DEM::NeighbourManager< T >::number | ( | ) | const |
get the number of neighbours
|
privatedelete |
Core::SetOfBase< T > & GranOO3::DEM::NeighbourManager< T >::set | ( | ) |
get the neighbouring list
Be aware, changing the neighbouring list by yourself can lead to unexpected behavior.
const Core::SetOfBase< T > & GranOO3::DEM::NeighbourManager< T >::set | ( | ) | const |
get the neighbouring list
|
protected |
a reference to the main item which the neighbouring list is expected
|
protected |
the neighbouring list