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

Description:

This is a strict singleton class representing module ALib BaseCamp. The only instance is found with namespace variable alib::BASECAMP.

See also
For detailed descriptions, please consult

Friends

class CalendarDateTime

Definition at line 96 of file basecamp.hpp.

#include <basecamp.hpp>

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

Public Field Index:

bool HasConsoleWindow
 
String LocaleFound
 
bool WaitForKeyPressOnTermination =false
 
- Public Field Index: inherited from Camp
NCString ResourceCategory
 

Public Method Index:

ALIB_API BaseCamp ()
 
ALIB_API bool IsDebuggerPresent ()
 
- 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 ALIB_API void bootstrap (BootstrapPhases phase) override
 
virtual ALIB_API void shutdown (ShutdownPhases phase) override
 
- Protected Method Index: inherited from Camp

Additional Inherited Members

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

◆ HasConsoleWindow

bool HasConsoleWindow

This flag indicates if the current process has console output window attached. While this is not detectable in Unix like systems (or just with huge efforts), in windows it is. The determination is performed in bootstrap and done as follows

  • If configuration variable ALIB_HAS_CONSOLE_WINDOW is set, its value is returned.
  • Otherwise, on Unix like OStrue is returned.
  • On Windows OS it is determined if a console window is attached to the process using system call GetConsoleWindow() and compare its result to NULL.

In addition, this public flag may be modified at run-time (after method Bootstrap was invoked).

Note
The evaluation of configuration variable ALIB_HAS_CONSOLE_WINDOW is done only if module ALib Configuration is included in the ALib Distribution.

Definition at line 128 of file basecamp.hpp.

◆ LocaleFound

String LocaleFound

This string is set during bootstrapping in the case that a locale information was found (via standard environment variables or ALib variable LOCALE) and successfully set.
Otherwise this string is nulled.

Definition at line 134 of file basecamp.hpp.

◆ WaitForKeyPressOnTermination

bool WaitForKeyPressOnTermination =false

If true, within Shutdown, it is waited for a key press in the console window.
By default, this flag is enabled when debugging a console application under Visual Studio.
This default behavior can be overruled by setting configuration variable ALIB/WAIT_FOR_KEY_PRESS.
In addition, this public flag may be modified at run-time (after method Bootstrap was invoked).

Definition at line 111 of file basecamp.hpp.

Constructor(s) / Destructor Details:

◆ BaseCamp()

BaseCamp ( )

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 155 of file basecamp.cpp.

Method Details:

◆ bootstrap()

void bootstrap ( BootstrapPhases phase)
overrideprotectedvirtual

Implementation of Camp::bootstrap.

In phase BootstrapPhases::Final performs:

Parameters
phaseThe initialization phase to perform.

Implements Camp.

Definition at line 163 of file basecamp.cpp.

Here is the call graph for this function:

◆ IsDebuggerPresent()

bool IsDebuggerPresent ( )

If true, the current process is under the hood of a debugger.

Returns
true if the application is run in a debugger.

Definition at line 1057 of file basecamp.cpp.

Here is the call graph for this function:

◆ shutdown()

void shutdown ( ShutdownPhases phase)
overrideprotectedvirtual

Terminates this camp.

Parameters
phaseThe shutdown phase to perform.

Implements Camp.

Definition at line 1004 of file basecamp.cpp.

Here is the call graph for this function:

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