Keyple Plugin Stub C++ Library - 2.2.2
Component of the Keyple C++ middleware
StubPoolPluginFactoryBuilder.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/StubPoolPluginFactoryBuilder.hpp"
12
13#include "keyple/plugin/stub/StubPoolPluginFactoryAdapter.hpp"
14
15namespace keyple {
16namespace plugin {
17namespace stub {
18
22
23/* BUILDER
24 * --------------------------------------------------------------------------------------
25 */
26
28: mMonitoringCycleDuration(0)
29{
30}
31
33Builder::withStubReader(
34 const std::string& groupReference,
35 const std::string& name,
36 std::shared_ptr<StubSmartCard> card)
37{
38 mReaderConfigurations.push_back(
39 std::make_shared<StubPoolReaderConfiguration>(
40 groupReference, name, card));
41
42 return *this;
43}
44
46Builder::withMonitoringCycleDuration(const int duration)
47{
48 mMonitoringCycleDuration = duration;
49
50 return *this;
51}
52
53std::shared_ptr<StubPoolPluginFactory>
54Builder::build()
55{
56 return std::shared_ptr<StubPoolPluginFactoryAdapter>(
57 new StubPoolPluginFactoryAdapter(
58 PLUGIN_NAME, mReaderConfigurations, mMonitoringCycleDuration));
59}
60
61/* STUB POOL PLUGIN FACTORY BUILDER
62 * ------------------------------------------------------------- */
63
64const std::string StubPoolPluginFactoryBuilder::PLUGIN_NAME = "StubPoolPlugin";
65
66StubPoolPluginFactoryBuilder::StubPoolPluginFactoryBuilder()
67{
68}
69
70std::unique_ptr<Builder>
71StubPoolPluginFactoryBuilder::builder()
72{
73 return std::unique_ptr<Builder>(new Builder());
74}
75
76} /* namespace stub */
77} /* namespace plugin */
78} /* namespace keyple */
StubPluginFactoryBuilder::Builder Builder
StubPoolPluginFactoryAdapter::StubPoolReaderConfiguration StubPoolReaderConfiguration