edelib
2.1.0
|
Macros | |
#define | E_LOG_DOMAIN ((char*)0) |
#define | E_DEBUG(...) edelib_log(E_LOG_DOMAIN, EDELIB_ERROR_MESSAGE_DEBUG, __VA_ARGS__) |
#define | E_WARNING(...) edelib_log(E_LOG_DOMAIN, EDELIB_ERROR_MESSAGE_WARNING, __VA_ARGS__) |
#define | E_FATAL(...) edelib_log(E_LOG_DOMAIN, EDELIB_ERROR_MESSAGE_FATAL, __VA_ARGS__) |
#define | E_ASSERT(expr) |
#define | E_STRLOC __FILE__ ":" _E_STRLOC_STRINGIFY(__LINE__) |
#define | E_LIKELY(expr) (expr) |
#define | E_UNLIKELY(expr) (expr) |
#define | E_RETURN_IF_FAIL(expr) |
#define | E_RETURN_VAL_IF_FAIL(expr, val) |
#define | E_DIR_SEPARATOR '/' |
#define | E_DIR_SEPARATOR_STR "/" |
#define | EDE_APPLICATION_WITH_NLS_PATH(name, path) |
#define | EDE_CONSOLE_APPLICATION_WITH_NLS_PATH(name, path) EDELIB_NS_PREPEND(nls_support_init(name, path) |
#define | EDE_APPLICATION(name) EDE_APPLICATION_WITH_NLS_PATH(name, "dummy_path") |
#define | EDE_CONSOLE_APPLICATION(name) EDE_CONSOLE_APPLICATION_WITH_NLS_PATH(name, "dummy_path") |
#define | EDELIB_NS edelib |
#define | EDELIB_NS_USE using namespace EDELIB_NS; |
#define | EDELIB_NS_USING(n) using EDELIB_NS::n; |
#define | EDELIB_NS_USING_AS(old_name, new_name) typedef EDELIB_NS::old_name new_name; |
#define | EDELIB_NS_PREPEND(n) EDELIB_NS::n |
#define | EDELIB_NS_USING_LIST(n, list) EDELIB_FOR_EACH(n, list) |
#define | E_DISABLE_CLASS_COPY(klass) |
#define | E_CLASS_GLOBAL_DECLARE(klass) static klass* global(void); |
#define | E_CLASS_GLOBAL_IMPLEMENT(klass) |
#define | E_CLASS_GLOBAL_EXPLICIT_DECLARE(klass) |
#define | E_CLASS_GLOBAL_EXPLICIT_IMPLEMENT(klass) |
#define E_ASSERT | ( | expr | ) |
Check if expression evaluates to false, in which case it will abort program, outputing offending expression, file name and line number. If platform supports, it will try to output short stack content.
Referenced by list< edelib::EdbusData >::clear(), list< edelib::EdbusData >::erase(), and EdbusContainer< EdbusData >::unhook().
#define E_CLASS_GLOBAL_DECLARE | ( | klass | ) | static klass* global(void); |
Declare members to access single class instance. These classes has global() member and will always return one class instance. This macro us placed in class declaration.
E_CLASS_GLOBAL_DECLARE and E_CLASS_GLOBAL_IMPLEMENT will create object on stack. Object will be created when global() was called for the first time, and will be destroyed when program quits.
#define E_CLASS_GLOBAL_EXPLICIT_DECLARE | ( | klass | ) |
Much the same as E_CLASS_GLOBAL_DECLARE, except object is allocated on heap. Unlike it, this macro will provide init() and shutdown() members so class instance can be explicitly created and destroyed. If shutdown() wasn't called at the end of the program, allocated memory will not be freed.
If init() wasn't called before global(), assertion will pop up.
#define E_CLASS_GLOBAL_EXPLICIT_IMPLEMENT | ( | klass | ) |
Implement needed ingredients for E_CLASS_GLOBAL_EXPLICIT_DECLARE. Goes where class code is implemented.
#define E_CLASS_GLOBAL_IMPLEMENT | ( | klass | ) |
Implement needed ingredients to allow this class has only one instance. Should be placed in class implementation.
#define E_DEBUG | ( | ... | ) | edelib_log(E_LOG_DOMAIN, EDELIB_ERROR_MESSAGE_DEBUG, __VA_ARGS__) |
Should be used for output debug information in stderr.
#define E_DIR_SEPARATOR '/' |
Platfom specific directory separator as single character
#define E_DIR_SEPARATOR_STR "/" |
Platfom specific directory separator as static string
#define E_DISABLE_CLASS_COPY | ( | klass | ) |
Disable class copying facility. Should be placed in private section of class declaration.
#define E_FATAL | ( | ... | ) | edelib_log(E_LOG_DOMAIN, EDELIB_ERROR_MESSAGE_FATAL, __VA_ARGS__) |
Display error and call abort().
#define E_LIKELY | ( | expr | ) | (expr) |
E_LIKELY and E_UNLIKELY macros give a hint to compiler about expected results. Gcc can use these information for optimizations. These macros are inspired with G_LIKELY and G_UNLIKELY from glib.
#define E_LOG_DOMAIN ((char*)0) |
This macro should be set during compilation phase. It will name logging domain showing to whom log output belongs.
#define E_RETURN_IF_FAIL | ( | expr | ) |
#define E_RETURN_VAL_IF_FAIL | ( | expr, | |
val | |||
) |
#define E_STRLOC __FILE__ ":" _E_STRLOC_STRINGIFY(__LINE__) |
Stringify current location with file name and line number.
#define E_UNLIKELY | ( | expr | ) | (expr) |
#define E_WARNING | ( | ... | ) | edelib_log(E_LOG_DOMAIN, EDELIB_ERROR_MESSAGE_WARNING, __VA_ARGS__) |
Should be use for output warnings in stderr.
#define EDE_APPLICATION | ( | name | ) | EDE_APPLICATION_WITH_NLS_PATH(name, "dummy_path") |
Initialize common EDE code with application name. This macro uses PREFIX value to setup correct path for localization data, which means the header (Ede.h) should be included after PREFIX definition.
#define EDE_APPLICATION_WITH_NLS_PATH | ( | name, | |
path | |||
) |
Initialize common EDE code with application name (must be binary name) and full path to locale directory.
#define EDE_CONSOLE_APPLICATION | ( | name | ) | EDE_CONSOLE_APPLICATION_WITH_NLS_PATH(name, "dummy_path") |
Same as EDE_APPLICATION but is intended for console applications.
#define EDE_CONSOLE_APPLICATION_WITH_NLS_PATH | ( | name, | |
path | |||
) | EDELIB_NS_PREPEND(nls_support_init(name, path) |
Same as EDE_APPLICATION_WITH_NLS_PATH but only for console applications.
#define EDELIB_NS edelib |
This is a name of the main namespace edelib uses.
#define EDELIB_NS_PREPEND | ( | n | ) | EDELIB_NS::n |
Prepend default edelib namespace to the given identifier.
#define EDELIB_NS_USE using namespace EDELIB_NS; |
This macro expands on using namespace edelib; or any other name used as the main edelib namespace name. This macro is also the preferred to use than above expression in case if namespace support was disabled.
On other hand, globally including everything from edelib namespace is not preferred either; via this way all edelib symbols will be known, causing possible name collisions. Alternative to this is to explicitly include desired names via EDELIB_NS_USING.
#define EDELIB_NS_USING | ( | n | ) | using EDELIB_NS::n; |
Bring this name to the global namespace. This is the preferred way since you explicitly add desired name to the global namespace.
#define EDELIB_NS_USING_AS | ( | old_name, | |
new_name | |||
) | typedef EDELIB_NS::old_name new_name; |
Redefine the name from edelib namespace to the global one. In the case of possible name collisions when edelib name is introduced globally, this macro should be used to rename it.
#define EDELIB_NS_USING_LIST | ( | n, | |
list | |||
) | EDELIB_FOR_EACH(n, list) |
Import given list of names, by using EDELIB_NS_USING on each, like:
Notice given number; it should always match list size.