1
0
mirror of https://github.com/momo5502/hypervisor.git synced 2025-07-05 18:51:53 +00:00

Add sleep callback

This commit is contained in:
momo5502
2022-03-26 15:56:36 +01:00
parent eef4a9a5a2
commit da7204ee90
8 changed files with 245 additions and 83 deletions

38
src/driver/exception.hpp Normal file
View File

@ -0,0 +1,38 @@
#pragma once
#include "type_traits.hpp"
namespace std
{
class exception
{
public:
exception& operator=(const exception& obj) noexcept = default;
exception& operator=(exception&& obj) noexcept = default;
virtual ~exception() = default;
virtual const char* what() const noexcept = 0;
};
class runtime_error : public exception
{
public:
runtime_error(const char* message)
: message_(message)
{
}
runtime_error(const runtime_error& obj) noexcept = default;
runtime_error& operator=(const runtime_error& obj) noexcept = default;
runtime_error(runtime_error&& obj) noexcept = default;
runtime_error& operator=(runtime_error&& obj) noexcept = default;
const char* what() const noexcept override
{
return message_;
}
private:
const char* message_{};
};
}