]>
vaikene.ee Git - evaf/blob - src/libs/Common/globals.h
2 * @file Common/globals.h
3 * @brief Global constants and macros for eVaf
6 * Copyright (c) 2011 Enar Vaikene
8 * This file is part of the eVaf C++ cross-platform application development framework.
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.
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
20 #ifndef __COMMON_GLOBALS_H
21 # define __COMMON_GLOBALS_H
23 #include "libcommon.h"
27 * eVaf is a C++ cross-platform modular application development framework using Qt.
29 * The eVaf main executable is an empty container that needs to be filled with external modules to
30 * provide the required functionality. The eVaf main GUI executable, if run without external modules,
31 * shows just an empty window that can be closed to terminate the application. The eVaf main CLI
32 * executable runs until terminated with CTRL+C.
34 * eVaf modules are loadable libraries (.so or .dll files) that implement the features and
35 * functions of the application. By combining together different modules, an unique application can
36 * be made in very little time. Every module implements a specific function or feature and only when
37 * put together, the actual application is created.
39 * eVaf interfaces are the way how the functionality of eVaf modules is used. Every feature implemented
40 * by a module has an interface used to feed the module with data or request information from the module.
42 * eVaf events are used by modules to send out information that they have collected or processed.
43 * While interfaces are the way how to feed modules with data or requests, then events are mostly for
46 * Events broadcast by modules can have data objects attached to them. To avoid unnecessary copying of
47 * data, these data objects are shared and reference-counted. When the data object is attached to the
48 * event, its internal reference counter is increased by one. When the eVaf event queue has delivered
49 * the event to all the subscribers, it destroys the event and decreases the reference-counter of the
50 * data object by one. If no other module kept the data object, then the data object's reference counter
51 * becomes zero and it is destroyed too.
56 * Common eVaf library.
58 * This library contains interfaces, classes and functions shared by all the eVaf applications
59 * and modules. This library is the required dependency for all the other libraries, modules and
62 * The common eVaf library shall be initialized with the eVaf::Common::init() function.
67 * eVaf common library initialized
68 * @return True if ok; false if the initialization failed
70 * Call this function to initialize the common eVaf library after creating the Qt application
71 * object and before loading any of the modules.
73 extern bool COMMON_EXPORT
init();
76 * Internal implementation of the common eVaf library.
79 } // namespace eVaf::Common::Internal
80 } // namespace eVaf::Common
84 * Tests that the condition is true.
86 * This macro tests for the condition and if not true, exits with a fatal error.
87 * Use this macro to test for conditions that must be met in order for the application
90 #define EVAF_TEST(cond) \
95 * Tests that the condition is true with a custom error message.
97 * This macro tests for the condition and if not true, exist with a custom fatal error message.
99 #define EVAF_TEST_X(const, msg) \