GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
GranOO3::DEM::NeighbourManager< T > Class Template Reference

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
 
NeighbourManageroperator= (const NeighbourManager &)=delete
 

Detailed Description

template<class T>
class GranOO3::DEM::NeighbourManager< T >

a util class for representing neighbouring (mainly DEM::Element) items

Template Parameters
theclass 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.

Constructor & Destructor Documentation

◆ NeighbourManager() [1/3]

template<class T >
GranOO3::DEM::NeighbourManager< T >::NeighbourManager ( T &  item)

constructor

Parameters
[in]item: the main item of the NeighbourManager

◆ ~NeighbourManager()

template<class T >
GranOO3::DEM::NeighbourManager< T >::~NeighbourManager ( )

destructor

◆ NeighbourManager() [2/3]

template<class T >
GranOO3::DEM::NeighbourManager< T >::NeighbourManager ( )
privatedelete

◆ NeighbourManager() [3/3]

template<class T >
GranOO3::DEM::NeighbourManager< T >::NeighbourManager ( const NeighbourManager< T > &  )
privatedelete

Member Function Documentation

◆ add() [1/2]

template<class T >
void GranOO3::DEM::NeighbourManager< T >::add ( T &  item)

add the item as a neighbour

Parameters
[in]item: the new neighbour to add to the list

◆ add() [2/2]

template<class T >
void GranOO3::DEM::NeighbourManager< T >::add ( T *  item_ptr)

similar as NeighbourManager::add(T& item) with a pointer instead of a reference

Parameters
[in]item_ptr: the new neighbour to add to the list

◆ clear()

template<class T >
void GranOO3::DEM::NeighbourManager< T >::clear ( )

clear the neighouring list

◆ erase() [1/2]

template<class T >
void GranOO3::DEM::NeighbourManager< T >::erase ( T &  item)

erase the passed item from the neighbouring list

Parameters
[in]item: the neighbour to erase

Note that if the item is not present in the neighbouring list, it raises an assertion

◆ erase() [2/2]

template<class T >
void GranOO3::DEM::NeighbourManager< T >::erase ( T *  item_ptr)

similar as NeighbourManager::erase(T& item) with a pointer instead of a reference

Parameters
[in]item_ptr: the neighbour to erase

◆ number()

template<class T >
size_t GranOO3::DEM::NeighbourManager< T >::number ( ) const

get the number of neighbours

Returns
the size of the neighbouring list

◆ operator=()

template<class T >
NeighbourManager& GranOO3::DEM::NeighbourManager< T >::operator= ( const NeighbourManager< T > &  )
privatedelete

◆ set() [1/2]

template<class T >
Core::SetOfBase< T > & GranOO3::DEM::NeighbourManager< T >::set ( )

get the neighbouring list

Returns
the neighbouring list in read/write mode

Be aware, changing the neighbouring list by yourself can lead to unexpected behavior.

◆ set() [2/2]

template<class T >
const Core::SetOfBase< T > & GranOO3::DEM::NeighbourManager< T >::set ( ) const

get the neighbouring list

Returns
the neighbouring list in read only mode

Member Data Documentation

◆ _item

template<class T >
T & GranOO3::DEM::NeighbourManager< T >::_item
protected

a reference to the main item which the neighbouring list is expected

◆ _neighbour

template<class T >
Core::SetOfBase< T > GranOO3::DEM::NeighbourManager< T >::_neighbour
protected

the neighbouring list


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