Offers advanced container types with unique approaches to stability and interprocess sharing. Besides standard helpers like buffer
and circular_buffer
, it includes innovative classes such as stable_interprocess_container
and stable_interprocess_map
. These support shared-memory usage, ensuring consistent serialization and robust data exchange across process boundaries or differing compiler environments.
More...
|
namespace | xpod |
| Provides a specialized variant type (xpod::type ) for simple data exchange, supporting integer, floating-point, boolean, pointers, and strings. This namespace is designed for compactness and serializability, letting you store fundamental data types in a variant structure. By including additional headers, the variant gains transparent serialization capabilities without sacrificing performance.
|
|
|
template<typename Key, typename Value, typename... VariantTypes> |
bool | key_exists (const std::map< std::variant< VariantTypes... >, Value > &t, const Key &key) |
| Checks if a std::map using std::variant as a key contains a specific key.
|
|
template<typename T, typename... Types> |
T | get_value_or_default (const std::variant< Types... > &value) noexcept |
|
template<std::size_t T, typename... Types> |
auto | get_value_or_default (const std::variant< Types... > &value) noexcept |
|
template<typename Key, typename Value> |
bool | operator== (const nested_map< Key, Value > &lhs, const nested_map< Key, Value > &rhs) |
|
template<typename T> |
std::shared_ptr< T > | make_shared_array (const size_t size) |
| Creates a std::shared_ptr that manages a dynamically allocated array of size size .
|
|
| TEST (CircularBuffer, TestDefaultConstructor) |
|
| TEST (CircularBuffer, TestPushBack) |
|
| TEST (CircularBuffer, TestEmplaceBack) |
|
| TEST (CircularBuffer, TestElementAccess) |
|
| TEST (CircularBuffer, TestBeginEnd) |
|
| TEST (CircularBuffer, TestClear) |
|
| TEST (CircularBuffer, TestOverflow) |
|
Offers advanced container types with unique approaches to stability and interprocess sharing. Besides standard helpers like buffer
and circular_buffer
, it includes innovative classes such as stable_interprocess_container
and stable_interprocess_map
. These support shared-memory usage, ensuring consistent serialization and robust data exchange across process boundaries or differing compiler environments.
◆ get_value_or_default() [1/2]
template<typename T, typename... Types>
T cbeam::container::get_value_or_default |
( |
const std::variant< Types... > & | value | ) |
|
|
noexcept |
Returns the value of type T in the std::variant, if it is available, otherwise the default value of T
- Template Parameters
-
T | the type that shall be retrieved from the given std::variant instance |
Types | the types of the std::variant value |
- Parameters
-
value | the std::variant to read from |
- Returns
- If the value at type index T in the std::variant instance does exist, returns it, otherwise (if its does not exist or the type is not available in the std::variant) the default value of the corresponding type.
◆ get_value_or_default() [2/2]
template<std::size_t T, typename... Types>
auto cbeam::container::get_value_or_default |
( |
const std::variant< Types... > & | value | ) |
|
|
noexcept |
Returns the value at type index T of the given std::variant instance. If the value is not set in the std::variant or T is a type index that is not available in the std::variant instance, the default value of the corresponding type will be returned.
- Template Parameters
-
T | the type index to be accessed in the value |
Types | the types of the std::variant value |
- Parameters
-
value | the std::variant to read from |
- Returns
- if the value at type index T in the std::variant instance does exist, returns it, otherwise (if its does not exist or the type index is not available in the std::variant) the default value of the corresponding type.
◆ key_exists()
template<typename Key, typename Value, typename... VariantTypes>
bool cbeam::container::key_exists |
( |
const std::map< std::variant< VariantTypes... >, Value > & | t, |
|
|
const Key & | key ) |
Checks if a std::map using std::variant as a key contains a specific key.
This function searches a std::map whose keys are comprised of a std::variant of different types, determining whether a specific key is present. It is generic and can be used for any combination of variants and keys.
- Template Parameters
-
Key | The type of the key being searched. Must be one of the VariantTypes. |
Value | The value type of the std::map, which is irrelevant for this function. |
VariantTypes | The types of the std::variant used as the key type for the std::map. |
- Parameters
-
t | The std::map to be searched. |
key | The key to be searched for in t. |
- Returns
- true if t contains a key-value pair with the given key, otherwise false.
◆ make_shared_array()
template<typename T>
std::shared_ptr< T > cbeam::container::make_shared_array |
( |
const size_t | size | ) |
|
|
inline |
Creates a std::shared_ptr
that manages a dynamically allocated array of size size
.
This function returns a std::shared_ptr<T>
that holds an array of type T
. The custom deleter ensures the array is deleted with delete[]
.
- Template Parameters
-
- Parameters
-
size | The number of elements in the array. |
- Returns
- std::shared_ptr<T> A smart pointer to a dynamically allocated array.
◆ operator==()
template<typename Key, typename Value>
bool cbeam::container::operator== |
( |
const nested_map< Key, Value > & | lhs, |
|
|
const nested_map< Key, Value > & | rhs ) |
|
inline |
◆ TEST() [1/7]
cbeam::container::TEST |
( |
CircularBuffer | , |
|
|
TestBeginEnd | ) |
◆ TEST() [2/7]
cbeam::container::TEST |
( |
CircularBuffer | , |
|
|
TestClear | ) |
◆ TEST() [3/7]
cbeam::container::TEST |
( |
CircularBuffer | , |
|
|
TestDefaultConstructor | ) |
◆ TEST() [4/7]
cbeam::container::TEST |
( |
CircularBuffer | , |
|
|
TestElementAccess | ) |
◆ TEST() [5/7]
cbeam::container::TEST |
( |
CircularBuffer | , |
|
|
TestEmplaceBack | ) |
◆ TEST() [6/7]
cbeam::container::TEST |
( |
CircularBuffer | , |
|
|
TestOverflow | ) |
◆ TEST() [7/7]
cbeam::container::TEST |
( |
CircularBuffer | , |
|
|
TestPushBack | ) |