![]() |
Provides a "set" of libraries sharing the same type of functionality. More...
#include <DriverSet.h>
Public Types | |
typedef DriverLib< Type > | DriverLibType |
The "type" of instances will be managed by the driver set. | |
typedef Dictionary< DriverLibType > | DriverLibDictionary |
The dictionary will contain the loaded driver libraries. | |
typedef function< void(string &pKey, DriverLibType *pValue)> | ForEachWorker |
The function prototype to be used in the foreach method. | |
Public Member Functions | |
DriverSet (string &pFactoryNameRef) | |
Creates a DriverSet that will create the internal stored DriverLibs and their components according with C style functions named after the provided FactoryName name in the following way: | |
DriverSet (const char *pFactoryNamePtr) | |
Creates a DriverSet that will create the internal stored DriverLibs and their components according with C style functions named after the provided FactoryName name in the following way: | |
virtual | ~DriverSet () |
void | unload () |
Unloads and releases all the memory used by the libraries loaded with the load method. | |
bool | has (string &pSetNameRef, string &pItemNameRef) |
Indicates if the DriverSet contains the specified library and object. | |
Type * | ptr (string &pSetNameRef, string &pItemNameRef) |
Returns the specified Item. | |
Type * | ptr (const char *pSetNamePtr, const char *pItemNamePtr) |
Returns the specified Item. | |
void | forEach (ForEachWorker pWorker) |
void | info (StringArray &pItems) |
Returns the list of libraries that are contained in the DriverSet. | |
![]() | |
BaseDriverSet (string &pFactoryNameRef) | |
Creates an instance for a BaseDriverSet. | |
BaseDriverSet (const char *pFactoryNamePtr) | |
Creates an instance for a BaseDriverSet. | |
virtual | ~BaseDriverSet () |
bool | load (string &pPathRef, string &pPrefixRef) |
According with the containing path, loads all the dynamic libraries whose name start with pPrefixRef and finishing on ".so". | |
Protected Member Functions | |
void | _addLibrary (const char *pTypeNamePtr, string &pFilePathRef, string &pFactoryNameRef) |
Loads a "driver" library following the rules for DriverLib instances. | |
Protected Attributes | |
DriverLibDictionary | aDriverLibCollection |
Provides a "set" of libraries sharing the same type of functionality.
Each one of the libraries conforms to the standards defined for the DriverLib class.
Definition at line 90 of file DriverSet.h.
typedef Dictionary< DriverLibType> HSEP::DriverSet< Type >::DriverLibDictionary |
The dictionary will contain the loaded driver libraries.
Definition at line 93 of file DriverSet.h.
typedef DriverLib<Type> HSEP::DriverSet< Type >::DriverLibType |
The "type" of instances will be managed by the driver set.
Definition at line 92 of file DriverSet.h.
typedef function<void ( string& pKey, DriverLibType* pValue)> HSEP::DriverSet< Type >::ForEachWorker |
The function prototype to be used in the foreach method.
Definition at line 95 of file DriverSet.h.
|
inline |
Creates a DriverSet that will create the internal stored DriverLibs and their components according with C style functions named after the provided FactoryName name in the following way:
create + pFactoryNameRef, for the method that will create and initialize the stored components. destroy + pFactoryNameRef, for the method that will de-initialize and destroy the stored components. info, to offer a short text description about the loaded library.
pFactoryNameRef |
Definition at line 120 of file DriverSet.h.
|
inline |
Creates a DriverSet that will create the internal stored DriverLibs and their components according with C style functions named after the provided FactoryName name in the following way:
create + pFactoryNamePtr, for the method that will create and initialize the stored components. destroy + pFactoryNamePtr, for the method that will de-initialize and destroy the stored components. info, to offer a short text description about the loaded library.
pFactoryNamePtr |
Definition at line 133 of file DriverSet.h.
|
inlinevirtual |
Definition at line 136 of file DriverSet.h.
|
inlineprotectedvirtual |
Loads a "driver" library following the rules for DriverLib instances.
pTypeName | The DriverLib type name |
pFilePath | Where the driver library is located |
pFactoryName | The suffix for the internal library functions |
Implements HSEP::BaseDriverSet.
Definition at line 100 of file DriverSet.h.
References HSEP::DriverSet< Type >::aDriverLibCollection, HSEP::Dictionary< T >::put(), and HSEP::HSEPObject::valid().
|
inline |
Definition at line 214 of file DriverSet.h.
References HSEP::DriverSet< Type >::aDriverLibCollection, and HSEP::Dictionary< T >::forEach().
|
inline |
Indicates if the DriverSet contains the specified library and object.
pSetNameRef | |
pItemNameRef |
Definition at line 162 of file DriverSet.h.
References HSEP::DriverSet< Type >::aDriverLibCollection, HSEP::Dictionary< T >::has(), HSEP::DriverLib< Type >::has(), and HSEP::Dictionary< T >::ptr().
|
inline |
Returns the list of libraries that are contained in the DriverSet.
pItems |
Definition at line 222 of file DriverSet.h.
References HSEP::DriverSet< Type >::aDriverLibCollection, HSEP::Dictionary< T >::forEach(), HSEP::DriverLib< Type >::infoRef(), and HSEP::Array< T >::push().
|
inline |
Returns the specified Item.
pSetNameRef | |
pItemNameRef |
Definition at line 187 of file DriverSet.h.
References HSEP::DriverSet< Type >::aDriverLibCollection, HSEP::DriverLib< Type >::getItemPtr(), and HSEP::Dictionary< T >::ptr().
Referenced by HSEP::DriverSet< Type >::ptr().
|
inline |
Returns the specified Item.
pSetNamePtr | |
pItemNamePtr |
Definition at line 208 of file DriverSet.h.
References HSEP::DriverSet< Type >::ptr().
|
inlinevirtual |
Unloads and releases all the memory used by the libraries loaded with the load method.
Doesn't free the memory the loaded libraries could have been created as part of their internal functionality. This is the responsibility of the library user.
Implements HSEP::BaseDriverSet.
Definition at line 151 of file DriverSet.h.
References HSEP::DriverSet< Type >::aDriverLibCollection, and HSEP::Dictionary< T >::clear().
|
protected |
Definition at line 98 of file DriverSet.h.
Referenced by HSEP::DriverSet< Type >::_addLibrary(), HSEP::DriverSet< Type >::forEach(), HSEP::DriverSet< Type >::has(), HSEP::DriverSet< Type >::info(), HSEP::DriverSet< Type >::ptr(), and HSEP::DriverSet< Type >::unload().