Keyple Plugin Stub C++ Library - 2.2.2
Component of the Keyple C++ middleware
StubPluginFactoryBuilder.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/StubPluginFactoryBuilder.hpp"
12
13namespace keyple {
14namespace plugin {
15namespace stub {
16
18
19const std::string StubPluginFactoryBuilder::PLUGIN_NAME = "StubPlugin";
20
21/* BUILDER
22 * --------------------------------------------------------------------------------------
23 */
24
26: mMonitoringCycleDuration(0)
27{
28}
29
31Builder::withStubReader(
32 const std::string& name,
33 const bool isContactLess,
34 std::shared_ptr<StubSmartCard> card)
35{
36 mReaderConfigurations.push_back(
37 std::make_shared<StubReaderConfiguration>(name, isContactLess, card));
38
39 return *this;
40}
41
43Builder::withMonitoringCycleDuration(const int duration)
44{
45 mMonitoringCycleDuration = duration;
46
47 return *this;
48}
49
50std::shared_ptr<StubPluginFactory>
51Builder::build() const
52{
53 return std::make_shared<StubPluginFactoryAdapter>(
54 PLUGIN_NAME, mReaderConfigurations, mMonitoringCycleDuration);
55}
56
57/* STUB PLUGIN FACTORY BUILDER
58 * ------------------------------------------------------------------ */
59
60std::unique_ptr<Builder>
61StubPluginFactoryBuilder::builder()
62{
63 return std::unique_ptr<Builder>(new Builder());
64}
65
66} /* namespace stub */
67} /* namespace plugin */
68} /* namespace keyple */
StubPluginFactoryBuilder::Builder Builder