This struct stores a list of information objects of arbitrary type by publically inheriting type Boxes . In addition, source code location information is attached, which usually refers to the place of construction of an instance of this type.
Finally, a type identifier is available with field Type.
Note that while message data might be passed with construction, informational data may be added, changed or removed during the life-cycle of an instance using the inherited interface of class Boxes .
Inside ALib , the struct is used with types Exception and Report .
Definition at line 42 of file message.hpp.
#include <message.hpp>
Public Field Index: | |
NCString | File |
NCString | Function |
int | Line |
Enum | Type |
Public Method Index: | |
template<typename... TBoxables> | |
Message (const NCString &file, int line, const NCString &function, const Enum &type, TBoxables &&... args) | |
template<typename... TBoxables> | |
Message (const NCString &file, int line, const NCString &function, MonoAllocator *monoAllocator, lang::Responsibility monoAllocatorResp, const Enum &type, TBoxables &&... args) | |
~Message () | |
void | CloneArguments () |
Public Method Index: inherited from Boxes | |
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 |
NCString File |
The file name that this message relates to.
Definition at line 46 of file message.hpp.
NCString Function |
The function/method name that this message relates to.
Definition at line 52 of file message.hpp.
int Line |
The line number within File, that this message relates to.
Definition at line 49 of file message.hpp.
|
protected |
Denotes whether this instance is responsible for deleting the (inherited) monotonic allocator or not.
Definition at line 65 of file message.hpp.
Enum Type |
A type identifier, defined with construction by providing an element of arbitrary enumeration type.
Definition at line 58 of file message.hpp.
|
inline |
Constructs a message that does not use a MonoAllocator and therefore uses dynamic memory allocation for storing the boxable arguments.
file | Information about the scope of invocation. |
line | Information about the scope of invocation. |
function | Information about the scope of invocation. |
type | The message type. |
args | Variadic, templated list of arguments. |
Definition at line 78 of file message.hpp.
|
inline |
Constructs a message that uses a MonoAllocator to store the boxable arguments. If parameter monoAllocatorResp equals Responsibility::Transfer, then this destructor of this class will delete the object given with monoAllocator .
file | Information about the scope of invocation. |
line | Information about the scope of invocation. |
function | Information about the scope of invocation. |
monoAllocator | The allocator to store the arguments in. |
monoAllocatorResp | The responsibility for the allocator. |
type | The message type. |
args | Variadic, templated list of arguments. |
Definition at line 101 of file message.hpp.
|
inline |
Destructor. If a monotonic allocator was provided in the constructor along with flag Responsibility::Transfer, this allocator is deleted.
Definition at line 115 of file message.hpp.
|
inline |
Loops over all contained boxes and invokes box-function FClone . The monotonic allocator passed in the constructor of this message is passed to FClone. If no allocator was passed in the constructor, this method must not be invoked. This condition is asserted in debug-compilations.
It is the responsibility of the user or creator of a message object to invoke this method and to ensure that objects that are referenced in the stored boxes either survive the lifetime of the methods or are duly cloned.
Definition at line 131 of file message.hpp.