|
#include <pantheios/internal/initialiser.hpp>
In "normal" use, this file is included by pantheios/pantheios.hpp, so that every C++ compilation unit that may potentially be issuing Pantheios calls contains, at file scope (well, actually in an anonymous namespace that is itself at file scoope) an instance of the initialiser. Since the Pantheios core is a reference-counted API (see Chapter 11 of Imperfect C++), this means that the first C++ compilation linked in initialises the core, and the remainder keep it initialised, until they are all "completed". In other words, just including pantheios/pantheios.hpp causes Pantheios to be initialised.
In non-"normal" cases, the inclusion is not made, and the initialisation is not performed. These cases are either when:
_USRDLL
or _AFXDLL
, and the preprocessor symbol PANTHEIOS_FORCE_AUTO_INIT
is not defined, orPANTHEIOS_NO_AUTO_INIT
is defined.In either of these cases, you must explicitly initialise the Pantheios core (which initialises the front-end and back-end(s)) explicitly, using pantheios_init() and pantheios_uninit().
Public Types | |
Member Types | |
typedef pantheios_initialiser | class_type |
Public Member Functions | |
Construction | |
pantheios_initialiser () | |
Initialises the Pantheios API. | |
~pantheios_initialiser () | |
Uninitialises the Pantheios API. |
pantheios_initialiser | ( | ) | [inline] |
Initialises the Pantheios API.
Calls pantheios::pantheios_init(), calling exit(1) on failure
~pantheios_initialiser | ( | ) | [inline] |
Uninitialises the Pantheios API.
|
|
pantheios Library documentation © Matthew Wilson & Synesis Software, 2006-2011 |