Keyple Service C++ Library - 3.3.5
Component of the Keyple C++ middleware
CardResponseAdapter.cpp
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 Eclipse Public License 2.0 which is available at *
9 * http://www.eclipse.org/legal/epl-2.0 *
10 * *
11 * SPDX-License-Identifier: EPL-2.0 *
12 ******************************************************************************/
13
14#include "keyple/core/service/CardResponseAdapter.hpp"
15
16#include <memory>
17#include <vector>
18
19namespace keyple {
20namespace core {
21namespace service {
22
23CardResponseAdapter::CardResponseAdapter(
24 const std::vector<std::shared_ptr<ApduResponseApi>>& apduResponses,
25 const bool isLogicalChannelOpen)
26: mApduResponses(apduResponses)
27, mIsLogicalChannelOpen(isLogicalChannelOpen)
28{
29}
30
31const std::vector<std::shared_ptr<ApduResponseApi>>&
32CardResponseAdapter::getApduResponses() const
33{
34 return mApduResponses;
35}
36
37bool
38CardResponseAdapter::isLogicalChannelOpen() const
39{
40 return mIsLogicalChannelOpen;
41}
42
43std::ostream&
44operator<<(std::ostream& os, const CardResponseAdapter& cra)
45{
46 os << "CARD_RESPONSE_ADAPTER: {"
47 << "APDU_RESPONSE = <TODO>, "
48 << "IS_LOGICAL_CHANNEL_OPEN = " << cra.mIsLogicalChannelOpen << "}";
49
50 return os;
51}
52
53std::ostream&
54operator<<(std::ostream& os, const std::shared_ptr<CardResponseAdapter> cra)
55{
56 os << *cra.get();
57
58 return os;
59}
60
61} /* namespace service */
62} /* namespace core */
63} /* namespace keyple */
std::ostream & operator<<(std::ostream &os, const std::shared_ptr< CardResponseAdapter > cra)