Portuguese eID Middleware SDK  Version: 3.12.0
eIDMW::PTEID_ReaderSet Class Reference

#include <eidlib.h>

Public Member Functions

virtual PTEIDSDK_API ~PTEID_ReaderSet ()
 
PTEIDSDK_API void releaseReaders (bool bAllReference=false)
 
PTEIDSDK_API bool isReadersChanged () const
 
PTEIDSDK_API const char *const * readerList (bool bForceRefresh=false)
 
PTEIDSDK_API PTEID_ReaderContextgetReader ()
 
PTEIDSDK_API PTEID_ReaderContextgetReaderByName (const char *readerName)
 
PTEIDSDK_API unsigned long readerCount (bool bForceRefresh=false)
 
PTEIDSDK_API const char * getReaderName (unsigned long ulIndex)
 
PTEIDSDK_API PTEID_ReaderContextgetReaderByNum (unsigned long ulIndex)
 
PTEIDSDK_API PTEID_ReaderContextgetReaderByCardSerialNumber (const char *cardSerialNumber)
 
PTEIDSDK_API bool flushCache ()
 
NOEXPORT_PTEIDSDK PTEID_ReaderContextgetReader (APL_ReaderContext *pAplReader)
 
- Public Member Functions inherited from eIDMW::PTEID_Object
virtual PTEIDSDK_API ~PTEID_Object ()=0
 
NOEXPORT_PTEIDSDK void Init (const SDK_Context *context, void *impl)
 
NOEXPORT_PTEIDSDK void Release ()
 

Static Public Member Functions

static PTEIDSDK_API PTEID_ReaderSetinstance ()
 
static PTEIDSDK_API void initSDK (bool bManageTestCard=false)
 
static PTEIDSDK_API void releaseSDK ()
 

Additional Inherited Members

- Protected Member Functions inherited from eIDMW::PTEID_Object
 PTEID_Object (const SDK_Context *context, void *impl)
 
void addObject (PTEID_Object *impl)
 
void backupObject (unsigned long idx)
 
PTEID_ObjectgetObject (unsigned long idx)
 
PTEID_ObjectgetObject (void *impl)
 
void delObject (unsigned long idx)
 
void delObject (void *impl)
 
void checkContextStillOk () const
 
 PTEID_Object (const PTEID_Object &obj)
 
PTEID_Objectoperator= (const PTEID_Object &obj)
 
- Protected Attributes inherited from eIDMW::PTEID_Object
bool m_delimpl
 
void * m_impl
 
unsigned long m_ulIndexExtAdd
 
std::map< unsigned long, PTEID_Object * > m_objects
 
SDK_Context * m_context
 

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 identity or address objects (PTEID_EId or PTEID_Address) -> ...

Constructor & Destructor Documentation

◆ ~PTEID_ReaderSet()

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

Destructor

Member Function Documentation

◆ flushCache()

PTEIDSDK_API bool eIDMW::PTEID_ReaderSet::flushCache ( )

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

◆ getReader() [1/2]

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.

◆ getReader() [2/2]

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

For internal use - Not exported

◆ getReaderByCardSerialNumber()

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.

◆ getReaderByName()

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

Get the reader by its name.

◆ getReaderByNum()

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.

◆ getReaderName()

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.

◆ initSDK()

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

Init the SDK (Optional).

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

◆ instance()

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

Return the singleton object (create it at first use)

◆ isReadersChanged()

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

Return true if readers has been added or removed

◆ readerCount()

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

Return the number of card readers connected to the computer.

Parameters
bForceRefreshforce the reconnection to the lower layer to see if reader list have changed

◆ readerList()

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_ReaderSet::readerList(); for(const char * const *ppName=ppList;*ppName!=NULL;ppName++) {...}

Parameters
bForceRefreshforce the reconnection to the lower layer to see if reader list have changed

◆ releaseReaders()

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

Release the readers (Useful if readers had changed).

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

◆ releaseSDK()

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

Release the SDK