X-Git-Url: https://vaikene.ee/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2Flibs%2FCommon%2Fglobals.h;h=93346d58f702ef851a0150ec5fef2df6622938d3;hb=4d81227da330c21c7aa0badc88bd5ad4467067fb;hp=e21aa867f13ebd049bef4c195a6f66098bc6034d;hpb=441d1b38e0900f56891f495a94a08dc8d48e0a32;p=evaf diff --git a/src/libs/Common/globals.h b/src/libs/Common/globals.h index e21aa86..93346d5 100644 --- a/src/libs/Common/globals.h +++ b/src/libs/Common/globals.h @@ -21,9 +21,34 @@ # define __COMMON_GLOBALS_H #include "libcommon.h" +#include "ilogger.h" /** - * Common namespace for eVaf. + * eVaf is a C++ cross-platform modular application development framework using Qt. + * + * The eVaf main executable is an empty container that needs to be filled with external modules to + * provide the required functionality. The eVaf main GUI executable, if run without external modules, + * shows just an empty window that can be closed to terminate the application. The eVaf main CLI + * executable runs until terminated with CTRL+C. + * + * eVaf modules are loadable libraries (.so or .dll files) that implement the features and + * functions of the application. By combining together different modules, an unique application can + * be made in very little time. Every module implements a specific function or feature and only when + * put together, the actual application is created. + * + * eVaf interfaces are the way how the functionality of eVaf modules is used. Every feature implemented + * by a module has an interface used to feed the module with data or request information from the module. + * + * eVaf events are used by modules to send out information that they have collected or processed. + * While interfaces are the way how to feed modules with data or requests, then events are mostly for + * spontaneous data. + * + * Events broadcast by modules can have data objects attached to them. To avoid unnecessary copying of + * data, these data objects are shared and reference-counted. When the data object is attached to the + * event, its internal reference counter is increased by one. When the eVaf event queue has delivered + * the event to all the subscribers, it destroys the event and decreases the reference-counter of the + * data object by one. If no other module kept the data object, then the data object's reference counter + * becomes zero and it is destroyed too. */ namespace eVaf { @@ -40,15 +65,39 @@ namespace Common { /** * eVaf common library initialized - * @param args List of arguments * @return True if ok; false if the initialization failed * * Call this function to initialize the common eVaf library after creating the Qt application * object and before loading any of the modules. */ -extern bool COMMON_EXPORT init(QStringList const & args); +extern bool COMMON_EXPORT init(); +/** + * Internal implementation of the common eVaf library. + */ +namespace Internal { +} // namespace eVaf::Common::Internal } // namespace eVaf::Common } // namespace eVaf +/** + * Tests that the condition is true. + * + * This macro tests for the condition and if not true, exits with a fatal error. + * Use this macro to test for conditions that must be met in order for the application + * to continue. + */ +#define EVAF_TEST(cond) \ + if (!cond) \ + EVAF_FATAL(#cond); + +/** + * Tests that the condition is true with a custom error message. + * + * This macro tests for the condition and if not true, exist with a custom fatal error message. + */ +#define EVAF_TEST_X(const, msg) \ + if (!cond) \ + EVAF_FATAL(msg); + #endif // globals.h