Keypop Card C++ API 2.0.0
Reference Card API for C++
CardResponseApi.hpp
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2024 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 https://opensource.org/licenses/MIT. *
6 * *
7 * SPDX-License-Identifier: MIT *
8 **************************************************************************************************/
9
10#pragma once
11
12#include <memory>
13#include <ostream>
14#include <vector>
15
17
18namespace keypop {
19namespace card {
20
40public:
44 virtual ~CardResponseApi() = default;
45
52 virtual const std::vector<std::shared_ptr<ApduResponseApi>>& getApduResponses() const = 0;
53
60 virtual bool isLogicalChannelOpen() const = 0;
61
65 friend std::ostream&
66 operator<<(std::ostream& os, const std::shared_ptr<CardResponseApi> cra) {
67 os << "CARD_RESPONSE_API: {";
68
69 if (cra == nullptr) {
70 os << "null";
71 } else {
72 os << "CARD_RESPONSE_API: {"
73 << "IS_LOGICAL_CHANNEL_OPEN = " << cra->isLogicalChannelOpen() << ", "
74 << "APDU_RESPONSES = {" << cra->getApduResponses() << "}";
75 }
76
77 os << "}";
78
79 return os;
80 }
81};
82
83} /* namespace card */
84} /* namespace keypop */
friend std::ostream & operator<<(std::ostream &os, const std::shared_ptr< CardResponseApi > cra)
virtual bool isLogicalChannelOpen() const =0
virtual ~CardResponseApi()=default
virtual const std::vector< std::shared_ptr< ApduResponseApi > > & getApduResponses() const =0