LibLogicalAccess  2.5.0
An Open Source RFID Library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
json_dump_card_service.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <logicalaccess/lla_core_api.hpp>
6#include <nlohmann/json_fwd.hpp>
8
9namespace logicalaccess {
10
11#define JSON_DUMP_CARDSERVICE "JSONDump"
12
23class LLA_CORE_API JsonDumpCardService : public CardService {
24 public:
25 constexpr static const CardServiceType service_type_ = CST_JSON_DUMP;
26
27 virtual ~JsonDumpCardService();
28
29 explicit JsonDumpCardService(const std::shared_ptr<Chip> &chip);
30
31 std::string getCSType() override
32 {
34 }
35
42 void configure(const std::string &json_template);
43
48 std::string dump();
49
50 std::map<std::string, std::shared_ptr<Format>> formats_;
51 std::map<std::string, std::shared_ptr<Key>> keys_;
52 std::map<std::string, std::shared_ptr<FormatInfos>> format_infos_;
53
54 private:
55 void extract_formats(const nlohmann::json & json);
56
61 virtual std::shared_ptr<Key> create_key(const nlohmann::json &key_description) = 0;
62
63 void extract_keys(const nlohmann::json & json);
64
70 virtual void configure_format_infos(const nlohmann::json & json) = 0;
71
73};
74
75}
Card service.
The base card service class for all services.
Definition: cardservice.hpp:50
Definition: json_dump_card_service.hpp:23
bool configured_
Definition: json_dump_card_service.hpp:72
std::map< std::string, std::shared_ptr< Key > > keys_
Definition: json_dump_card_service.hpp:51
virtual std::shared_ptr< Key > create_key(const nlohmann::json &key_description)=0
std::map< std::string, std::shared_ptr< Format > > formats_
Definition: json_dump_card_service.hpp:50
std::string getCSType() override
Definition: json_dump_card_service.hpp:31
std::map< std::string, std::shared_ptr< FormatInfos > > format_infos_
Definition: json_dump_card_service.hpp:52
virtual void configure_format_infos(const nlohmann::json &json)=0
Format.
Format information.
#define JSON_DUMP_CARDSERVICE
Definition: json_dump_card_service.hpp:11
Definition: asn1.hpp:9
CardServiceType
The card services.
Definition: cardservice.hpp:35
@ CST_JSON_DUMP
Definition: cardservice.hpp:42