ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
Boxes Class Reference

Description:


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.

See also
Chapter 11. Variadic Function Arguments and Class Boxes of the Programmer's Manual of module ALib Boxing .

Definition at line 116 of file boxes.inl.

Inheritance diagram for Boxes:
[legend]
Collaboration diagram for Boxes:
[legend]

Public Method Index:

 Boxes ()=default
 
 Boxes (Boxes &)=delete
 
 Boxes (monomem::MonoAllocator *monoAllocator)
 
BoxesAdd ()
 
BoxesAdd (const Box &box)
 
template<size_t TExtend>
BoxesAdd (const Box(&boxArray)[TExtend])
 
BoxesAdd (const Boxes &boxes)
 
template<typename... TBoxables>
BoxesAdd (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 >
Boxesoperator+= (TBoxable &&src)
 
template<typename TBoxable >
Boxesoperator<< (TBoxable &&src)
 
Boxesoperator= (Boxes &)=delete
 
void Reserve (integer newCapacity)
 
integer Size () const
 

Constructor(s) / Destructor Details::

◆ Boxes() [1/3]

Boxes ( )
default

Defaulted default constructor.

◆ Boxes() [2/3]

Boxes ( Boxes & )
delete

Deleted copy constructor.

◆ Boxes() [3/3]

Boxes ( monomem::MonoAllocator * monoAllocator)
inline

Constructor accepting a monotonic allocator.
Note: This constructor is available only if module ALib Monomem is included in the ALib Distribution .

Parameters
monoAllocatorThe allocator to use with the underlying std::vector.

Definition at line 148 of file boxes.inl.

Method Details:

◆ Add() [1/5]

Boxes & Add ( )
inline

Empty method. Needed to allow adding empty variadic template parameter packs.

Returns
A reference to this object.

Definition at line 157 of file boxes.inl.

◆ Add() [2/5]

Boxes & Add ( const Box & box)
inline

Adds one boxt.

Parameters
boxThe box to append.
Returns
A reference to this object.

Definition at line 185 of file boxes.inl.

Here is the call graph for this function:

◆ Add() [3/5]

template<size_t TExtend>
Boxes & Add ( const Box(&) boxArray[TExtend])
inline

Adds an array of boxes.

Template Parameters
TExtendThe size of the given array of boxes.
Parameters
boxArrayThe array of boxes.
Returns
A reference to this object.

Definition at line 200 of file boxes.inl.

Here is the call graph for this function:

◆ Add() [4/5]

Boxes & Add ( const Boxes & boxes)
inline

Adds all elements of the given other Boxes object.

Parameters
boxesAnother container of boxes to add.
Returns
A reference to this object.

Definition at line 212 of file boxes.inl.

Here is the call graph for this function:

◆ Add() [5/5]

template<typename... TBoxables>
Boxes & Add ( TBoxables &&... args)
inline

Adds one box for each given variadic argument.

Template Parameters
TBoxablesThe types of the variadic arguments.
Parameters
argsThe variadic arguments. Each argument is converted into one box to be appended.
Returns
A reference to this object.

Definition at line 171 of file boxes.inl.

Here is the call graph for this function:

◆ AddArray()

ALIB_API void AddArray ( const Box * boxArray,
integer length )

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.

Parameters
boxArrayPointer to the start of the array of boxes.
lengthThe number of boxes contained in boxArray .

◆ CallAll() [1/2]

template<typename TFDecl , typename... TArgs>
void CallAll ( TArgs &&... args)
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.

Template Parameters
TFDeclThe function type to call. Needs to be specified with invocations of this method.
TArgsTypes of the variadic arguments args .
Parameters
argsVariadic arguments forwarded to the functions.

Definition at line 303 of file boxes.inl.

◆ CallAll() [2/2]

template<typename TFDecl , typename... TArgs>
void CallAll ( TArgs &&... args) const
inline

Invokes Box::Call with each box in this list. The result of the invocations of the box-functions is ignored.

Template Parameters
TFDeclThe function type to call. Needs to be specified with invocations of this method.
TArgsTypes of the variadic arguments args . Do not need to be specified.
Parameters
argsVariadic arguments forwarded to the functions.

Definition at line 284 of file boxes.inl.

◆ CloneAll()

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.

Availability
This method is available only if module ALib Monomem is included in the ALib Distribution .
Parameters
memoryA monotonic allocator used for storing cloned data.

Definition at line 216 of file boxing.cpp.

◆ operator+=()

template<typename TBoxable >
Boxes & operator+= ( TBoxable && src)
inline

Inline operator that simply aliases method Add.

Parameters
srcThe value to be boxed and added.
Returns
Returns a mutable reference to this.

Definition at line 237 of file boxes.inl.

Here is the call graph for this function:

◆ operator<<()

template<typename TBoxable >
Boxes & operator<< ( TBoxable && src)
inline

Inline operator that simply aliases method Add.

Parameters
srcThe value to be boxed and added.
Returns
Returns a mutable reference to this.

Definition at line 249 of file boxes.inl.

Here is the call graph for this function:

◆ operator=()

Boxes & operator= ( Boxes & )
delete

Deleted copy assignment operator.

Returns
Nothing (deleted).

◆ Reserve()

void Reserve ( integer newCapacity)
inline

Invokes the corresponding parent's method std::vector::reserve.

Parameters
newCapacityThe new, higher capacity of the vector.

Definition at line 268 of file boxes.inl.

◆ Size()

integer Size ( ) const
inline

Returns the quantity of elements stored in ths container.

Returns
The element count.

Definition at line 258 of file boxes.inl.


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