LibLogicalAccess
2.5.0
An Open Source RFID Library
|
A result checker base class. More...
#include <resultchecker.hpp>
Public Member Functions | |
ResultChecker () | |
Constructor. | |
virtual | ~ResultChecker () |
Destructor. | |
virtual void | CheckResult (const void *data, size_t datalen) |
Check the buffer result and throw exception if needed. | |
virtual bool | AllowEmptyResult () const |
Protected Member Functions | |
void | AddCheck (unsigned char SW1, unsigned char SW2, const std::string &msg, CardException::ErrorType error=CardException::DEFAULT, bool throwException=true) |
Add a new check. Maps already existing are overwritten. | |
void | RemoveCheck (unsigned char SW1, unsigned char SW2) |
Remove a check. | |
void | ClearChecks () |
Clear all checks. | |
void | AddSingleShotCheck (unsigned char SW1, unsigned char SW2, const std::string &msg) |
Add a new single shot check. Single shots are always cleared after the check result. | |
Private Types | |
typedef std::pair< unsigned char, unsigned char > | ResultCheckerKeys |
Result checker map keys. | |
typedef std::tuple< std::string, CardException::ErrorType, bool > | ResultCheckerValues |
Result checker map values. | |
Private Attributes | |
std::map< ResultCheckerKeys, ResultCheckerValues > | mapPrimary |
Primary map checks. | |
std::map< ResultCheckerKeys, ResultCheckerValues > | mapSingleShot |
Single shot checks. | |
A result checker base class.
|
private |
Result checker map keys.
|
private |
Result checker map values.
logicalaccess::ResultChecker::ResultChecker | ( | ) |
Constructor.
|
virtual |
Destructor.
|
protected |
Add a new check. Maps already existing are overwritten.
SW1 | The SW1 error code. |
SW2 | The SW2 error code. |
msg | The string message related to the error codes. |
error | The (liblogicalacccess-level) error code corresponding to the error. |
throwException | Define if an exception should be throwed for the error code. |
|
protected |
Add a new single shot check. Single shots are always cleared after the check result.
SW1 | The SW1 error code. |
SW2 | The SW2 error code. |
msg | The string message related to the error codes. |
|
virtual |
Whether or not an empty result is a valid response or not. Default to false.
|
virtual |
Check the buffer result and throw exception if needed.
data | The buffer. |
size_t | The buffer length. |
Reimplemented in logicalaccess::MifarePlusISO7816ResultChecker.
|
protected |
Clear all checks.
|
protected |
Remove a check.
SW1 | The SW1 error code. |
SW2 | The SW2 error code. |
|
private |
Primary map checks.
|
private |
Single shot checks.