Keypop Storage Card C++ API - 1.2.0
Component of the Keypop C++ API
SCReaderCommunicationException.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2026 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 <string>
15
16#include "keypop/reader/ReaderCommunicationException.hpp"
18
19namespace keypop {
20namespace storagecard {
21
22using keypop::reader::ReaderCommunicationException;
23
35: public ReaderCommunicationException,
37public:
48 const std::shared_ptr<int>& blockAddress, const std::string& message)
49 : ReaderCommunicationException(message)
50 , mBlockAddress(blockAddress)
51 {
52 }
53
65 const std::shared_ptr<int>& blockAddress,
66 const std::string& message,
67 const std::exception& cause)
68 : ReaderCommunicationException(message, cause)
69 , mBlockAddress(blockAddress)
70 {
71 }
72
78 std::shared_ptr<int>
79 getBlockAddress() const override
80 {
81 return mBlockAddress;
82 }
83
84private:
88 const std::shared_ptr<int> mBlockAddress;
89};
90
91} /* namespace storagecard */
92} /* namespace keypop */
Indicates an input/output error that occurred while communicating with the card reader.
SCReaderCommunicationException(const std::shared_ptr< int > &blockAddress, const std::string &message)
Creates a new exception indicating a reader communication error during the execution of a storage car...
std::shared_ptr< int > getBlockAddress() const override
Returns the address of the block involved in the error, if applicable.The block address that caused t...
SCReaderCommunicationException(const std::shared_ptr< int > &blockAddress, const std::string &message, const std::exception &cause)
Creates a new exception indicating a reader communication error during the execution of a storage car...
Interface for exceptions occurring during the execution of a command on a StorageCard.