InvalidAddress.hpp
Go to the documentation of this file.
//
// Created by anonymus-raccoon on 1/27/20.
//
#ifndef COMSQUARE_INVALIDADDRESS_HPP
#define COMSQUARE_INVALIDADDRESS_HPP
#include <exception>
#include <string>
#include <ios>
#include <sstream>
namespace ComSquare
{
class InvalidAddress : std::exception {
private:
std::string _msg;
public:
InvalidAddress(std::string where, int32_t addr)
{
std::stringstream stream;
stream << "Could not read/write data at address: 0x" << std::hex << addr << " from " << where;
this->_msg = stream.str();
}
const char *what() const noexcept override { return this->_msg.c_str(); }
};
}
#endif //COMSQUARE_INVALIDADDRESS_HPP
ComSquare::InvalidAddress::what
const char * what() const noexcept override
Definition: InvalidAddress.hpp:26
ComSquare::InvalidAddress::_msg
std::string _msg
Definition: InvalidAddress.hpp:18
ComSquare::InvalidAddress::InvalidAddress
InvalidAddress(std::string where, int32_t addr)
Definition: InvalidAddress.hpp:20
ComSquare::InvalidAddress
Exception thrown when trying to read/write to an invalid address.
Definition: InvalidAddress.hpp:16
ComSquare
Definition: APU.cpp:9