Keyple Card Calypso C++ Library 2.1.0
Reference Terminal Reader API for C++
CardRequestAdapter.cpp
Go to the documentation of this file.
1/**************************************************************************************************
2 * Copyright (c) 2021 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * See the NOTICE file(s) distributed with this work for additional information regarding *
5 * copyright ownership. *
6 * *
7 * This program and the accompanying materials are made available under the terms of the Eclipse *
8 * Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 *
9 * *
10 * SPDX-License-Identifier: EPL-2.0 *
11 **************************************************************************************************/
12
13#include "CardRequestAdapter.h"
14
15namespace keyple {
16namespace card {
17namespace calypso {
18
20 const std::vector<std::shared_ptr<ApduRequestSpi>>& apduRequests,
21 const bool isStatusCodesVerificationEnabled)
22: mApduRequests(apduRequests),
23 mIsStatusCodesVerificationEnabled(isStatusCodesVerificationEnabled) {}
24
25const std::vector<std::shared_ptr<ApduRequestSpi>>& CardRequestAdapter::getApduRequests() const
26{
27 return mApduRequests;
28}
29
31{
32 return mIsStatusCodesVerificationEnabled;
33}
34
35std::ostream& operator<<(std::ostream& os, const CardRequestAdapter& cra)
36{
37 os << "CARD_REQUEST_ADAPTER: {"
38 << "APDU_REQUESTS: " << cra.mApduRequests << ", "
39 << "IS_STATUS_CODES_VERIFICATION_ENABLED: " << cra.mIsStatusCodesVerificationEnabled
40 << "}";
41
42 return os;
43}
44
45std::ostream& operator<<(std::ostream& os, const std::shared_ptr<CardRequestAdapter> cra)
46{
47 if (cra == nullptr) {
48 os << "CARD_REQUEST_ADAPTER: null";
49 } else {
50 os << *cra.get();
51 }
52
53 return os;
54}
55
56
57}
58}
59}
const std::vector< std::shared_ptr< ApduRequestSpi > > & getApduRequests() const override
CardRequestAdapter(const std::vector< std::shared_ptr< ApduRequestSpi > > &apduRequests, const bool isStatusCodesVerificationEnabled)
std::ostream & operator<<(std::ostream &os, const std::shared_ptr< ApduRequestAdapter > ara)