This is a static class to load and store the adapters from Dynamic Libraries. More...
#include <DcAdaptersBank.h>
Classes | |
class | CdcAdapterNode |
Class to store one adapter in the map. | |
Static Public Member Functions | |
static void | Init () |
Loads the adapters from the dynamic library, according to the list in the Parameters file. | |
static void | Term () |
Deletes all adapters and releases libraries. | |
static bool | IsAdapterAvailable (const CdcString &name) |
Checks if a specific adapter is in use. | |
static uint | GetAdapterPointer (const CdcString &name, IdcAdapter **padapter) |
This function will return a pointer to a specific adapter interface, or NULL if the adapter is not available or it doesn't exist. | |
static void | ReleaseAdapter (const CdcString &name) |
The user has to call this function when it done using the adapter. |
This is a static class to load and store the adapters from Dynamic Libraries.
It loads all the adapters that list at the "Adapters" part of the configuration files, and saves them in a map. Then the user can ask for a pointer to a specific adapter interface. If the adapter is marked as non multi-use, the class will give a pointer to its interface just to one user. it will wait until the user release the adapter before giving it to another user.
This class is thread safe.
Definition at line 50 of file DcAdaptersBank.h.
uint CdcAdaptersBank::GetAdapterPointer | ( | const CdcString & | name, |
IdcAdapter ** | padapter | ||
) | [static] |
This function will return a pointer to a specific adapter interface, or NULL if the adapter is not available or it doesn't exist.
name | The name of the adapter. |
Definition at line 82 of file DcAdaptersBank.cpp.
void CdcAdaptersBank::Init | ( | ) | [static] |
Loads the adapters from the dynamic library, according to the list in the Parameters file.
Definition at line 40 of file DcAdaptersBank.cpp.
bool CdcAdaptersBank::IsAdapterAvailable | ( | const CdcString & | name ) | [static] |
Checks if a specific adapter is in use.
name | The name of the adapter. |
Definition at line 72 of file DcAdaptersBank.cpp.
void CdcAdaptersBank::ReleaseAdapter | ( | const CdcString & | name ) | [static] |
The user has to call this function when it done using the adapter.
name | The name of the adapter. |
Definition at line 95 of file DcAdaptersBank.cpp.
void CdcAdaptersBank::Term | ( | ) | [static] |
Deletes all adapters and releases libraries.
Note - The function does not check if an adapter is in use before releasing it.
Definition at line 61 of file DcAdaptersBank.cpp.