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

Description:


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>

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

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)
 
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
 

Field Details:

◆ File

NCString File

The file name that this message relates to.

Definition at line 46 of file message.hpp.

◆ Function

NCString Function

The function/method name that this message relates to.

Definition at line 52 of file message.hpp.

◆ Line

int Line

The line number within File, that this message relates to.

Definition at line 49 of file message.hpp.

◆ monoAllocatorResponsibility

lang::Responsibility monoAllocatorResponsibility
protected

Denotes whether this instance is responsible for deleting the (inherited) monotonic allocator or not.

Definition at line 65 of file message.hpp.

◆ Type

Enum Type

A type identifier, defined with construction by providing an element of arbitrary enumeration type.

Definition at line 58 of file message.hpp.

Constructor(s) / Destructor Details::

◆ Message() [1/2]

template<typename... TBoxables>
Message ( const NCString & file,
int line,
const NCString & function,
const Enum & type,
TBoxables &&... args )
inline

Constructs a message that does not use a MonoAllocator and therefore uses dynamic memory allocation for storing the boxable arguments.

Parameters
fileInformation about the scope of invocation.
lineInformation about the scope of invocation.
functionInformation about the scope of invocation.
typeThe message type.
argsVariadic, templated list of arguments.

Definition at line 78 of file message.hpp.

Here is the call graph for this function:

◆ Message() [2/2]

template<typename... TBoxables>
Message ( const NCString & file,
int line,
const NCString & function,
MonoAllocator * monoAllocator,
lang::Responsibility monoAllocatorResp,
const Enum & type,
TBoxables &&... args )
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 .

Parameters
fileInformation about the scope of invocation.
lineInformation about the scope of invocation.
functionInformation about the scope of invocation.
monoAllocatorThe allocator to store the arguments in.
monoAllocatorRespThe responsibility for the allocator.
typeThe message type.
argsVariadic, templated list of arguments.

Definition at line 101 of file message.hpp.

Here is the call graph for this function:

◆ ~Message()

~Message ( )
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.

Method Details:

◆ CloneArguments()

void CloneArguments ( )
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.

See also
Manual chapter 2.1.5 Argument Life-Cycle for details.

Definition at line 131 of file message.hpp.

Here is the call graph for this function:

The documentation for this struct was generated from the following file: