MercuryDPM
0.10
|
Container to store all Object. More...
#include <BaseHandler.h>
Public Member Functions | |
BaseHandler () | |
Default BaseHandler constructor, it simply creates an empty BaseHandler. More... | |
BaseHandler (const BaseHandler< T > &BH) | |
Copy constructor, it copies the BaseHandler and all Object it contains. More... | |
virtual | ~BaseHandler () |
Assignment operator. More... | |
void | copyAndAddObject (const T &O) |
Creates a copy of a Object and adds it to the BaseHandler. More... | |
void | copyAndAddObject (const T *O) |
Creates a copy of a Object and adds it to the BaseHandler. More... | |
virtual void | addObject (T *O) |
Adds a new Object to the BaseHandler. More... | |
virtual void | removeObject (unsigned const int id) |
Removes a Object from the BaseHandler. More... | |
void | removeLastObject () |
Removes the last Object from the BaseHandler. More... | |
void | clear () |
Empties the whole BaseHandler by removing all Object. More... | |
virtual void | readObject (std::istream &is)=0 |
Reads Object into the BaseHandler from restart data. More... | |
T * | getObject (const unsigned int id) const |
Gets a pointer to the Object at the specified index in the BaseHandler. More... | |
T * | getLastObject () const |
Gets a pointer to the last Object in this BaseHandler. More... | |
unsigned int | getNumberOfObjects () const |
Gets the number of Object in this BaseHandler. More... | |
unsigned int | getStorageCapacity () const |
Gets the storage capacity of this BaseHandler. More... | |
void | setStorageCapacity (const unsigned int N) |
Sets the storage capacity of this BaseHandler. More... | |
const std::vector< T * > ::const_iterator | begin () const |
Gets the begin of the const_iterator over all Object in this BaseHandler. More... | |
const std::vector< T * >::iterator | begin () |
Gets the begin of the iterator over all BaseBoundary in this BaseHandler. More... | |
const std::vector< T * > ::const_iterator | end () const |
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler. More... | |
const std::vector< T * >::iterator | end () |
Gets the end of the iterator over all BaseBoundary in this BaseHandler. More... | |
Private Attributes | |
std::vector< T * > | objects_ |
The actual list of Object pointers. More... | |
unsigned int | maxObjects_ |
An integer to keep track of the largest number of objects ever stored in this BaseHandler. More... | |
int | nextId_ |
identifier for next object created More... | |
Container to store all Object.
The BaseHandler is a container to store all Object. It is implemented by a vector of pointers to the Object.
Definition at line 38 of file BaseHandler.h.
|
inline |
Default BaseHandler constructor, it simply creates an empty BaseHandler.
Definition at line 42 of file BaseHandler.h.
|
inline |
Copy constructor, it copies the BaseHandler and all Object it contains.
[in] | BH | The BaseHandler that has te be copied. |
Definition at line 52 of file BaseHandler.h.
|
inlinevirtual |
Assignment operator.
[in] | rhs | The BaseHandler on the right hand side of the assignment.// Destructor, it simply destructs the BaseHandler and all Object it contains. |
Definition at line 83 of file BaseHandler.h.
|
inlinevirtual |
Adds a new Object to the BaseHandler.
Reimplemented in ParticleHandler, and BoundaryHandler.
Definition at line 106 of file BaseHandler.h.
Referenced by BoundaryHandler::addObject(), ParticleHandler::addObject(), BaseHandler< BaseBoundary >::BaseHandler(), and BaseHandler< BaseBoundary >::copyAndAddObject().
|
inline |
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition at line 220 of file BaseHandler.h.
Referenced by BaseHandler< BaseBoundary >::BaseHandler(), MD::broad_phase(), InsertionBoundary::checkBoundaryActionsBeforeTimeStep(), MD::checkInteractionWithBoundaries(), MD::compute_all_forces(), HGridOptimiser::Initialise(), ChuteBottom::make_rough_bottom(), ParticleHandler::operator=(), ParticleHandler::ParticleHandler(), MD::read_next_from_data_file(), MD::reset_DeltaMax(), MD::reset_TangentialSprings(), MD::solve(), MD::write(), and MD::write_v1().
|
inline |
Gets the begin of the iterator over all BaseBoundary in this BaseHandler.
Definition at line 227 of file BaseHandler.h.
|
inline |
Empties the whole BaseHandler by removing all Object.
Definition at line 162 of file BaseHandler.h.
Referenced by BaseHandler< BaseBoundary >::BaseHandler(), ParticleHandler::clear(), MD::read(), MD::read_v2(), ChuteBottom::setup_particles_initial_conditions(), and BaseHandler< BaseBoundary >::~BaseHandler().
|
inline |
Creates a copy of a Object and adds it to the BaseHandler.
[in] | O | A reference to the Object that has to be copied. |
Definition at line 93 of file BaseHandler.h.
Referenced by Chute::add_particle(), InsertionBoundary::checkBoundaryActionsBeforeTimeStep(), Chute::create_bottom(), MD::load_par_ini_file(), MD::read_next_from_data_file(), Chute::setup_particles_initial_conditions(), and ChuteBottom::setup_particles_initial_conditions().
|
inline |
Creates a copy of a Object and adds it to the BaseHandler.
[in] | O | A pointer to the Object (or derived class) that has to be copied. |
Definition at line 100 of file BaseHandler.h.
|
inline |
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition at line 233 of file BaseHandler.h.
Referenced by ChuteWithHopper::add_hopper(), BaseHandler< BaseBoundary >::BaseHandler(), InsertionBoundary::checkBoundaryActionsBeforeTimeStep(), MD::checkInteractionWithBoundaries(), MD::compute_all_forces(), Chute::create_bottom(), Chute::get_LargestParticleInteractionRadius(), Chute::get_SmallestParticleInteractionRadius(), HGRID_base::HGRID_actions_before_time_step(), HGRID_base::InitBroadPhase(), HGridOptimiser::Initialise(), ChuteBottom::make_rough_bottom(), ParticleHandler::operator=(), MD::output_ene(), ParticleHandler::ParticleHandler(), MD::read_next_from_data_file(), MD::reset_DeltaMax(), MD::reset_TangentialSprings(), MD::solve(), MD::write(), and MD::write_v1().
|
inline |
Gets the end of the iterator over all BaseBoundary in this BaseHandler.
Definition at line 240 of file BaseHandler.h.
|
inline |
Gets a pointer to the last Object in this BaseHandler.
Definition at line 192 of file BaseHandler.h.
Referenced by BaseHandler< BaseBoundary >::addObject(), Chute::IsInsertable(), MD::read(), MD::read_v1(), MD::read_v2(), and BaseHandler< BaseBoundary >::removeObject().
|
inline |
Gets the number of Object in this BaseHandler.
Definition at line 199 of file BaseHandler.h.
Referenced by BaseHandler< BaseBoundary >::addObject(), MD::Check_and_Duplicate_Periodic_Particles(), Chute::clean_chute(), MD::compute_particle_masses(), Chute::cout_time(), MD::do_integration_after_force_computation(), Chute::getLargestParticle(), BaseHandler< BaseBoundary >::getObject(), Chute::getSmallestParticle(), HGridOptimiser::Initialise(), ChuteBottom::make_rough_bottom(), MD::output_xballs_data(), MD::print(), MD::read_next_from_data_file(), MD::Remove_Duplicate_Periodic_Particles(), BaseHandler< BaseBoundary >::removeLastObject(), BaseHandler< BaseBoundary >::removeObject(), MD::set_dt(), MD::set_FixedParticles(), ChuteBottom::setup_particles_initial_conditions(), MD::write(), and MD::write_v1().
|
inline |
Gets a pointer to the Object at the specified index in the BaseHandler.
[in] | id | The index of the requested Object. |
Definition at line 176 of file BaseHandler.h.
Referenced by MD::Check_and_Duplicate_Periodic_Particles(), Chute::clean_chute(), MD::compute_particle_masses(), MD::do_integration_after_force_computation(), Chute::getLargestParticle(), Chute::getSmallestParticle(), TangentialSpringParticle::moveInHandler(), MD::output_xballs_data_particle(), MD::print(), MD::read_next_from_data_file(), MD::Remove_Duplicate_Periodic_Particles(), BaseHandler< BaseBoundary >::removeObject(), MD::removeParticle(), MD::set_dt(), MD::set_FixedParticles(), and MD::solve().
|
inline |
Gets the storage capacity of this BaseHandler.
Definition at line 206 of file BaseHandler.h.
Referenced by MD::print().
|
pure virtual |
Reads Object into the BaseHandler from restart data.
[in] | is | The input stream from which the information is read. |
Implemented in ParticleHandler, and BoundaryHandler.
|
inline |
Removes the last Object from the BaseHandler.
Definition at line 147 of file BaseHandler.h.
Referenced by Chute::IsInsertable(), and MD::read_next_from_data_file().
|
inlinevirtual |
Removes a Object from the BaseHandler.
The Object at position id is removed by moving the last Object in the vector to the position of id.
[in] | id | The index of which Object has to be removed from the BaseHandler |
Definition at line 122 of file BaseHandler.h.
Referenced by DeletionBoundary::checkBoundaryAfterParticleMoved(), CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), ChuteBottom::make_rough_bottom(), and MD::removeParticle().
|
inline |
Sets the storage capacity of this BaseHandler.
[in] | N | The storage capacity the BaseHandler will have |
Definition at line 213 of file BaseHandler.h.
Referenced by MD::constructor(), ChuteBottom::make_rough_bottom(), MD::read_v1(), and ChuteBottom::setup_particles_initial_conditions().
|
private |
An integer to keep track of the largest number of objects ever stored in this BaseHandler.
Definition at line 250 of file BaseHandler.h.
Referenced by BaseHandler< BaseBoundary >::addObject(), and BaseHandler< BaseBoundary >::clear().
|
private |
identifier for next object created
Definition at line 253 of file BaseHandler.h.
Referenced by BaseHandler< BaseBoundary >::addObject(), and BaseHandler< BaseBoundary >::clear().
|
private |
The actual list of Object pointers.
Definition at line 247 of file BaseHandler.h.
Referenced by BaseHandler< BaseBoundary >::addObject(), BaseHandler< BaseBoundary >::begin(), BaseHandler< BaseBoundary >::clear(), BaseHandler< BaseBoundary >::end(), BaseHandler< BaseBoundary >::getLastObject(), BaseHandler< BaseBoundary >::getNumberOfObjects(), BaseHandler< BaseBoundary >::getObject(), BaseHandler< BaseBoundary >::getStorageCapacity(), BaseHandler< BaseBoundary >::removeLastObject(), BaseHandler< BaseBoundary >::removeObject(), and BaseHandler< BaseBoundary >::setStorageCapacity().