ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of module \alib_config of the \aliblong.
4 *
5 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6 * Published under \ref mainpage_license "Boost Software License".
7 **************************************************************************************************/
8#ifndef HPP_ALIB_CONFIG_CONFIG
9#define HPP_ALIB_CONFIG_CONFIG 1
10
11#if !defined (HPP_ALIB_CONFIG_PRIORITIES)
13#endif
14
15ALIB_ASSERT_MODULE(CONFIGURATION)
16
17#if !defined(HPP_ALIB_LANG_CAMP)
19#endif
20
21#if !defined (HPP_ALIB_CAMP_MESSAGE_EXCEPTION)
23#endif
24
25#if !defined (HPP_ALIB_ENUMS_ARITHMETICAL)
27#endif
28
29
30namespace alib { namespace config {
31
32
33/** ************************************************************************************************
34 * Exception codes of namespace #alib::config.
35 **************************************************************************************************/
36enum class Exceptions
37{
38 /** File not found when reading. */
40
41 /** An error occurred writing the file . */
43};
44
45
46/** ************************************************************************************************
47 * The module class.
48 *
49 * This is a strict singleton class. The only instance is found with namespace variable
50 * \ref alib::CONFIG.
51 **************************************************************************************************/
52class Config : public lang::Camp
53{
54 public:
55 /** ****************************************************************************************
56 * Constructor.<br>
57 * While this is public, it must not be invoked as this is a strict singleton type.
58 * (See notes in \ref alib_manual_camp_modules_campmodule).
59 ******************************************************************************************/
60 Config();
61
62 protected:
63 /** ****************************************************************************************
64 * Initializes this module.
65 *
66 * @param phase The initialization phase to perform.
67 ******************************************************************************************/
68 virtual void bootstrap( BootstrapPhases phase ) override;
69
70 /** ****************************************************************************************
71 * Terminates this module. (Nothing to do.)
72 * @param phase The shutdown phase to perform.
73 ******************************************************************************************/
74 virtual void shutdown( ShutdownPhases phase ) override
75 { (void) phase; }
76
77}; // class Config
78
79} // namespace alib[::config]
80
81
82/** The singleton instance of \alibcamp class \alib{config;Config}. */
83extern ALIB_API config::Config CONFIG;
84
85} // namespace [alib]
86
87
88
92
93#endif // HPP_ALIB_CONFIG_CONFIG
virtual void bootstrap(BootstrapPhases phase) override
Definition config.cpp:52
virtual void shutdown(ShutdownPhases phase) override
Definition config.hpp:74
#define ALIB_ASSERT_MODULE(modulename)
Definition alib.hpp:190
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
Definition records.hpp:752
#define ALIB_API
Definition alib.hpp:538
#define ALIB_BOXING_VTABLE_DECLARE(TMapped, Identifier)
Definition vtable.inl:477
#define ALIB_RESOURCED_IN_MODULE(T, Camp, ResName)
Definition alib.cpp:57
ShutdownPhases
Definition camp.hpp:35
BootstrapPhases
Definition camp.hpp:26
config::Config CONFIG
Definition config.cpp:40