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) 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 <stdexcept>
15#include <string>
16
18
19namespace keypop {
20namespace card {
21
28class AbstractApduException : public std::exception {
29public:
41 const std::shared_ptr<CardResponseApi> cardResponseApi,
42 const bool isCardResponseComplete,
43 const std::string& message)
44 : std::exception()
45 , mMessage(message)
46 , mCardResponseApi(cardResponseApi)
47 , mIsCardResponseComplete(isCardResponseComplete) {
48 }
49
63 const std::shared_ptr<CardResponseApi> cardResponseApi,
64 const bool isCardResponseComplete,
65 const std::string& message,
66 const std::shared_ptr<std::exception> cause)
67 : std::exception(*cause)
68 , mMessage(message)
69 , mCardResponseApi(cardResponseApi)
70 , mIsCardResponseComplete(isCardResponseComplete) {
71 }
72
79 const std::shared_ptr<CardResponseApi>
81 return mCardResponseApi;
82 }
83
91 bool
93 return mIsCardResponseComplete;
94 }
95
99 const std::string&
100 getMessage() const {
101 return mMessage;
102 }
103
104private:
108 const std::string mMessage;
109
113 const std::shared_ptr<CardResponseApi> mCardResponseApi;
114
118 const bool mIsCardResponseComplete = false;
119};
120
121} /* namespace card */
122} /* 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() const