![]() |
![]() |
|
|
#include <fastformat/internal/initialiser.hpp>
In "normal" use, this file is included by fastformat/fastformat.hpp, so that every C++ compilation unit that may potentially be issuing FastFormat calls contains, at file scope (well, actually in an anonymous namespace that is itself at file scoope) an instance of the initialiser. Since the FastFormat 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 fastformat/fastformat.hpp causes FastFormat 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 _WINDLL
, and the preprocessor symbol FASTFORMAT_FORCE_AUTO_INIT
is not defined), orFASTFORMAT_NO_AUTO_INIT
is defined.In either of these cases, you must explicitly initialise the FastFormat core (which initialises the front-end and back-end(s)) explicitly, using fastformat_init() and fastformat_uninit().
Public Types | |
Member Types | |
typedef fastformat_initialiser | class_type |
Public Member Functions | |
Construction | |
fastformat_initialiser () | |
Initialises the FastFormat library. | |
~fastformat_initialiser () | |
Uninitialises the FastFormat library. |
fastformat_initialiser | ( | ) | [inline] |
Initialises the FastFormat library.
Calls fastformat::fastformat_init(), calling exit(1) on failure
References fastformat::fastformat_init().
~fastformat_initialiser | ( | ) | [inline] |
Uninitialises the FastFormat library.
Calls fastformat::fastformat_uninit()
References fastformat::fastformat_uninit().
|
|
FastFormat Library documentation © Matthew Wilson, 2006-2009 |
|