MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
Errors

Errors and error codes. More...

Classes

struct  mtcore::ascii::UnescapeError
 Error when unescaping characters fails. More...
 
struct  mtcore::SubnetMaskV4
 Represents the bitwise mask for a version 4 subnet. More...
 

Typedefs

using mtcore::SeedError = int
 Seeding errors can vary differently, using an int to indicate the error code.
 

Enumerations

enum class  mtcore::AllocationError { mtcore::AllocationError::ALLOCATION_FAILED }
 Error indicating failed allocation. More...
 
enum class  mtcore::AllocatorError { mtcore::AllocatorError::MEMORY_LEAK_DETECTED }
 Error indicating allocator internal state failed (e.g. More...
 
enum class  mtcore::ascii::AsciiNumericParseError { mtcore::ascii::AsciiNumericParseError::INVALID_SLICE , mtcore::ascii::AsciiNumericParseError::INVALID_SIGN , mtcore::ascii::AsciiNumericParseError::INVALID_INPUT , mtcore::ascii::AsciiNumericParseError::OVERFLOW_DETECTED }
 Errors when parsing ASCII strings as numbers. More...
 
enum class  mtcore::RuneConversionError { mtcore::RuneConversionError::NoInput , mtcore::RuneConversionError::InvalidChars }
 Errors that can occur when doing conversions to a rune. More...
 
enum class  mtcore::BitStrInitError { mtcore::BitStrInitError::ALLOCATION_FAILED = static_cast<int>(AllocationError::ALLOCATION_FAILED) , mtcore::BitStrInitError::INVALID_BINARY_STRING }
 Bitset String-based Initialization Errors. More...
 
enum class  mtcore::CollectionAddNoAllocationError { mtcore::CollectionAddNoAllocationError::NO_ROOM }
 Errors when adding elements to collections when no allocation is allowed. More...
 
enum class  mtcore::io::SliceReaderError { mtcore::io::SliceReaderError::END_OF_FILE , mtcore::io::SliceReaderError::ALLOCATION_FAILED , mtcore::io::SliceReaderError::SIZE_EXCEEDED }
 Errors that can happen from the Slice Reader Note that these are all required by the Reader class as some methods there may allocate. More...
 
enum class  mtcore::io::SliceWriteError { mtcore::io::SliceWriteError::OUT_OF_ROOM }
 Errors when writing to a slice. More...
 
enum class  mtcore::io::VoidWriteError { mtcore::io::VoidWriteError::OUT_OF_ROOM }
 Errors when writing to a slice. More...
 
enum class  mtcore::io::OstreamWriteErr { mtcore::io::OstreamWriteErr::OUT_OF_ROOM }
 Errors when writing to a slice. More...
 
enum class  mtcore::IpInitError { mtcore::IpInitError::INVALID_INPUT }
 Error when initializing an IP address. More...
 
enum class  mtcore::Ip6ConversionError { mtcore::Ip6ConversionError::NOT_IP4 }
 Error when converting from IPv6 to IPv4. More...
 
enum class  mtcore::SubnetMaskError { mtcore::SubnetMaskError::INVALID_SUBNET_ID }
 Error when creating a subnet mask. More...
 
enum class  mtcore::Mt19937_64Error { mtcore::Mt19937_64Error::ALLOCATION_FAILED , mtcore::Mt19937_64Error::MT19937_BAD_INIT }
 Errors that can happen when making a Mersenne Twister. More...
 
enum class  mtcore::thread::ArcError { mtcore::thread::ArcError::CannotAcquire = -1 }
 Error when cannot acquire an ARC. More...
 
enum class  mtcore::thread::BroadcastSubscribeError { mtcore::thread::BroadcastSubscribeError::CHANNEL_CLOSED , mtcore::thread::BroadcastSubscribeError::ALLOCATION_FAILED , mtcore::thread::BroadcastSubscribeError::CANNOT_ACQUIRE }
 Errors when getting a broadcast subscription. More...
 
enum class  mtcore::thread::ChannelSendBlockErrors { mtcore::thread::ChannelSendBlockErrors::CHANNEL_CLOSED }
 Errors for when blocking sends fail. More...
 
enum class  mtcore::thread::ChannelTrySendErrors { mtcore::thread::ChannelTrySendErrors::CHANNEL_CLOSED , mtcore::thread::ChannelTrySendErrors::COULD_NOT_LOCK , mtcore::thread::ChannelTrySendErrors::NO_ROOM }
 Errors for when non-blocking sends fail. More...
 
enum class  mtcore::thread::ChannelSendBeforeErrors { mtcore::thread::ChannelSendBeforeErrors::CHANNEL_CLOSED , mtcore::thread::ChannelSendBeforeErrors::TIMEOUT }
 Errors for when timed blocking sends fail. More...
 
enum class  mtcore::thread::ChannelTryReceiveErrors { mtcore::thread::ChannelTryReceiveErrors::COULD_NOT_LOCK , mtcore::thread::ChannelTryReceiveErrors::MESSAGE_NOT_READY }
 Errors for when non-blocking receives fail Note: If the channel is closed, a nullopt will be returned instead of an error. More...
 
enum class  mtcore::thread::ChannelReceiveBeforeErrors { mtcore::thread::ChannelReceiveBeforeErrors::TIMEOUT }
 Errors for when timed receives fail Note: If the channel is closed, a nullopt will be returned instead of an error. More...
 
enum class  mtcore::thread::ChannelGrowTrySendErrors { mtcore::thread::ChannelGrowTrySendErrors::CHANNEL_CLOSED , mtcore::thread::ChannelGrowTrySendErrors::COULD_NOT_LOCK , mtcore::thread::ChannelGrowTrySendErrors::NO_ROOM , mtcore::thread::ChannelGrowTrySendErrors::ALLOCATION_FAILED }
 Errors for when trying to do non-blocking send (with possible allocation) fails. More...
 
enum class  mtcore::thread::ChannelGrowSendBlockErrors { mtcore::thread::ChannelGrowSendBlockErrors::CHANNEL_CLOSED , mtcore::thread::ChannelGrowSendBlockErrors::ALLOCATION_FAILED }
 Errors for when trying to do blocking send (with possible allocation) fails. More...
 
enum class  mtcore::thread::ChannelGrowSendBeforeErrors { mtcore::thread::ChannelGrowSendBeforeErrors::CHANNEL_CLOSED , mtcore::thread::ChannelGrowSendBeforeErrors::TIMEOUT , mtcore::thread::ChannelGrowSendBeforeErrors::ALLOCATION_FAILED }
 Errors for when trying to do timed blocking send (with possible allocation) fails. More...
 
enum class  mtcore::thread::PubSubSendBlockGrowErrors { mtcore::thread::PubSubSendBlockGrowErrors::CHANNEL_CLOSED , mtcore::thread::PubSubSendBlockGrowErrors::PARTIAL_SEND , mtcore::thread::PubSubSendBlockGrowErrors::ALLOCATION_FAILED }
 Errors for when blocking publishing fails. More...
 
enum class  mtcore::thread::PubSubSendBeforeGrowsError { mtcore::thread::PubSubSendBeforeGrowsError::CHANNEL_CLOSED , mtcore::thread::PubSubSendBeforeGrowsError::TIMEOUT , mtcore::thread::PubSubSendBeforeGrowsError::PARTIAL_SEND , mtcore::thread::PubSubSendBeforeGrowsError::ALLOCATION_FAILED }
 Errors for when timed blocking publishing fails. More...
 
enum class  mtcore::thread::PubSubTrySendGrowsError {
  mtcore::thread::PubSubTrySendGrowsError::CHANNEL_CLOSED , mtcore::thread::PubSubTrySendGrowsError::COULD_NOT_LOCK , mtcore::thread::PubSubTrySendGrowsError::NO_ROOM , mtcore::thread::PubSubTrySendGrowsError::PARTIAL_SEND ,
  mtcore::thread::PubSubTrySendGrowsError::ALLOCATION_FAILED
}
 Errors for when non-blocking publishing fails. More...
 
enum class  mtcore::thread::SelectErrors { mtcore::thread::SelectErrors::SELECT_TIMEOUT , mtcore::thread::SelectErrors::DEADLOCK_DETECTED , mtcore::thread::SelectErrors::NOT_READY }
 Errors for when a select statement fails SELECT_TIMEOUT and DEADLOCK_DETECTED are the only ones which will be bubbled up NOT_READY is an internal error to indicate loop continuation. More...
 
enum class  mtcore::thread::SelectOptionErrors { mtcore::thread::SelectOptionErrors::ATTEMPT_FAILED , mtcore::thread::SelectOptionErrors::SKIP , mtcore::thread::SelectOptionErrors::TIMEOUT }
 Errors indicating control flow from a select option ATTEMPT_FAILED indicates to try the next option SKIP indicates to forever skip this option TIMEOUT indicates that a timeout error should be raised and select execution should stop. More...
 

Detailed Description

Errors and error codes.

Typedef Documentation

◆ SeedError

using mtcore::SeedError = int

Seeding errors can vary differently, using an int to indicate the error code.

Definition at line 54 of file random.hpp.

Enumeration Type Documentation

◆ AllocationError

enum class mtcore::AllocationError
strong

Error indicating failed allocation.

Enumerator
ALLOCATION_FAILED 

Definition at line 51 of file core/mtcore/alloc.hpp.

◆ AllocatorError

enum class mtcore::AllocatorError
strong

Error indicating allocator internal state failed (e.g.

memory leak detected)

Enumerator
MEMORY_LEAK_DETECTED 

Definition at line 57 of file core/mtcore/alloc.hpp.

◆ ArcError

enum class mtcore::thread::ArcError
strong

Error when cannot acquire an ARC.

Enumerator
CannotAcquire 

Error when a new Arc reference cannot be acquired (e.g.

referenced object already cleaned up)

Definition at line 116 of file arc.hpp.

116 {
118 CannotAcquire = -1,
119 };
@ CannotAcquire
Error when a new Arc reference cannot be acquired (e.g.
Definition arc.hpp:118

◆ AsciiNumericParseError

Errors when parsing ASCII strings as numbers.

Enumerator
INVALID_SLICE 
INVALID_SIGN 
INVALID_INPUT 
OVERFLOW_DETECTED 

Definition at line 44 of file ascii.hpp.

◆ BitStrInitError

enum class mtcore::BitStrInitError
strong

Bitset String-based Initialization Errors.

Enumerator
ALLOCATION_FAILED 
INVALID_BINARY_STRING 

Definition at line 35 of file bitset.hpp.

35 {
36 ALLOCATION_FAILED = static_cast<int>(AllocationError::ALLOCATION_FAILED),
37 INVALID_BINARY_STRING
38 };

◆ BroadcastSubscribeError

Errors when getting a broadcast subscription.

Enumerator
CHANNEL_CLOSED 
ALLOCATION_FAILED 
CANNOT_ACQUIRE 

Definition at line 38 of file broadcaster.hpp.

◆ ChannelGrowSendBeforeErrors

Errors for when trying to do timed blocking send (with possible allocation) fails.

Enumerator
CHANNEL_CLOSED 
TIMEOUT 
ALLOCATION_FAILED 

Definition at line 52 of file inbox.hpp.

◆ ChannelGrowSendBlockErrors

Errors for when trying to do blocking send (with possible allocation) fails.

Enumerator
CHANNEL_CLOSED 
ALLOCATION_FAILED 

Definition at line 43 of file inbox.hpp.

43 {
46 };

◆ ChannelGrowTrySendErrors

Errors for when trying to do non-blocking send (with possible allocation) fails.

Enumerator
CHANNEL_CLOSED 
COULD_NOT_LOCK 
NO_ROOM 
ALLOCATION_FAILED 

Definition at line 32 of file inbox.hpp.

◆ ChannelReceiveBeforeErrors

Errors for when timed receives fail Note: If the channel is closed, a nullopt will be returned instead of an error.

Enumerator
TIMEOUT 

Definition at line 89 of file channels.hpp.

89 {
90 TIMEOUT,
91 };

◆ ChannelSendBeforeErrors

Errors for when timed blocking sends fail.

Enumerator
CHANNEL_CLOSED 
TIMEOUT 

Definition at line 61 of file channels.hpp.

61 {
63 TIMEOUT,
64 };

◆ ChannelSendBlockErrors

Errors for when blocking sends fail.

Enumerator
CHANNEL_CLOSED 

Definition at line 39 of file channels.hpp.

39 {
41 };

◆ ChannelTryReceiveErrors

Errors for when non-blocking receives fail Note: If the channel is closed, a nullopt will be returned instead of an error.

Enumerator
COULD_NOT_LOCK 
MESSAGE_NOT_READY 

Definition at line 79 of file channels.hpp.

◆ ChannelTrySendErrors

Errors for when non-blocking sends fail.

Enumerator
CHANNEL_CLOSED 
COULD_NOT_LOCK 
NO_ROOM 

Definition at line 49 of file channels.hpp.

49 {
52 NO_ROOM,
53 };

◆ CollectionAddNoAllocationError

Errors when adding elements to collections when no allocation is allowed.

Enumerator
NO_ROOM 

Definition at line 298 of file core/mtcore/core.hpp.

298 {
299 NO_ROOM,
300 };

◆ Ip6ConversionError

enum class mtcore::Ip6ConversionError
strong

Error when converting from IPv6 to IPv4.

Enumerator
NOT_IP4 

Definition at line 45 of file ip.hpp.

◆ IpInitError

enum class mtcore::IpInitError
strong

Error when initializing an IP address.

Enumerator
INVALID_INPUT 

Definition at line 39 of file ip.hpp.

◆ Mt19937_64Error

enum class mtcore::Mt19937_64Error
strong

Errors that can happen when making a Mersenne Twister.

Enumerator
ALLOCATION_FAILED 
MT19937_BAD_INIT 

Definition at line 245 of file random.hpp.

◆ OstreamWriteErr

enum class mtcore::io::OstreamWriteErr
strong

Errors when writing to a slice.

Enumerator
OUT_OF_ROOM 

Definition at line 244 of file io/writer.hpp.

◆ PubSubSendBeforeGrowsError

Errors for when timed blocking publishing fails.

Enumerator
CHANNEL_CLOSED 
TIMEOUT 
PARTIAL_SEND 
ALLOCATION_FAILED 

Definition at line 92 of file pub_sub.hpp.

◆ PubSubSendBlockGrowErrors

Errors for when blocking publishing fails.

Enumerator
CHANNEL_CLOSED 
PARTIAL_SEND 
ALLOCATION_FAILED 

Definition at line 85 of file pub_sub.hpp.

◆ PubSubTrySendGrowsError

Errors for when non-blocking publishing fails.

Enumerator
CHANNEL_CLOSED 
COULD_NOT_LOCK 
NO_ROOM 
PARTIAL_SEND 
ALLOCATION_FAILED 

Definition at line 99 of file pub_sub.hpp.

◆ RuneConversionError

enum class mtcore::RuneConversionError
strong

Errors that can occur when doing conversions to a rune.

Enumerator
NoInput 
InvalidChars 

Definition at line 805 of file byte_endian.hpp.

◆ SelectErrors

enum class mtcore::thread::SelectErrors
strong

Errors for when a select statement fails SELECT_TIMEOUT and DEADLOCK_DETECTED are the only ones which will be bubbled up NOT_READY is an internal error to indicate loop continuation.

Enumerator
SELECT_TIMEOUT 
DEADLOCK_DETECTED 
NOT_READY 

Definition at line 33 of file select.hpp.

◆ SelectOptionErrors

Errors indicating control flow from a select option ATTEMPT_FAILED indicates to try the next option SKIP indicates to forever skip this option TIMEOUT indicates that a timeout error should be raised and select execution should stop.

Enumerator
ATTEMPT_FAILED 
SKIP 
TIMEOUT 

Definition at line 42 of file select.hpp.

◆ SliceReaderError

enum class mtcore::io::SliceReaderError
strong

Errors that can happen from the Slice Reader Note that these are all required by the Reader class as some methods there may allocate.

Enumerator
END_OF_FILE 
ALLOCATION_FAILED 
SIZE_EXCEEDED 

Definition at line 608 of file io/reader.hpp.

◆ SliceWriteError

enum class mtcore::io::SliceWriteError
strong

Errors when writing to a slice.

Enumerator
OUT_OF_ROOM 

Definition at line 228 of file io/writer.hpp.

228 {
229 OUT_OF_ROOM, // necessary for writers
230 };

◆ SubnetMaskError

enum class mtcore::SubnetMaskError
strong

Error when creating a subnet mask.

Enumerator
INVALID_SUBNET_ID 

Definition at line 121 of file ip.hpp.

121 {
123 };

◆ VoidWriteError

enum class mtcore::io::VoidWriteError
strong

Errors when writing to a slice.

Enumerator
OUT_OF_ROOM 

Definition at line 236 of file io/writer.hpp.

236 {
238 };