eID middleware

eIDMW::PTEID_ReaderSet Class Reference

This is a singleton class that is the starting point to get all other objects. More...

#include <eidlib.h>

Inheritance diagram for eIDMW::PTEID_ReaderSet:

eIDMW::PTEID_Object

List of all members.

Public Member Functions

virtual PTEIDSDK_API ~PTEID_ReaderSet ()
 Destructor.
PTEIDSDK_API void releaseReaders (bool bAllReference=false)
 Release the readers (Useful if readers had changed).
PTEIDSDK_API bool isReadersChanged () const
 Return true if readers has been added or removed.
PTEIDSDK_API const char *const * readerList (bool bForceRefresh=false)
 Get the list of the reader.
PTEIDSDK_API PTEID_ReaderContextgetReader ()
 Return the first readercontext with a card.
PTEIDSDK_API PTEID_ReaderContextgetReaderByName (const char *readerName)
 Get the reader by its name.
PTEIDSDK_API unsigned long readerCount (bool bForceRefresh=false)
 Return the number of card readers connected to the computer.
PTEIDSDK_API const char * getReaderName (unsigned long ulIndex)
 Get the name of the reader by its Index.
PTEIDSDK_API PTEID_ReaderContextgetReaderByNum (unsigned long ulIndex)
 Get the reader by its Index.
PTEIDSDK_API PTEID_ReaderContextgetReaderByCardSerialNumber (const char *cardSerialNumber)
 Return the reader containing the card with this SN.
PTEIDSDK_API bool flushCache ()
 Flush the cached files.
NOEXPORT_PTEIDSDK
PTEID_ReaderContext
getReader (APL_ReaderContext *pAplReader)
 For internal use - Not exported.

Static Public Member Functions

static PTEIDSDK_API PTEID_ReaderSetinstance ()
 Return the singleton object (create it at first use).
static PTEIDSDK_API void initSDK (bool bManageTestCard=false)
 Init the SDK (Optional).
static PTEIDSDK_API void releaseSDK ()
 Release the SDK.


Detailed Description

This is a singleton class that is the starting point to get all other objects.

You get an instance from the static instance() method (or using the define ReaderSet). Then you get a READER (PTEID_ReaderContext) -> from this reader, you a CARD (PTEID_Card or derived class) -> from this card, you get DOCUMENT (PTEID_XMLDoc or derived class) -> ...


Constructor & Destructor Documentation

virtual PTEIDSDK_API eIDMW::PTEID_ReaderSet::~PTEID_ReaderSet (  )  [virtual]

Destructor.


Member Function Documentation

PTEIDSDK_API bool eIDMW::PTEID_ReaderSet::flushCache (  ) 

Flush the cached files.

Return if any files were flushed (T/F). Flush the cache

NOEXPORT_PTEIDSDK PTEID_ReaderContext& eIDMW::PTEID_ReaderSet::getReader ( APL_ReaderContext *  pAplReader  ) 

For internal use - Not exported.

PTEIDSDK_API PTEID_ReaderContext& eIDMW::PTEID_ReaderSet::getReader (  ) 

Return the first readercontext with a card.

If no card is present, return the firs reader. If no reader exist, throw an exception PTEID_ExNoReader.

PTEIDSDK_API PTEID_ReaderContext& eIDMW::PTEID_ReaderSet::getReaderByCardSerialNumber ( const char *  cardSerialNumber  ) 

Return the reader containing the card with this SN.

If no card with this SN is found, throw an exception PTEID_ExParamRange.

PTEIDSDK_API PTEID_ReaderContext& eIDMW::PTEID_ReaderSet::getReaderByName ( const char *  readerName  ) 

Get the reader by its name.

PTEIDSDK_API PTEID_ReaderContext& eIDMW::PTEID_ReaderSet::getReaderByNum ( unsigned long  ulIndex  ) 

Get the reader by its Index.

Throw PTEID_ExParamRange exception if the index is out of range.

PTEIDSDK_API const char* eIDMW::PTEID_ReaderSet::getReaderName ( unsigned long  ulIndex  ) 

Get the name of the reader by its Index.

Throw PTEID_ExParamRange exception if the index is out of range.

static PTEIDSDK_API void eIDMW::PTEID_ReaderSet::initSDK ( bool  bManageTestCard = false  )  [static]

Init the SDK (Optional).

Parameters:
bManageTestCard If true the applayer must ask if test cards are allowed (used for compatibility with old C API).
bManageTestCard If false other applications (ex. gui) take that into their scope

static PTEIDSDK_API PTEID_ReaderSet& eIDMW::PTEID_ReaderSet::instance (  )  [static]

Return the singleton object (create it at first use).

PTEIDSDK_API bool eIDMW::PTEID_ReaderSet::isReadersChanged (  )  const

Return true if readers has been added or removed.

PTEIDSDK_API unsigned long eIDMW::PTEID_ReaderSet::readerCount ( bool  bForceRefresh = false  ) 

Return the number of card readers connected to the computer.

Parameters:
bForceRefresh force the reconnection to the lower layer to see if reader list have changed

PTEIDSDK_API const char* const* eIDMW::PTEID_ReaderSet::readerList ( bool  bForceRefresh = false  ) 

Get the list of the reader.

Return an array of const char * The last pointer is NULL Usage : const char * const *ppList=PTEID_ReaderSetreaderList(); for(const char * const *ppName=ppList;*ppName!=NULL;ppName++) {...}

Parameters:
bForceRefresh force the reconnection to the lower layer to see if reader list have changed

PTEIDSDK_API void eIDMW::PTEID_ReaderSet::releaseReaders ( bool  bAllReference = false  ) 

Release the readers (Useful if readers had changed).

Parameters:
bAllReference If true all the invalid reference/pointer are destroyed.
bAllReference PUT THIS PARAMETER TO TRUE IS THREAD UNSAFE.
bAllReference You have to be sure that you will not use any old reference/pointer after this release

static PTEIDSDK_API void eIDMW::PTEID_ReaderSet::releaseSDK (  )  [static]

Release the SDK.


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