ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
TBoxes< TAllocator > Class Template Reference

Description:

template<typename TAllocator>
class alib::boxing::TBoxes< TAllocator >

A vector of objects of type Box. Specializes class std::vector<Box> (publicly) with a constructor and methods to add a variable number 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.
Template Parameters
TAllocatorThe allocator to use with the std::vector, as prototyped with Allocator.

Definition at line 41 of file boxing/fwds.hpp.

Inheritance diagram for TBoxes< TAllocator >:
[legend]
Collaboration diagram for TBoxes< TAllocator >:
[legend]

Public Type Index:

using AllocatorType = TAllocator
 The allocator type that TAllocator specifies.
 

Public Method Index:

 TBoxes ()
 Defaulted default constructor, usable only with heap allocation.
 
 TBoxes (TAllocator &pAllocator)
 
 TBoxes (TBoxes &)=delete
 Deleted copy constructor.
 
TBoxesAdd ()
 
TBoxesAdd (const Box &box)
 
template<size_t TExtend>
TBoxesAdd (const Box(&boxArray)[TExtend])
 
template<typename TAllocatorArgs >
TBoxesAdd (const TBoxes< TAllocatorArgs > &boxes)
 
template<typename... TBoxables>
TBoxesAdd (TBoxables &&... args)
 
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
 
void CloneAll ()
 
template<typename TBoxable >
TBoxesoperator+= (TBoxable &&src)
 
template<typename TBoxable >
TBoxesoperator<< (TBoxable &&src)
 
TBoxesoperator= (TBoxes &)=delete
 
void Reserve (integer newCapacity)
 
integer Size () const
 

Protected Type Index:

using vectorBase = std::vector<Box, lang::StdContainerAllocator<Box, TAllocator>>
 The allocator type that TAllocator specifies.
 

Type Definition Details:

◆ AllocatorType

template<typename TAllocator >
using AllocatorType = TAllocator

The allocator type that TAllocator specifies.

Definition at line 48 of file boxes.inl.

◆ vectorBase

template<typename TAllocator >
using vectorBase = std::vector<Box, lang::StdContainerAllocator<Box, TAllocator>>
protected

The allocator type that TAllocator specifies.

Definition at line 44 of file boxes.inl.

Constructor(s) / Destructor Details:

◆ TBoxes() [1/2]

template<typename TAllocator >
TBoxes ( )
inline

Defaulted default constructor, usable only with heap allocation.

Definition at line 51 of file boxes.inl.

◆ TBoxes() [2/2]

template<typename TAllocator >
TBoxes ( TAllocator & pAllocator)
inline

Constructor.

Parameters
pAllocatorThe allocator to use.

Definition at line 55 of file boxes.inl.

Method Details:

◆ Add() [1/5]

template<typename TAllocator >
TBoxes & Add ( )
inline

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

Returns
A reference to this object.

Definition at line 74 of file boxes.inl.

◆ Add() [2/5]

template<typename TAllocator >
TBoxes & Add ( const Box & box)
inline

Adds one boxt.

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

Definition at line 102 of file boxes.inl.

Here is the call graph for this function:

◆ Add() [3/5]

template<typename TAllocator >
template<size_t TExtend>
TBoxes & 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 117 of file boxes.inl.

Here is the call graph for this function:

◆ Add() [4/5]

template<typename TAllocator >
template<typename TAllocatorArgs >
TBoxes & Add ( const TBoxes< TAllocatorArgs > & boxes)
inline

Adds all elements of the given other TBoxes object.

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

Definition at line 130 of file boxes.inl.

Here is the call graph for this function:

◆ Add() [5/5]

template<typename TAllocator >
template<typename... TBoxables>
TBoxes & 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 88 of file boxes.inl.

Here is the call graph for this function:

◆ AddArray()

template<typename TAllocator >
template ALIB_API void AddArray ( const Box * boxArray,
integer length )

Adds an array of boxes. Array elements of types TBoxes 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 TAllocator >
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 221 of file boxes.inl.

◆ CallAll() [2/2]

template<typename TAllocator >
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 202 of file boxes.inl.

◆ CloneAll()

template<typename TAllocator >
void CloneAll ( )
inline

Same as CallAll<FClone>, but uses method Box::Clone, which internally invokes FClone.

Using this version leads to shorter code, because method Box::Clone is not inlined. Cloning is performed 'into' the allocator used by the Boxes instance.

Availability
This method is available only if the module ALib Monomem is included in the ALib Distribution.

Definition at line 237 of file boxes.inl.

◆ operator+=()

template<typename TAllocator >
template<typename TBoxable >
TBoxes & 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 155 of file boxes.inl.

Here is the call graph for this function:

◆ operator<<()

template<typename TAllocator >
template<typename TBoxable >
TBoxes & 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 167 of file boxes.inl.

Here is the call graph for this function:

◆ operator=()

template<typename TAllocator >
TBoxes & operator= ( TBoxes< TAllocator > & )
delete

Deleted copy assignment operator.

Returns
Nothing (deleted).

◆ Reserve()

template<typename TAllocator >
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 186 of file boxes.inl.

◆ Size()

template<typename TAllocator >
integer Size ( ) const
inline

Returns the quantity of elements stored in ths container.

Returns
The element count.

Definition at line 176 of file boxes.inl.


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