MercuryDPM
0.10
|
Container to store all BaseWall. More...
#include <WallHandler.h>
Public Member Functions | |
WallHandler () | |
Default WallHandler constructor, it simply creates an empty WallHandler. More... | |
WallHandler (const WallHandler &BH) | |
Copy constructor for the WallHandler class, it copies the WallHandler and all BaseWall it contains. More... | |
WallHandler | operator= (const WallHandler &rhs) |
Assigns one WallHandler to another WallHandler. More... | |
~WallHandler () | |
Destructor, it simply destructs the WallHandler and all BaseWall it contains. More... | |
void | copyAndAddWall (const BaseWall &B) |
Creates a copy of a BaseWall and adds it to the WallHandler. More... | |
void | copyAndAddWall (const BaseWall *B) |
Creates a copy of a BaseWall and adds it to the WallHandler. More... | |
void | addWall (BaseWall *W) |
Adds a new BaseWall to the WallHandler. More... | |
void | removeWall (unsigned const int id) |
Removes a BaseWall from the WallHandler. More... | |
void | removeLastWall () |
Removes the last BaseWall from the WallHandler. More... | |
void | clear () |
Empties the whole WallHandler by removing all BaseWall. More... | |
void | readWall (std::istream &is) |
Reads BaseWall into the WallHandler from restart data. More... | |
BaseWall * | getWall (const unsigned int id) const |
Gets a pointer to the BaseWall at the specified index in the WallHandler. More... | |
BaseWall * | getLastWall () const |
Gets a pointer to the last BaseWall in this WallHandler. More... | |
unsigned int | getNumberOfWalls () const |
Gets the number of BaseWalls in this WallHandler. More... | |
unsigned int | getStorageCapacity () const |
Gets the storage capacity of this WallHandler. More... | |
void | setStorageCapacity (const unsigned int N) |
Sets the storage capacity of this WallHandler. More... | |
const std::vector< BaseWall * > ::const_iterator | begin () const |
Gets the begin of the const_iterator over all BaseWall in this WallHandler. More... | |
const std::vector< BaseWall * > ::iterator | begin () |
Gets the begin of the iterator over all BaseWall in this WallHandler. More... | |
const std::vector< BaseWall * > ::const_iterator | end () const |
Gets the end of the const_iterator over all BaseWall in this WallHandler. More... | |
const std::vector< BaseWall * > ::iterator | end () |
Gets the end of the iterator over all BaseWall in this WallHandler. More... | |
Private Attributes | |
std::vector< BaseWall * > | walls_ |
The actual list of Wall pointers. More... | |
Container to store all BaseWall.
The WallHandler is a container to store all BaseWall. It is implemented by a vector of pointers to BaseWall.
Definition at line 36 of file WallHandler.h.
WallHandler::WallHandler | ( | ) |
Default WallHandler constructor, it simply creates an empty WallHandler.
Definition at line 37 of file WallHandler.cc.
References clear().
WallHandler::WallHandler | ( | const WallHandler & | WH | ) |
Copy constructor for the WallHandler class, it copies the WallHandler and all BaseWall it contains.
[in] | WH | The WallHandler that has te be copied. |
Definition at line 46 of file WallHandler.cc.
References addWall(), begin(), clear(), and end().
WallHandler::~WallHandler | ( | ) |
Destructor, it simply destructs the WallHandler and all BaseWall it contains.
Definition at line 75 of file WallHandler.cc.
References clear().
void WallHandler::addWall | ( | BaseWall * | W | ) |
Adds a new BaseWall to the WallHandler.
[in] | W | A pointer to the BaseWall (or derived class) that has to be added. |
Definition at line 97 of file WallHandler.cc.
References walls_.
Referenced by copyAndAddWall(), operator=(), and WallHandler().
const std::vector< BaseWall * >::const_iterator WallHandler::begin | ( | ) | const |
Gets the begin of the const_iterator over all BaseWall in this WallHandler.
Definition at line 242 of file WallHandler.cc.
References walls_.
Referenced by InsertionBoundary::checkBoundaryActionsBeforeTimeStep(), MD::compute_all_forces(), operator=(), WallHandler(), MD::write(), and MD::write_v1().
const std::vector< BaseWall * >::iterator WallHandler::begin | ( | ) |
Gets the begin of the iterator over all BaseWall in this WallHandler.
Definition at line 248 of file WallHandler.cc.
References walls_.
void WallHandler::clear | ( | ) |
Empties the whole WallHandler by removing all BaseWall.
Definition at line 127 of file WallHandler.cc.
References walls_.
Referenced by operator=(), MD::read(), MD::read_v2(), ChuteBottom::setup_particles_initial_conditions(), WallHandler(), and ~WallHandler().
void WallHandler::copyAndAddWall | ( | const BaseWall & | W | ) |
Creates a copy of a BaseWall and adds it to the WallHandler.
[in] | W | A reference to the BaseWall that has to be copied. |
Definition at line 84 of file WallHandler.cc.
References addWall(), and BaseWall::copy().
Referenced by ChuteWithHopper::add_hopper(), Chute::create_bottom(), MD::load_par_ini_file(), readWall(), Chute::setup_particles_initial_conditions(), and ChuteBottom::setup_particles_initial_conditions().
void WallHandler::copyAndAddWall | ( | const BaseWall * | W | ) |
Creates a copy of a BaseWall and adds it to the WallHandler.
[in] | W | A pointer to the BaseWall (or derived class) that has to be copied. |
Definition at line 90 of file WallHandler.cc.
References addWall(), and BaseWall::copy().
const std::vector< BaseWall * >::const_iterator WallHandler::end | ( | ) | const |
Gets the end of the const_iterator over all BaseWall in this WallHandler.
Definition at line 254 of file WallHandler.cc.
References walls_.
Referenced by InsertionBoundary::checkBoundaryActionsBeforeTimeStep(), MD::compute_all_forces(), operator=(), WallHandler(), MD::write(), and MD::write_v1().
const std::vector< BaseWall * >::iterator WallHandler::end | ( | ) |
Gets the end of the iterator over all BaseWall in this WallHandler.
Definition at line 260 of file WallHandler.cc.
References walls_.
BaseWall * WallHandler::getLastWall | ( | ) | const |
Gets a pointer to the last BaseWall in this WallHandler.
Definition at line 218 of file WallHandler.cc.
References walls_.
Referenced by removeLastWall(), and removeWall().
unsigned int WallHandler::getNumberOfWalls | ( | ) | const |
Gets the number of BaseWalls in this WallHandler.
Definition at line 224 of file WallHandler.cc.
References walls_.
Referenced by MD::compute_walls(), getWall(), MD::print(), MD::write(), and MD::write_v1().
unsigned int WallHandler::getStorageCapacity | ( | ) | const |
Gets the storage capacity of this WallHandler.
Definition at line 230 of file WallHandler.cc.
References walls_.
Gets a pointer to the BaseWall at the specified index in the WallHandler.
[in] | id | The index of the requested BaseWall. |
Definition at line 203 of file WallHandler.cc.
References getNumberOfWalls(), and walls_.
Referenced by MD::compute_walls(), MD::print(), and removeWall().
WallHandler WallHandler::operator= | ( | const WallHandler & | rhs | ) |
Assigns one WallHandler to another WallHandler.
[in] | rhs | The WallHandler on the right hand side of the assignment. |
Definition at line 59 of file WallHandler.cc.
References addWall(), begin(), clear(), and end().
void WallHandler::readWall | ( | std::istream & | is | ) |
Reads BaseWall into the WallHandler from restart data.
[in] | is | The input stream from which the information is read. |
Definition at line 133 of file WallHandler.cc.
References copyAndAddWall().
Referenced by MD::read(), MD::read_v1(), and MD::read_v2().
void WallHandler::removeLastWall | ( | ) |
Removes the last BaseWall from the WallHandler.
Definition at line 119 of file WallHandler.cc.
References getLastWall(), and walls_.
void WallHandler::removeWall | ( | unsigned const int | id | ) |
Removes a BaseWall from the WallHandler.
The BaseWall at position id is removed by moving the last BaseWall in the vector to the position of id.
[in] | id | The index of which BaseWall has to be removed from the WallHandler |
Definition at line 104 of file WallHandler.cc.
References getLastWall(), getWall(), and walls_.
void WallHandler::setStorageCapacity | ( | const unsigned int | N | ) |
Sets the storage capacity of this WallHandler.
[in] | N | The storage capacity the WallHandler will have. |
Definition at line 236 of file WallHandler.cc.
References walls_.
Referenced by MD::read_v1().
|
private |
The actual list of Wall pointers.
Definition at line 101 of file WallHandler.h.
Referenced by addWall(), begin(), clear(), end(), getLastWall(), getNumberOfWalls(), getStorageCapacity(), getWall(), removeLastWall(), removeWall(), and setStorageCapacity().