Keypop Card C++ API 2.0.0
Reference Card API for C++
AbstractApduException.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 <stdexcept>
14#include <string>
15
17
18namespace keypop {
19namespace card {
20
27class AbstractApduException : public std::exception {
28public:
39 const std::shared_ptr<CardResponseApi> cardResponseApi,
40 const bool isCardResponseComplete,
41 const std::string& message)
42 : std::exception(message)
43 , mCardResponseApi(cardResponseApi)
44 , mIsCardResponseComplete(isCardResponseComplete) {
45 }
46
58 const std::shared_ptr<CardResponseApi> cardResponseApi,
59 const bool isCardResponseComplete,
60 const std::string& message,
61 const std::shared_ptr<std::exception> cause)
62 : std::exception(message, cause)
63 , mCardResponseApi(cardResponseApi)
64 , mIsCardResponseComplete(isCardResponseComplete) {
65 }
66
73 const std::shared_ptr<CardResponseApi>
75 return mCardResponseApi;
76 }
77
85 bool
87 return mIsCardResponseComplete;
88 }
89
90private:
94 const std::shared_ptr<CardResponseApi> mCardResponseApi;
95
99 const bool mIsCardResponseComplete = false;
100};
101
102} /* namespace card */
103} /* namespace keypop */
AbstractApduException(const std::shared_ptr< CardResponseApi > cardResponseApi, const bool isCardResponseComplete, const std::string &message, const std::shared_ptr< std::exception > cause)
AbstractApduException(const std::shared_ptr< CardResponseApi > cardResponseApi, const bool isCardResponseComplete, const std::string &message)
const std::shared_ptr< CardResponseApi > getCardResponse()