|
Sen API
Sen Libraries
|
Containers, adapters, and commonly used functions. More...
Classes | |
| class | sen::Duration |
| A time duration. More... | |
| struct | sen::ShouldBePassedByValue< Duration > |
| class | sen::Quantity< T, D > |
| CRTP class that wraps T to ensure it's value stays within a certain range. More... | |
| struct | sen::ShouldBePassedByValue< Quantity< T, D > > |
| class | sen::ScopeGuard< F > |
| Runs the function object F on destruction. More... | |
| struct | sen::SourceLocation |
| Represents a location in source code. More... | |
| class | sen::Span< T > |
| Contiguous view of elements of type T. Inspired by http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0122r7.pdf. More... | |
| class | sen::StaticVectorBase< T > |
| Base class for stack-based, exception-safe and resizable vector with fixed-capacity. More... | |
| class | sen::StaticVector< T, s > |
| Stack-based, exception-free and resizable vector with fixed-capacity. More... | |
| class | sen::StrongTypeBase< T > |
| Wraps T to make it a strong type. More... | |
| struct | sen::ShouldBePassedByValue< StrongTypeBase< T > > |
| class | sen::StrongType< T, D > |
| CRTP class that wraps T to make it a strong type. More... | |
| class | sen::TimeStamp |
| A point in time. More... | |
| struct | sen::ShouldBePassedByValue< TimeStamp > |
| class | sen::Uuid |
| Universal Unique Identifier. More... | |
| class | sen::UuidRandomGenerator |
| struct | std::hash< sen::Uuid > |
Macros | |
| #define | SEN_RANGED_QUANTITY(class_name, value_type, min_value, max_value) |
| Use this macro to define types for values that shall stay within some [min, max] range. NOLINTNEXTLINE(cppcoreguidelines-macro-usage). | |
| #define | SEN_NON_RANGED_QUANTITY(class_name, value_type) |
| Use this macro to define types for quantities that specify no range NOLINTNEXTLINE(cppcoreguidelines-macro-usage). | |
| #define | SEN_SL() |
| Convenience macro including the source location info. NOLINTNEXTLINE(cppcoreguidelines-macro-usage). | |
| #define | SEN_VERSION_STRING "82f62a6\0" |
| #define | SEN_VERSION_MAJOR 0 |
| #define | SEN_VERSION_MINOR 0 |
| #define | SEN_VERSION_PATCH 0 |
Typedefs | |
| using | float32_t = float |
| using | float64_t = double |
| using | uchar_t = unsigned char |
| using | i8 = int8_t |
| using | u8 = uint8_t |
| using | i16 = int16_t |
| using | u16 = uint16_t |
| using | i32 = int32_t |
| using | u32 = uint32_t |
| using | i64 = int64_t |
| using | u64 = uint64_t |
| using | f32 = float32_t |
| using | f64 = float64_t |
Enumerations | |
| enum class | sen::StaticVectorError : std::uint8_t { sen::StaticVectorError::full , sen::StaticVectorError::badRange , sen::StaticVectorError::empty } |
| Things that can go wrong when using a StaticVector. More... | |
| enum class | sen::UuidVariant { sen::UuidVariant::ncs = 0 , sen::UuidVariant::rfc = 1 , sen::UuidVariant::microsoft = 2 , sen::UuidVariant::reserved = 3 } |
| Indicated by a bit pattern in octet 8, marked with N in xxxxxxxx-xxxx-xxxx-Nxxx-xxxxxxxxxxxx. More... | |
| enum class | sen::UuidVersion { sen::UuidVersion::none = 0 , sen::UuidVersion::timeBased = 1 , sen::UuidVersion::dceSecurity = 2 , sen::UuidVersion::nameBasedMd5 = 3 , sen::UuidVersion::randomNumberBased = 4 , sen::UuidVersion::nameBasedSha1 = 5 } |
| Indicated by a bit pattern in octet 6, marked with M in xxxxxxxx-xxxx-Mxxx-xxxx-xxxxxxxxxxxx. More... | |
Functions | |
| template<class F> | |
| auto | sen::makeScopeGuard (F &&f) |
| Makes scope guard from a callable taking no arguments. | |
| template<class F> | |
| sen::ScopeGuard (F) -> ScopeGuard< F > | |
| template<class F> | |
| auto | sen::makeScopeGuard (const F &&f)=delete |
| template<class F> | |
| auto | sen::makeScopeGuard (F &f)=delete |
| template<class F> | |
| auto | sen::makeScopeGuard (const F &f)=delete |
| template<typename T> | |
| constexpr bool | sen::operator== (const Span< T > &lhs, const Span< T > &rhs) noexcept |
| template<typename T> | |
| constexpr bool | sen::operator!= (const Span< T > &lhs, const Span< T > &rhs) noexcept |
| template<typename T> | |
| constexpr Span< T > | sen::makeSpan (T *ptr, std::size_t size) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. | |
| template<typename T, std::size_t n> | |
| constexpr Span< T > | sen::makeSpan (T(&arr)[n]) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. | |
| template<typename T> | |
| constexpr Span< T > | sen::makeSpan (T &val) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. | |
| template<typename Iterator, typename T = typename std::iterator_traits<Iterator>::value_type> | |
| constexpr Span< T > | sen::makeSpan (Iterator first, Iterator last) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. | |
| template<typename T> | |
| constexpr Span< T > | sen::makeSpan (std::vector< T > &vector) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. | |
| template<typename T, std::size_t s> | |
| constexpr Span< T > | sen::makeSpan (std::array< T, s > &array) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. | |
| template<typename T> | |
| constexpr Span< const T > | sen::makeConstSpan (const T *ptr, std::size_t size) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified. | |
| template<typename T, std::size_t n> | |
| constexpr Span< const T > | sen::makeConstSpan (const T(&arr)[n]) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified. | |
| template<typename Iterator, typename T = typename std::iterator_traits<Iterator>::value_type> | |
| constexpr Span< const T > | sen::makeConstSpan (Iterator first, Iterator last) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified. | |
| template<typename T> | |
| constexpr Span< const T > | sen::makeConstSpan (const std::vector< T > &vector) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified. | |
| template<typename T, std::size_t s> | |
| constexpr Span< const T > | sen::makeConstSpan (const std::array< T, s > &array) noexcept |
| Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified. | |
| template<typename T, std::size_t size> | |
| std::enable_if_t< HasOperator< T >::eq, bool > | sen::operator== (StaticVector< T, size > const &lhs, StaticVector< T, size > const &rhs) noexcept |
| Checks if the contents of lhs and rhs are equal, that is, they have the same number of elements and each element in lhs compares equal with the element in rhs at the same position. | |
| template<typename T, std::size_t size> | |
| std::enable_if_t< HasOperator< T >::ne, bool > | sen::operator!= (StaticVector< T, size > const &lhs, StaticVector< T, size > const &rhs) noexcept |
| Equivalent to negating operator ==. | |
| constexpr | sen::Uuid::Uuid () noexcept=default |
| constexpr | sen::Uuid::Uuid (uint64_t hi, uint64_t lo) noexcept |
| Construct it from two consecutive 64-bit integers. Does not validate the data. | |
| sen::Uuid::Uuid (Span< const uint8_t > bytes) noexcept | |
| Construct it from an array of bytes. Does not validate the data. | |
| sen::Uuid::~Uuid ()=default | |
| constexpr bool | sen::Uuid::isNil () const noexcept |
| True if all zeroes. | |
| constexpr UuidVariant | sen::Uuid::getVariant () const noexcept |
| The variant of the UUID according to the spec. | |
| constexpr UuidVersion | sen::Uuid::getVersion () const noexcept |
| The version of the UUID according to the spec. | |
| constexpr uint64_t | sen::Uuid::getHash () const noexcept |
| Computes a 64-bit hash of the UUID. | |
| constexpr uint32_t | sen::Uuid::getHash32 () const noexcept |
| Computes a 32-bit hash of the UUID. | |
| std::array< uint8_t, byteCount > | sen::Uuid::bytes () const noexcept |
| std::string | sen::Uuid::toString () const |
| Builds a string out of this UUID. | |
| bool | sen::Uuid::isValid (std::string_view s) noexcept |
| True if the UUID is well-formed. | |
| Uuid | sen::Uuid::fromString (std::string_view s) noexcept |
| Parses a string and generates a UUD. Returns a Nil UUID in case of error. | |
| void | sen::Uuid::copy (std::array< uint8_t, byteCount > &arr) const |
| Copy this std::array of bytes into the UUID. | |
| void | sen::Uuid::copy (StaticVector< uint8_t, byteCount > &vec) const |
| Copy this StaticVector of bytes into the UUID. | |
| void | sen::Uuid::swap (Uuid &other) noexcept |
| Swap the internal data. | |
| constexpr bool | sen::operator== (const Uuid &lhs, const Uuid &rhs) |
| constexpr bool | sen::operator!= (const Uuid &lhs, const Uuid &rhs) |
| constexpr bool | sen::operator< (const Uuid &lhs, const Uuid &rhs) |
| sen::UuidRandomGenerator::UuidRandomGenerator () | |
| sen::UuidRandomGenerator::UuidRandomGenerator (uint64_t seed) | |
| Uuid | sen::UuidRandomGenerator::operator() () |
| std::ostream & | sen::operator<< (std::ostream &s, const Uuid &id) |
| size_t | std::hash< sen::Uuid >::operator() (const sen::Uuid &uuid) const noexcept |
Variables | |
| static constexpr std::size_t | sen::Uuid::byteCount = 16 |
Friends | |
| constexpr bool | sen::Uuid::operator== (const Uuid &lhs, const Uuid &rhs) |
| constexpr bool | sen::Uuid::operator!= (const Uuid &lhs, const Uuid &rhs) |
| constexpr bool | sen::Uuid::operator< (const Uuid &lhs, const Uuid &rhs) |
Containers, adapters, and commonly used functions.
| struct sen::SourceLocation |
| #define SEN_RANGED_QUANTITY | ( | class_name, | |
| value_type, | |||
| min_value, | |||
| max_value ) |
Use this macro to define types for values that shall stay within some [min, max] range. NOLINTNEXTLINE(cppcoreguidelines-macro-usage).
| #define SEN_NON_RANGED_QUANTITY | ( | class_name, | |
| value_type ) |
Use this macro to define types for quantities that specify no range NOLINTNEXTLINE(cppcoreguidelines-macro-usage).
| #define SEN_SL | ( | ) |
Convenience macro including the source location info. NOLINTNEXTLINE(cppcoreguidelines-macro-usage).
| #define SEN_VERSION_STRING "82f62a6\0" |
| #define SEN_VERSION_MAJOR 0 |
| #define SEN_VERSION_MINOR 0 |
| #define SEN_VERSION_PATCH 0 |
| using float32_t = float |
| using float64_t = double |
| using uchar_t = unsigned char |
| using i8 = int8_t |
| using u8 = uint8_t |
| using i16 = int16_t |
| using u16 = uint16_t |
| using i32 = int32_t |
| using u32 = uint32_t |
| using i64 = int64_t |
| using u64 = uint64_t |
|
strong |
Things that can go wrong when using a StaticVector.
| Enumerator | |
|---|---|
| full | The vector cannot hold more elements. |
| badRange | The range is invalid. |
| empty | Invalid operation on an empty vector. |
|
strong |
|
strong |
Indicated by a bit pattern in octet 6, marked with M in xxxxxxxx-xxxx-Mxxx-xxxx-xxxxxxxxxxxx.
|
nodiscard |
Makes scope guard from a callable taking no arguments.
| sen::ScopeGuard | ( | F | ) | -> ScopeGuard< F > |
|
delete |
|
delete |
|
delete |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span.
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span.
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span.
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span.
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span.
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span.
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified.
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified.
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified.
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified.
|
nodiscardconstexprnoexcept |
Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified.
|
noexcept |
Checks if the contents of lhs and rhs are equal, that is, they have the same number of elements and each element in lhs compares equal with the element in rhs at the same position.
|
noexcept |
Equivalent to negating operator ==.
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
Construct it from two consecutive 64-bit integers. Does not validate the data.
|
inlineexplicitnoexcept |
Construct it from an array of bytes. Does not validate the data.
|
default |
|
inlinenodiscardconstexprnoexcept |
True if all zeroes.
|
nodiscardconstexprnoexcept |
The variant of the UUID according to the spec.
|
nodiscardconstexprnoexcept |
The version of the UUID according to the spec.
|
inlinenodiscardconstexprnoexcept |
Computes a 64-bit hash of the UUID.
|
nodiscardconstexprnoexcept |
Computes a 32-bit hash of the UUID.
|
inlinenodiscardnoexcept |
|
nodiscard |
Builds a string out of this UUID.
|
nodiscardnoexcept |
True if the UUID is well-formed.
|
nodiscardnoexcept |
Parses a string and generates a UUD. Returns a Nil UUID in case of error.
|
inline |
Copy this std::array of bytes into the UUID.
|
inline |
Copy this StaticVector of bytes into the UUID.
|
inlinenoexcept |
Swap the internal data.
|
inline |
|
inlineexplicit |
|
inline |
| std::ostream & sen::operator<< | ( | std::ostream & | s, |
| const Uuid & | id ) |
|
staticconstexpr |