OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Collaboration diagram for Helpers:

Overview

OpenAB provide couple of Helper classes:

Variant

OpenAB::Variant allows to store different types of data in one variable, OBA::Variant objects are mostly used for providing parameters (OpenAB_Plugin::Parameters) to create new instances of OpenAB_Plugin::Plugin.

OpenAB::Variant currently supports data types like:

SmartPtr

OpenAB::SmartPtr allows to safely pass around pointers to dynamically allocated data. It automatically tracks reference count of pointer that it manages and frees it when no longer needed.

PluginManager

OpenAB::PluginManager provides methods to discover new plugins and load/unload them on demand.

PluginManager is implemented as singleton and can be accessed using OpenAB::PluginManager::getInstance() function.

PluginManager keeps list of all known plugins and modules which are providing them, allowing to load modules into memory on demand and unloading them when no longer needed, keeping in this way overall memory footprint low.

Details of API

Here is the list of most important functions provided by PluginManager:

Logger

OpenAB::Logger provides set of macros that are used by OpenAB to log messages. Client applications can provide their own implementations of OpenAB::Logger to override way in which messages from OpenAB are logged.

usage Example:

void example(){
LOG_FUNC(); // Output the name of the function and the line number, there is no need to use std::endl
LOG() << "test normal (by default Info) message"<<std::endl;
LOG_VERBOSE() << "test verbose message"<<std::endl;
LOG_FATAL() << "test fatal message, number:" << 10 <<std::endl;
}