![]() |
The DriverLib is a special type of "Library" that will execute several standard exported functions to "acquire" several "instances" from the specified library. More...
#include <DriverLib.h>
Public Types | |
typedef Dictionary< Type > | TypeDictionary |
Dictionary to control stored instances of Type. | |
typedef TypeDictionary *(* | createTypeCatalog )() |
Function existing in the library to create the TypeDictionary. | |
typedef void(* | destroyTypeCatalog )(TypeDictionary *) |
Function existing in the library to destroy the TypeDictionary. | |
typedef void(* | driverInfo )(string &) |
Function with information about the library itself. | |
typedef function< void(string &pKey, Type *pValue)> | ForEachWorker |
The function prototype to be used in the foreach method. | |
Public Member Functions | |
DriverLib (string &pPathRef, string &pFactoryFunctionNameRef) | |
Given the specified library name, loads it and run a creation function based on the "create" prefix and the pFactoryFunctionNameRef, to obtain a series of dynamically constructed objects inside a map whose key is a string representing the name of the particular object. | |
~DriverLib () | |
Executes the "destroy"+aFactoryFunctionName function and releases all the miscellaneous data structure elements defined to contain the Library. | |
TypeDictionary * | getCatalogPtr () |
Provides a pointer to the catalog containing the loaded objects. | |
string & | infoRef () |
Returns the information provided by the specific driver has been loaded. | |
Type * | getItemPtr (string &pItemNameRef) |
Provides the particular object, according with its name. | |
void | forEach (ForEachWorker pWorker) |
Executes the provider pWorker on each stored component. | |
bool | has (string &pItemNameRef) |
Indicates if the provided component is stored inside the DriverLib. | |
![]() | |
Library (const char *pType, string &pPath) | |
Constructs and loads the library pointed by pPath. | |
~Library () | |
Unloads the library and clean the related data structures. | |
void | invalidate () |
Makes the library to be in invalid state, unloading any loaded material. | |
![]() | |
string & | lastErrorRef () |
Returns a reference to the last stored error message. | |
ErrorCode | lastCode () |
Returns the last stored code. | |
bool | valid () |
Permits to know if the object has a valid internal state. | |
string & | typeRef () |
Permits to know the type of this particular object. | |
Additional Inherited Members | |
![]() | |
void * | getMethodPtr (string &pMethodNameRef) |
Returns a pointer to the specified method is contained in the loaded dynamic library. | |
![]() | |
void * | aHandlerPtr |
The library handler. | |
The DriverLib is a special type of "Library" that will execute several standard exported functions to "acquire" several "instances" from the specified library.
What these instances can do depends on how the DriverLib is designed to be used.
Definition at line 40 of file DriverLib.h.
typedef TypeDictionary*(* HSEP::DriverLib< Type >::createTypeCatalog)() |
Function existing in the library to create the TypeDictionary.
Definition at line 45 of file DriverLib.h.
typedef void(* HSEP::DriverLib< Type >::destroyTypeCatalog)(TypeDictionary *) |
Function existing in the library to destroy the TypeDictionary.
Definition at line 46 of file DriverLib.h.
typedef void(* HSEP::DriverLib< Type >::driverInfo)(string &) |
Function with information about the library itself.
Definition at line 47 of file DriverLib.h.
typedef function<void (string& pKey, Type* pValue)> HSEP::DriverLib< Type >::ForEachWorker |
The function prototype to be used in the foreach method.
Definition at line 49 of file DriverLib.h.
typedef Dictionary<Type> HSEP::DriverLib< Type >::TypeDictionary |
Dictionary to control stored instances of Type.
Definition at line 44 of file DriverLib.h.
|
inline |
Given the specified library name, loads it and run a creation function based on the "create" prefix and the pFactoryFunctionNameRef, to obtain a series of dynamically constructed objects inside a map whose key is a string representing the name of the particular object.
The pFactoryFunctionNameRef is stored because when the DriverLib need to be destroyed, a function based on the "destroy" prefix and such value will be executed. Its intent is to clear any type of resource could have been created when the create+pFactoryFunctionNameRef funcion was executed.
Also, executes the library "driverInfo" function, that will provide a basic textual description for the library.
Future versions could add more standard methods to obtain even more flexible types of libraries.
pPathRef | Where the library is located. |
pFactoryFunctionNameRef | The name of the C style function inside the library. |
Definition at line 76 of file DriverLib.h.
References driverInfo().
|
inline |
Executes the "destroy"+aFactoryFunctionName function and releases all the miscellaneous data structure elements defined to contain the Library.
Definition at line 112 of file DriverLib.h.
|
inline |
Executes the provider pWorker on each stored component.
pWorker |
Definition at line 176 of file DriverLib.h.
|
inline |
Provides a pointer to the catalog containing the loaded objects.
Definition at line 140 of file DriverLib.h.
|
inline |
Provides the particular object, according with its name.
pItemNameRef |
Definition at line 162 of file DriverLib.h.
Referenced by HSEP::DriverSet< Type >::ptr().
|
inline |
Indicates if the provided component is stored inside the DriverLib.
pItemNameRef |
Definition at line 188 of file DriverLib.h.
Referenced by HSEP::DriverSet< Type >::has().
|
inline |
Returns the information provided by the specific driver has been loaded.
Definition at line 153 of file DriverLib.h.
Referenced by HSEP::DriverSet< Type >::info().