Classes | Static Public Member Functions

CdcAdaptersBank Class Reference

This is a static class to load and store the adapters from Dynamic Libraries. More...

#include <DcAdaptersBank.h>

List of all members.

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.

Detailed Description

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.

Author:
Erez Bibi
Version:
1.0

Definition at line 50 of file DcAdaptersBank.h.


Member Function Documentation

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.

Parameters:
nameThe name of the adapter.
Returns:
(IdcAdapter**) A pointer to the adapter pointer interface.

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.

Parameters:
nameThe name of the adapter.
Returns:
(bool) True if the adapter is available. The function will return False if the adapter is in use or if it is not exist.

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.

Parameters:
nameThe 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.


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