Keyple Plugin Stub C++ Library - 2.2.2
Component of the Keyple C++ middleware
StubPoolPluginFactoryAdapter.cpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * This program and the accompanying materials are made available under the *
5 * terms of the MIT License which is available at *
6 * https://opensource.org/licenses/MIT. *
7 * *
8 * SPDX-License-Identifier: MIT *
9 ******************************************************************************/
10
11#include "keyple/plugin/stub/StubPoolPluginFactoryAdapter.hpp"
12
13#include "keyple/core/common/CommonApiProperties.hpp"
14#include "keyple/core/plugin/PluginApiProperties.hpp"
15#include "keyple/plugin/stub/StubPoolPluginAdapter.hpp"
16
17namespace keyple {
18namespace plugin {
19namespace stub {
20
21using keyple::core::common::CommonApiProperties_VERSION;
22using keyple::core::plugin::PluginApiProperties_VERSION;
23
26
27/* STUB POOL READER CONFIGURATION
28 * --------------------------------------------------------------- */
29
31 const std::string& groupReference,
32 const std::string& name,
33 std::shared_ptr<StubSmartCard> card)
34: StubReaderConfiguration(name, false, card)
35, mGroupReference(groupReference)
36{
37}
38
39const std::string&
40StubPoolReaderConfiguration::getGroupReference() const
41{
42 return mGroupReference;
43}
44
45/* STUB POOL PLUGIN FACTORY ADAPTER
46 * ------------------------------------------------------------- */
47
48StubPoolPluginFactoryAdapter::StubPoolPluginFactoryAdapter(
49 const std::string& pluginName,
50 const std::vector<std::shared_ptr<StubPoolReaderConfiguration>>&
51 readerConfigurations,
52 const int monitoringCycleDuration)
53: mReaderConfigurations(readerConfigurations)
54, mMonitoringCycleDuration(monitoringCycleDuration)
55, mPluginName(pluginName)
56{
57}
58
59const std::string
60StubPoolPluginFactoryAdapter::getPluginApiVersion() const
61{
62 return PluginApiProperties_VERSION;
63}
64
65const std::string
66StubPoolPluginFactoryAdapter::getCommonApiVersion() const
67{
68 return CommonApiProperties_VERSION;
69}
70
71const std::string&
72StubPoolPluginFactoryAdapter::getPoolPluginName() const
73{
74 return mPluginName;
75}
76
77std::shared_ptr<PoolPluginSpi>
78StubPoolPluginFactoryAdapter::getPoolPlugin()
79{
80 return std::make_shared<StubPoolPluginAdapter>(
81 mPluginName, mReaderConfigurations, mMonitoringCycleDuration);
82}
83
84} /* namespace stub */
85} /* namespace plugin */
86} /* namespace keyple */
StubPoolPluginFactoryAdapter::StubPoolReaderConfiguration StubPoolReaderConfiguration