ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::camp::Basecamp Class Reference

Description:

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

See also
For detailed descriptions, please consult the chapter 3. The Basecamp of the Programmer's Manual of the module ALib Camp.

Definition at line 106 of file basecamp.mpp.

Inheritance diagram for alib::camp::Basecamp:
[legend]
Collaboration diagram for alib::camp::Basecamp:
[legend]

Public Field Index:

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

Public Method Index:

ALIB_DLL Basecamp ()
 
virtual ALIB_DLL void Bootstrap () override
 
ALIB_DLL bool IsDebuggerPresent ()
 
virtual ALIB_DLL void Shutdown (ShutdownPhases phase) override
 
- Public Method Index: inherited from alib::camp::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 (const SharedConfiguration &pConfig)
 
void BootstrapSetPhase (BootstrapPhases phase)
 
void BootstrapSetResourcePool (const SPResourcePool &pResourcePool)
 
BootstrapPhases GetBootstrapState ()
 
SharedConfigurationGetConfig ()
 
const StringGetResource (const NString &name)
 
SPResourcePoolGetResourcePool ()
 
bool IsBootstrapped ()
 
void operator= (Camp &&)=delete
 Deleted move assignment.
 
void operator= (const Camp &)=delete
 Deleted copy assignment.
 
const StringTryResource (const NString &name)
 

Additional Inherited Members

- Public Type Index: inherited from alib::camp::Camp
using SPResourcePool = SharedPtr<resources::ResourcePool, MonoAllocator>
 
- Protected Field Index: inherited from alib::camp::Camp
int bootstrapState = 0
 
SharedConfiguration config
 
SPResourcePool resourcePool
 

Field Details:

◆ HasConsoleWindow

bool alib::camp::Basecamp::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 Variables is included in the ALib Build.

Definition at line 134 of file basecamp.mpp.

◆ LocaleFound

String alib::camp::Basecamp::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 140 of file basecamp.mpp.

◆ WaitForKeyPressOnTermination

bool alib::camp::Basecamp::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 117 of file basecamp.mpp.

Constructor(s) / Destructor Details:

◆ Basecamp()

alib::camp::Basecamp::Basecamp ( )

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

Definition at line 87 of file basecamp.cpp.

Here is the call graph for this function:

Method Details:

◆ Bootstrap()

void alib::camp::Basecamp::Bootstrap ( )
overridevirtual

Implementation of Camp::Bootstrap.

In phase BootstrapPhases::Final performs:

Implements alib::camp::Camp.

Definition at line 97 of file basecamp.cpp.

Here is the call graph for this function:

◆ IsDebuggerPresent()

bool alib::camp::Basecamp::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 916 of file basecamp.cpp.

Here is the call graph for this function:

◆ Shutdown()

void alib::camp::Basecamp::Shutdown ( ShutdownPhases phase)
overridevirtual

Terminates this camp.

Parameters
phaseThe shutdown phase to perform.

Implements alib::camp::Camp.

Definition at line 881 of file basecamp.cpp.

Here is the call graph for this function:

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