A vector of objects of type Box . Specializes class std::vector<Box>
(publicly) with a constructor and methods to add a variable amount of arbitrary values with one invocation.
If another Boxes object or an array of boxes, or boxed versions of such, are added, this container is "flattened", so that instead of the container, the boxes are added. Such flatting is performed recursively.
Public Method Index: | |
Boxes ()=default | |
Boxes (Boxes &)=delete | |
Boxes (monomem::MonoAllocator *monoAllocator) | |
Boxes & | Add () |
Boxes & | Add (const Box &box) |
template<size_t TExtend> | |
Boxes & | Add (const Box(&boxArray)[TExtend]) |
Boxes & | Add (const Boxes &boxes) |
template<typename... TBoxables> | |
Boxes & | Add (TBoxables &&... args) |
ALIB_API void | AddArray (const Box *boxArray, integer length) |
template<typename TFDecl , typename... TArgs> | |
void | CallAll (TArgs &&... args) |
template<typename TFDecl , typename... TArgs> | |
void | CallAll (TArgs &&... args) const |
ALIB_API void | CloneAll (monomem::MonoAllocator &memory) |
template<typename TBoxable > | |
Boxes & | operator+= (TBoxable &&src) |
template<typename TBoxable > | |
Boxes & | operator<< (TBoxable &&src) |
Boxes & | operator= (Boxes &)=delete |
void | Reserve (integer newCapacity) |
integer | Size () const |
|
default |
Defaulted default constructor.
|
inline |
Constructor accepting a monotonic allocator.
Note: This constructor is available only if module ALib Monomem is included in the ALib Distribution .
monoAllocator | The allocator to use with the underlying std::vector . |
|
inline |
|
inline |
Adds one box for each given variadic argument.
TBoxables | The types of the variadic arguments. |
args | The variadic arguments. Each argument is converted into one box to be appended. |
Definition at line 171 of file boxes.inl.
Adds an array of boxes. Array elements of types Boxes itself and boxed arrays of class Box are recursively "flattened".
This method is internally used by all overloads of Add.
boxArray | Pointer to the start of the array of boxes. |
length | The number of boxes contained in boxArray . |
|
inline |
Non-constant version of method CallAll, which likewise chooses the non-constant version of Box::Call and hence this method is usable with functions that only accept mutable (aka not constant) boxes.
Technically, the only difference between this method and CallAll is that the latter is declared const
.
TFDecl | The function type to call. Needs to be specified with invocations of this method. |
TArgs | Types of the variadic arguments args . |
args | Variadic arguments forwarded to the functions. |
|
inline |
Invokes Box::Call with each box in this list. The result of the invocations of the box-functions is ignored.
TFDecl | The function type to call. Needs to be specified with invocations of this method. |
TArgs | Types of the variadic arguments args . Do not need to be specified. |
args | Variadic arguments forwarded to the functions. |
void CloneAll | ( | monomem::MonoAllocator & | memory | ) |
Same as CallAll, but uses method Box::Clone , which internally invokes FClone .
Using this version leads to shorter code, because method Box::Clone is not inlined.
memory | A monotonic allocator used for storing cloned data. |
Definition at line 216 of file boxing.cpp.
|
inline |
|
inline |
|
inline |
|
inline |