Keypop Reader C++ API - 2.1.0
Component of the Keypop C++ API
CardSelectionManager.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2025 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * See the NOTICE file(s) distributed with this work for additional *
5 * information regarding copyright ownership. *
6 * *
7 * This program and the accompanying materials are made available under the *
8 * terms of the MIT License which is available at *
9 * https://opensource.org/licenses/MIT *
10 * *
11 * SPDX-License-Identifier: MIT *
12 ******************************************************************************/
13
14#pragma once
15
16#include <memory>
17#include <string>
18
24
25namespace keypop {
26namespace reader {
27namespace selection {
28
33
77public:
81 virtual ~CardSelectionManager() = default;
82
91 virtual void setMultipleSelectionMode() = 0;
92
110 virtual int prepareSelection(
111 const std::shared_ptr<CardSelectorBase> cardSelector,
112 const std::shared_ptr<CardSelectionExtension> cardSelectionExtension)
113 = 0;
114
124 virtual void prepareReleaseChannel() = 0;
125
137 virtual const std::string exportCardSelectionScenario() const = 0;
138
153 virtual int
154 importCardSelectionScenario(const std::string& cardSelectionScenario) = 0;
155
172 virtual const std::shared_ptr<CardSelectionResult>
173 processCardSelectionScenario(std::shared_ptr<CardReader> reader) = 0;
174
193 std::shared_ptr<ObservableCardReader> observableCardReader,
194 const ObservableCardReader::NotificationMode notificationMode) = 0;
195
210 virtual const std::shared_ptr<CardSelectionResult>
212 const std::shared_ptr<ScheduledCardSelectionsResponse>
213 scheduledCardSelectionsResponse) = 0;
214
246 virtual const std::string exportProcessedCardSelectionScenario() const = 0;
247
275 virtual const std::shared_ptr<CardSelectionResult>
277 const std::string& processedCardSelectionScenario) const = 0;
278};
279
280} /* namespace selection */
281} /* namespace reader */
282} /* namespace keypop */
Card reader driving the underlying hardware to manage the card detection.
Definition: CardReader.hpp:26
Card reader able to observe the insertion/removal of cards.
NotificationMode
The options that apply when a card is detected.
Service dedicated to card selection, based on the preparation of a card selection scenario.
virtual int importCardSelectionScenario(const std::string &cardSelectionScenario)=0
Imports a card selection scenario provided as a string in string format.
virtual int prepareSelection(const std::shared_ptr< CardSelectorBase > cardSelector, const std::shared_ptr< CardSelectionExtension > cardSelectionExtension)=0
Appends a card selection case to the card selection scenario.
virtual const std::shared_ptr< CardSelectionResult > importProcessedCardSelectionScenario(const std::string &processedCardSelectionScenario) const =0
Imports a previously exported processed card selection scenario in string format and returns the card...
virtual void scheduleCardSelectionScenario(std::shared_ptr< ObservableCardReader > observableCardReader, const ObservableCardReader::NotificationMode notificationMode)=0
Schedules the execution of the prepared card selection scenario as soon as a card is presented to the...
virtual ~CardSelectionManager()=default
Virtual destructor.
virtual void prepareReleaseChannel()=0
Requests the closing of the physical channel at the end of the execution of the card selection reques...
virtual const std::shared_ptr< CardSelectionResult > parseScheduledCardSelectionsResponse(const std::shared_ptr< ScheduledCardSelectionsResponse > scheduledCardSelectionsResponse)=0
Analyzes the responses provided by a calypsonet::terminal::reader::CardReaderEvent following the inse...
virtual const std::shared_ptr< CardSelectionResult > processCardSelectionScenario(std::shared_ptr< CardReader > reader)=0
Explicitely executes a previously prepared card selection scenario and returns the card selection res...
virtual void setMultipleSelectionMode()=0
Sets the multiple selection mode to process all selection cases even in case of a successful selectio...
virtual const std::string exportCardSelectionScenario() const =0
Exports the current prepared card selection scenario to a string in string format.
virtual const std::string exportProcessedCardSelectionScenario() const =0
Exports the content of the previously processed card selection scenario in string format.
SPI provided by a card extension, allowing to enrich a selection case with additional commands if req...