LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
resultchecker.hpp
Go to the documentation of this file.
1
7#ifndef LOGICALACCESS_RESULTCHECKER_HPP
8#define LOGICALACCESS_RESULTCHECKER_HPP
9
10#include <logicalaccess/lla_core_api.hpp>
12#include <iostream>
13#include <map>
14#include <tuple>
15
16namespace logicalaccess
17{
21class LLA_CORE_API ResultChecker
22{
23 public:
28
32 virtual ~ResultChecker();
33
39 virtual void CheckResult(const void *data, size_t datalen);
40
46 virtual bool AllowEmptyResult() const;
47
48 protected:
58 void AddCheck(unsigned char SW1, unsigned char SW2, const std::string &msg,
59 CardException::ErrorType error = CardException::DEFAULT,
60 bool throwException = true);
61
67 void RemoveCheck(unsigned char SW1, unsigned char SW2);
68
72 void ClearChecks();
73
81 void AddSingleShotCheck(unsigned char SW1, unsigned char SW2, const std::string &msg);
82
83 private:
87 typedef std::pair<unsigned char, unsigned char> ResultCheckerKeys;
88
92 typedef std::tuple<std::string, CardException::ErrorType, bool> ResultCheckerValues;
93 // typedef std::pair<std::string, bool> ResultCheckerValues;
94
98 std::map<ResultCheckerKeys, ResultCheckerValues> mapPrimary;
99
103 std::map<ResultCheckerKeys, ResultCheckerValues> mapSingleShot;
104};
105}
106
107#endif /* LOGICALACCESS_RESULTCHECKER_HPP */
ErrorType
Definition: myexception.hpp:70
A result checker base class.
Definition: resultchecker.hpp:22
std::pair< unsigned char, unsigned char > ResultCheckerKeys
Result checker map keys.
Definition: resultchecker.hpp:87
std::map< ResultCheckerKeys, ResultCheckerValues > mapSingleShot
Single shot checks.
Definition: resultchecker.hpp:103
std::tuple< std::string, CardException::ErrorType, bool > ResultCheckerValues
Result checker map values.
Definition: resultchecker.hpp:92
std::map< ResultCheckerKeys, ResultCheckerValues > mapPrimary
Primary map checks.
Definition: resultchecker.hpp:98
Definition: asn1.hpp:9