Keypop Card C++ API 2.0.0
Reference Card API for C++
CardSelectionRequestSpi.hpp
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#pragma once
12
13#include <memory>
14#include <ostream>
15#include <vector>
16
17#include "keyple/core/util/cpp/KeypleStd.hpp"
19
20namespace keypop {
21namespace card {
22namespace spi {
23
34public:
38 virtual ~CardSelectionRequestSpi() = default;
39
46 virtual const std::vector<int>& getSuccessfulSelectionStatusWords() const
47 = 0;
48
55 virtual const std::shared_ptr<CardRequestSpi> getCardRequest() const = 0;
56
60 friend std::ostream&
61 operator<<(std::ostream& os, const CardSelectionRequestSpi& csr) {
62 os << "CARD_SELECTION_REQUEST_SPI: {"
63 << "SUCCESSFUL_SELECTON_STATUS_WORDS: "
65 << "CARD_REQUEST: " << csr.getCardRequest() << "}";
66
67 return os;
68 }
69
73 friend std::ostream&
75 std::ostream& os, const std::shared_ptr<CardSelectionRequestSpi> csr) {
76 os << *csr.get();
77
78 return os;
79 }
80
84 friend std::ostream&
86 std::ostream& os,
87 const std::vector<std::shared_ptr<CardSelectionRequestSpi>>& csrs) {
88 os << "CARD_SELECTION_REQUEST_SPIS: {";
89
90 for (auto it = std::begin(csrs); it != std::end(csrs); ++it) {
91 os << *it;
92 if (it != csrs.end() - 1) {
93 os << ", ";
94 }
95 }
96
97 os << "}";
98
99 return os;
100 }
101};
102
103} /* namespace spi */
104} /* namespace card */
105} /* namespace keypop */
friend std::ostream & operator<<(std::ostream &os, const CardSelectionRequestSpi &csr)
virtual const std::vector< int > & getSuccessfulSelectionStatusWords() const =0
virtual const std::shared_ptr< CardRequestSpi > getCardRequest() const =0