]> vaikene.ee Git - evaf/blob - src/libs/Common/globals.h
Moved eVaf description to the main page on the Doxygen generated documentation.
[evaf] / src / libs / Common / globals.h
1 /**
2 * @file Common/globals.h
3 * @brief Global constants and macros for eVaf
4 * @author Enar Vaikene
5 *
6 * Copyright (c) 2011 Enar Vaikene
7 *
8 * This file is part of the eVaf C++ cross-platform application development framework.
9 *
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
15 *
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
18 */
19
20 #ifndef __COMMON_GLOBALS_H
21 # define __COMMON_GLOBALS_H
22
23 #include "libcommon.h"
24 #include "ilogger.h"
25
26 /**
27 * @mainpage
28 * eVaf is a C++ cross-platform modular application development framework using Qt.
29 *
30 * The eVaf main executable is an empty container that needs to be filled with external modules to
31 * provide the required functionality. The eVaf main GUI executable, if run without external modules,
32 * shows just an empty window that can be closed to terminate the application. The eVaf main CLI
33 * executable runs until terminated with CTRL+C.
34 *
35 * eVaf modules are loadable libraries (.so or .dll files) that implement the features and
36 * functions of the application. By combining together different modules, an unique application can
37 * be made in very little time. Every module implements a specific function or feature and only when
38 * put together, the actual application is created.
39 *
40 * eVaf interfaces are the way how the functionality of eVaf modules is used. Every feature implemented
41 * by a module has an interface used to feed the module with data or request information from the module.
42 *
43 * eVaf events are used by modules to send out information that they have collected or processed.
44 * While interfaces are the way how to feed modules with data or requests, then events are mostly for
45 * spontaneous data.
46 *
47 * Events broadcast by modules can have data objects attached to them. To avoid unnecessary copying of
48 * data, these data objects are shared and reference-counted. When the data object is attached to the
49 * event, its internal reference counter is increased by one. When the eVaf event queue has delivered
50 * the event to all the subscribers, it destroys the event and decreases the reference-counter of the
51 * data object by one. If no other module kept the data object, then the data object's reference counter
52 * becomes zero and it is destroyed too.
53 */
54
55 /**
56 * Global eVaf namespace.
57 *
58 * eVaf is a C++ cross-platform modular application development framework using Qt.
59 */
60 namespace eVaf {
61
62 /**
63 * Common eVaf library.
64 *
65 * This library contains interfaces, classes and functions shared by all the eVaf applications
66 * and modules. This library is the required dependency for all the other libraries, modules and
67 * applications.
68 *
69 * The common eVaf library shall be initialized with the eVaf::Common::init() function.
70 */
71 namespace Common {
72
73 /**
74 * eVaf common library initialized
75 * @return True if ok; false if the initialization failed
76 *
77 * Call this function to initialize the common eVaf library after creating the Qt application
78 * object and before loading any of the modules.
79 */
80 extern bool COMMON_EXPORT init();
81
82 /**
83 * Internal implementation of the common eVaf library.
84 */
85 namespace Internal {
86 } // namespace eVaf::Common::Internal
87 } // namespace eVaf::Common
88 } // namespace eVaf
89
90 /**
91 * Tests that the condition is true.
92 *
93 * This macro tests for the condition and if not true, exits with a fatal error.
94 * Use this macro to test for conditions that must be met in order for the application
95 * to continue.
96 */
97 #define EVAF_TEST(cond) \
98 if (!cond) \
99 EVAF_FATAL(#cond);
100
101 /**
102 * Tests that the condition is true with a custom error message.
103 *
104 * This macro tests for the condition and if not true, exist with a custom fatal error message.
105 */
106 #define EVAF_TEST_X(const, msg) \
107 if (!cond) \
108 EVAF_FATAL(msg);
109
110 #endif // globals.h