ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
ALoxCamp Class Reference

Description:

This is the module class for ALox logging library residing in namespace alib::lox.

This is a strict singleton class. The only instance is found with namespace variable alib::ALOX.

Definition at line 133 of file aloxcamp.hpp.

#include <aloxcamp.hpp>

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

Public Static Field Index:

static ALIB_API config::Declaration CODEPAGE
 

Public Method Index:

 ALoxCamp ()
 
ALIB_API LoxGet (const NString &name, lang::CreateIfNotExists create=lang::CreateIfNotExists::No)
 
ALIB_API void Register (Lox *lox, lang::ContainerOp operation)
 
ALIB_API void Reset ()
 
- Public Method Index: inherited from Camp
 Camp (Camp &&)=delete
 Deleted move constructor.
 
 Camp (const Camp &)=delete
 Deleted copy constructor.
 
 Camp (const NCString &resourceCategory)
 
virtual ~Camp ()
 Virtual destructor to satisfy C++ abstract type rules.
 
void BootstrapResource (const NString &name, const String &data)
 
void BootstrapSetConfig (config::Configuration *pConfig)
 
void BootstrapSetResourcePool (lang::resources::ResourcePool *pool)
 
config::ConfigurationGetConfig ()
 
threads::SharedLockGetConfigLock ()
 
const StringGetResource (const NString &name)
 
resources::ResourcePoolGetResourcePool ()
 
bool IsBootstrapped ()
 
void operator= (Camp &&)=delete
 Deleted move assignment.
 
void operator= (const Camp &)=delete
 Deleted copy assignment.
 
const StringTryResource (const NString &name)
 

Protected Method Index:

virtual void bootstrap (BootstrapPhases phase) override
 
virtual void shutdown (ShutdownPhases phase) override
 
- Protected Method Index: inherited from Camp

Additional Inherited Members

- Public Field Index: inherited from Camp
NCString ResourceCategory
 
- Protected Field Index: inherited from Camp
int bootstrapState = 0
 
config::Configurationconfig = nullptr
 
SharedLockconfigLock
 A shared lock associated to member config.
 
bool isConfigOwner = false
 
bool isResourceOwner = false
 
lang::resources::ResourcePoolresourcePool = nullptr
 

Field Details:

◆ CODEPAGE

ALIB_API config::Declaration CODEPAGE
static

Attributes of corresponding configuration variable ALOX/CODEPAGE used by class WindowsConsoleLogger.

Definition at line 151 of file aloxcamp.hpp.

Constructor(s) / Destructor Details:

◆ ALoxCamp()

ALoxCamp ( )

Constructor.
While this is public, it must not be invoked as this is a strict singleton type. (See notes in 3.2 Class Camp).

Definition at line 46 of file aloxcamp.cpp.

Method Details:

◆ bootstrap()

void bootstrap ( BootstrapPhases phase)
overrideprotectedvirtual

Implementation of Camp::bootstrap.

Parameters
phaseThe initialization phase to perform.

Implements Camp.

Definition at line 147 of file aloxcamp.cpp.

Here is the call graph for this function:

◆ Get()

Returns a Lox with the given name. A Lox is only found if it was created and registered with ALox using Register. If not found, and parameter create is true (the default), a new Lox is created, registered and returned.

Parameters
nameThe name of the Lox to search and optionally to create. Comparison is case insensitive.
createDenotes whether a Lox that was not found is created. Optional and defaults to CreateIfNotExists::No.
Returns
The Lox found, nullptr in case of failure.

Definition at line 82 of file aloxcamp.cpp.

◆ Register()

void Register ( Lox * lox,
lang::ContainerOp operation )

Registers or un-registers a Lox object statically with ALox. Once registered, any code entity of the same process is enabled to retrieve the Lox using Get.
No two objects with the same name must be registered. If this is done, the latter will not be registered and not be found by Get. In debug-compilations, an ALib error report is written (by default raises 'assert') if a name is registered twice.
Note that name comparison is performed case in-sensitive.

If debug-logging is enabled (depends on optional compiler symbols) and used, the singleton of type Lox provided for debug-logging is registered. This uses the name "Log".

Registration is not mandatory but done by default by the constructor of class Lox. Therefore, to keep a Lox private, an optional parameter is available.

Parameters
loxThe Lox to register.
operationIf ContainerOp::Remove, the given Lox is deregistered. Defaults to ContainerOp::Insert.

Definition at line 104 of file aloxcamp.cpp.

Here is the call graph for this function:

◆ Reset()

void Reset ( )

Resets this object. Concretely, the following steps are performed:

  • If the debug lox singleton exists, it is deleted.
  • It is asserted that no other lox object is registered.
  • The ALox path of the configuration is deleted.
Attention
This method was introduced to support resetting ALox in the unit tests. In real applications, this method should NOT be used. Side effects might appear using this method and it is not tested otherwise than used in tests!

Definition at line 397 of file aloxcamp.cpp.

Here is the call graph for this function:

◆ shutdown()

void shutdown ( ShutdownPhases phase)
overrideprotectedvirtual

Implementation of Camp::shutdown.

Parameters
phaseThe shutdown phase to perform.

Implements Camp.

Definition at line 377 of file aloxcamp.cpp.

Here is the call graph for this function:

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