All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HSEP::DriverSet< Type > Class Template Reference

Provides a "set" of libraries sharing the same type of functionality. More...

#include <DriverSet.h>

+ Inheritance diagram for HSEP::DriverSet< Type >:
+ Collaboration diagram for HSEP::DriverSet< Type >:

Public Types

typedef DriverLib< Type > DriverLibType
 The "type" of instances will be managed by the driver set.
 
typedef Dictionary< DriverLibTypeDriverLibDictionary
 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.
 
- Public Member Functions inherited from HSEP::BaseDriverSet
 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
 

Detailed Description

template<class Type>
class HSEP::DriverSet< Type >

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.

Member Typedef Documentation

template<class Type >
typedef Dictionary< DriverLibType> HSEP::DriverSet< Type >::DriverLibDictionary

The dictionary will contain the loaded driver libraries.

Definition at line 93 of file DriverSet.h.

template<class Type >
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.

template<class Type >
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.

Constructor & Destructor Documentation

template<class Type >
HSEP::DriverSet< Type >::DriverSet ( string &  pFactoryNameRef)
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.

Parameters
pFactoryNameRef

Definition at line 120 of file DriverSet.h.

template<class Type >
HSEP::DriverSet< Type >::DriverSet ( const char *  pFactoryNamePtr)
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.

Parameters
pFactoryNamePtr

Definition at line 133 of file DriverSet.h.

template<class Type >
virtual HSEP::DriverSet< Type >::~DriverSet ( )
inlinevirtual

Definition at line 136 of file DriverSet.h.

Member Function Documentation

template<class Type >
void HSEP::DriverSet< Type >::_addLibrary ( const char *  pTypeName,
string &  pFilePath,
string &  pFactoryName 
)
inlineprotectedvirtual

Loads a "driver" library following the rules for DriverLib instances.

Parameters
pTypeNameThe DriverLib type name
pFilePathWhere the driver library is located
pFactoryNameThe 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().

+ Here is the call graph for this function:

template<class Type >
void HSEP::DriverSet< Type >::forEach ( ForEachWorker  pWorker)
inline

Definition at line 214 of file DriverSet.h.

References HSEP::DriverSet< Type >::aDriverLibCollection, and HSEP::Dictionary< T >::forEach().

+ Here is the call graph for this function:

template<class Type >
bool HSEP::DriverSet< Type >::has ( string &  pSetNameRef,
string &  pItemNameRef 
)
inline

Indicates if the DriverSet contains the specified library and object.

Parameters
pSetNameRef
pItemNameRef
Returns
true when the library and object are contained.
false when the library and/or the object are not contained.

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().

+ Here is the call graph for this function:

template<class Type >
void HSEP::DriverSet< Type >::info ( StringArray pItems)
inline

Returns the list of libraries that are contained in the DriverSet.

Parameters
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().

+ Here is the call graph for this function:

template<class Type >
Type* HSEP::DriverSet< Type >::ptr ( string &  pSetNameRef,
string &  pItemNameRef 
)
inline

Returns the specified Item.

Parameters
pSetNameRef
pItemNameRef
Returns
the specified Item if it is contained in the DriverSet.
nullptr if the Driver was not contained in the DriverSet.

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class Type >
Type* HSEP::DriverSet< Type >::ptr ( const char *  pSetNamePtr,
const char *  pItemNamePtr 
)
inline

Returns the specified Item.

Parameters
pSetNamePtr
pItemNamePtr
Returns
the specified Item if it is contained in the DriverSet.
nullptr if the Driver was not contained in the DriverSet.

Definition at line 208 of file DriverSet.h.

References HSEP::DriverSet< Type >::ptr().

+ Here is the call graph for this function:

template<class Type >
void HSEP::DriverSet< Type >::unload ( )
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().

+ Here is the call graph for this function:

Member Data Documentation


The documentation for this class was generated from the following file: