22 class STDVectorStackOverObjectsWithSmartPointers;
130 const int remainingElements = parentStack->
size() - numberOfElements;
134 std::make_move_iterator(parentStack->
_data.begin() + remainingElements),
135 std::make_move_iterator(parentStack->
_data.end())
137 parentStack->
_data.erase(parentStack->
_data.begin() + remainingElements, parentStack->
_data.end());
143 const T&
get(
int index)
const {
156 std::ostringstream msg;
157 msg <<
"(size=" <<
size() <<
")";
178 _size(numberOfElements),
194 T*
set(
int index,
const T& value) {
201 const T&
get(
int index)
const {
214 std::ostringstream msg;
241 const T&
top(
int shift = 0)
const;
357#include "STDVectorStackOverObjectsWithSmartPointers.cpph"
#define assertion2(expr, param0, param1)
SendReceiveContext
There are three different scenarios when we merge data:
This class represents a whole block of the tree.
std::string toString() const
const T & get(int index) const
PopBlockStackView(int numberOfElements, peano4::stacks::STDVectorStackOverObjectsWithSmartPointers< T > *parentStack)
Constructor.
peano4::stacks::STDVectorStackOverObjectsWithSmartPointers< T > * _parentStack
T * set(int index, const T &value)
Set an entry.
PushBlockStackView(int numberOfElements, peano4::stacks::STDVectorStackOverObjectsWithSmartPointers< T > *parentStack)
Constructor.
const T & get(int index) const
std::string toString() const
Stack over objects, where some of the properties per object are realised through smart pointers.
static tarch::logging::Log _log
Logging device.
T & top(int shift=0)
Get top element or shiftth top element.
STDVectorStackOverObjectsWithSmartPointers(const STDVectorStackOverObjectsWithSmartPointers< T > &)
void reverse()
Reversing a stream is something I need extremely rarely.
STDVectorStackOverObjectsWithSmartPointers< T > & operator=(const STDVectorStackOverObjectsWithSmartPointers< T > &stack)
One is allowed to copy a stack but it has to be empty.
T pop()
Pops element from a stack.
std::vector< T > _data
This is the attribute holding all the temporary stacks.
std::vector< typename T::FlattenedType > FlattenedContainer
bool tryToFinishSendOrReceive()
Finish a send or receive if it is still pending.
STDVectorStackOverObjectsWithSmartPointers()
std::string toString() const
void startReceive(peano4::grid::TraversalObserver::SendReceiveContext context, int rank, int tag, MPI_Comm comm, int numberOfElements)
Trigger a receive.
MPI_Request * _ioMPIRequest
int sendingOrReceiving() const
I need this one to find out whether I'm waiting for data.
FlattenedContainer _flattenedData
We cannot send out _data, as each element in _data hosts at least one smart pointer.
void startSend(peano4::grid::TraversalObserver::SendReceiveContext context, int rank, int tag, MPI_Comm comm)
Start the actual send process.
PushBlockStackView pushBlock(int numberOfElements)
Push a block on the output stack.
void clone(const STDVectorStackOverObjectsWithSmartPointers< T > &data)
Clone data into the current object on which clone() is called.
const T & top(int shift=0) const
Get top element or shiftth top element.
PopBlockStackView popBlock(int numberOfElements)
This operation grabs numberOfElements from the input stack en block and returns a view to it.
void push(const T &element)
Pushes element to a stack.