1 #ifndef __MULTI_CLOCK_EXCEPTIONS_HPP 2 #define __MULTI_CLOCK_EXCEPTIONS_HPP 10 template<
class key_type,
11 class value_type, uint32_t clock_count, key_type invalid_index, key_type invalid_clock_index>
12 class MultiHandedClock;
28 template<
class key_type,
29 class value_type, uint32_t clock_count, key_type invalid_index, key_type invalid_clock_index = clock_count>
40 invalid_clock_index>* multiHandedClock) :
49 const char*
what() const noexcept
override {
50 int whatStringLength = snprintf(
nullptr, 0,
51 "An unknown exception happened in the MultiHandedClock instance %p",
53 char* whatSentence =
new char[whatStringLength + 1];
54 snprintf(whatSentence, whatStringLength,
55 "An unknown exception happened in the MultiHandedClock instance %p",
82 template<
class key_type,
83 class value_type, uint32_t clock_count, key_type invalid_index, key_type invalid_clock_index = clock_count>
85 invalid_index, invalid_clock_index> {
96 invalid_clock_index>* multiHandedClock,
97 const ClockIndex& emptyClock) :
100 _emptyClock(emptyClock) {};
102 const char*
what() const noexcept
override {
103 int whatStringLength = snprintf(
nullptr, 0,
104 "The clock %u of MultiHandedClock instance %p was unexpectedly empty.",
106 char* whatSentence =
new char[whatStringLength + 1];
107 snprintf(whatSentence, whatStringLength,
108 "The clock %u of MultiHandedClock instance %p was unexpectedly empty.",
136 template<
class key_type,
137 class value_type, uint32_t clock_count, key_type invalid_index, key_type invalid_clock_index = clock_count>
139 invalid_index, invalid_clock_index> {
151 invalid_clock_index>* multiHandedClock,
152 const key_type& invalidIndex) :
155 _invalidIndex(invalidIndex) {};
157 const char*
what() const noexcept
override {
158 int whatStringLength = snprintf(
nullptr, 0,
159 "The index %u is invalid for the MultiHandedClock instance %p.",
161 char* whatSentence =
new char[whatStringLength + 1];
162 snprintf(whatSentence, whatStringLength,
163 "The index %u is invalid for the MultiHandedClock instance %p.",
189 template<
class key_type,
190 class value_type, uint32_t clock_count, key_type invalid_index, key_type invalid_clock_index = clock_count>
192 clock_count, invalid_index,
193 invalid_clock_index> {
206 invalid_clock_index>* multiHandedClock,
207 const key_type& alreadyContainedIndex) :
210 _alreadyContainedIndex(alreadyContainedIndex) {};
212 const char*
what() const noexcept
override {
213 int whatStringLength = snprintf(
nullptr, 0,
214 "The index %u is unexpectedly already contained in the MultiHandedClock instance %p.",
216 char* whatSentence =
new char[whatStringLength + 1];
217 snprintf(whatSentence, whatStringLength,
218 "The index %u is unexpectedly already contained in the MultiHandedClock instance %p.",
244 template<
class key_type,
245 class value_type, uint32_t clock_count, key_type invalid_index, key_type invalid_clock_index = clock_count>
247 invalid_index, invalid_clock_index> {
259 invalid_clock_index>* multiHandedClock,
260 const key_type& notContainedIndex) :
263 _notContainedIndex(notContainedIndex) {};
265 const char*
what() const noexcept
override {
266 int whatStringLength = snprintf(
nullptr, 0,
267 "The index %u is unexpectedly not contained in the MultiHandedClock instance %p.",
269 char* whatSentence =
new char[whatStringLength + 1];
270 snprintf(whatSentence, whatStringLength,
271 "The index %u is unexpectedly not contained in the MultiHandedClock instance %p.",
285 #endif // __MULTI_CLOCK_EXCEPTIONS_HPP MultiHandedClockInvalidIndexException(const MultiHandedClock< key_type, value_type, clock_count, invalid_index, invalid_clock_index > *multiHandedClock, const key_type &invalidIndex)
Constructor of an exception thrown when an access to a MultiHandedClock with an invalid index happens...
Definition: multi_clock_exceptions.hpp:150
Exception Thrown When an Access to a MultiHandedClock with an Invalid Index Happens.
Definition: multi_clock_exceptions.hpp:138
Exception thrown when a MultiHandedClock is empty.
Definition: multi_clock_exceptions.hpp:84
const ClockIndex _emptyClock
Index of the Empty Clock.
Definition: multi_clock_exceptions.hpp:119
Exception thrown in a MultiHandedClock.
Definition: multi_clock_exceptions.hpp:30
const MultiHandedClock< key_type, value_type, clock_count, invalid_index, invalid_clock_index > * _multiHandedClock
The MultiHandedClock.
Definition: multi_clock_exceptions.hpp:66
const key_type _notContainedIndex
The Expected Key.
Definition: multi_clock_exceptions.hpp:281
const char * what() const noexcept override
Definition: multi_clock_exceptions.hpp:265
uint32_t ClockIndex
Data type of clock indexes.
Definition: multi_clock.hpp:17
const char * what() const noexcept override
Definition: multi_clock_exceptions.hpp:157
Definition: multi_clock.hpp:11
const key_type _invalidIndex
Invalid Index That was Used.
Definition: multi_clock_exceptions.hpp:173
Exception thrown when a key is already contained in a MultiHandedClock.
Definition: multi_clock_exceptions.hpp:191
MultiHandedClockException(const MultiHandedClock< key_type, value_type, clock_count, invalid_index, invalid_clock_index > *multiHandedClock)
Constructor of an exception thrown in MultiHandedClock.
Definition: multi_clock_exceptions.hpp:39
MultiHandedClockNotContainedException(const MultiHandedClock< key_type, value_type, clock_count, invalid_index, invalid_clock_index > *multiHandedClock, const key_type ¬ContainedIndex)
Constructor of an exception thrown when a key was unexpectedly not already contained in any clock of ...
Definition: multi_clock_exceptions.hpp:258
MultiHandedClockAlreadyContainedException(const MultiHandedClock< key_type, value_type, clock_count, invalid_index, invalid_clock_index > *multiHandedClock, const key_type &alreadyContainedIndex)
Constructor of an exception thrown when a key was unexpectedly already contained in any clock of the ...
Definition: multi_clock_exceptions.hpp:204
Multiple Clocks with a Common Set of Entries.
Definition: multi_clock.hpp:54
MultiHandedClockEmptyException(const MultiHandedClock< key_type, value_type, clock_count, invalid_index, invalid_clock_index > *multiHandedClock, const ClockIndex &emptyClock)
Constructor of an exception thrown when an MultiHandedClock is empty.
Definition: multi_clock_exceptions.hpp:95
const key_type _alreadyContainedIndex
The unexpected key.
Definition: multi_clock_exceptions.hpp:228
const char * what() const noexcept override
Definition: multi_clock_exceptions.hpp:212
Exception thrown when a key is not already contained in a MultiHandedClock.
Definition: multi_clock_exceptions.hpp:246
const char * what() const noexcept override
Definition: multi_clock_exceptions.hpp:102
const char * what() const noexcept override
What caused the exception happened?
Definition: multi_clock_exceptions.hpp:49