Skip to content

iox::cxx🔗

Namespaces🔗

Name
iox::cxx::internal

Classes🔗

Name
struct iox::cxx::add_const_conditionally
Conditionally add const to type T if C has the const qualifier.
struct iox::cxx::add_const_conditionally< T, const C >
struct iox::cxx::BestFittingType
get the best fitting unsigned integer type for a given value at compile time
class iox::cxx::ConstMethodCallback
class iox::cxx::convert
Collection of static methods for conversion from and to string.
class iox::cxx::DeadlineTimer
This offers the deadline timer functionality. It has user convenient methods to reset the timer [by default it uses the intialized duration], reset timer to a customized duration, check if the timer is active and user can also get to know about the remaining time before the timer goes off.
struct iox::cxx::error
helper struct to create an expected which is signalling an error more easily
class iox::cxx::expected< ErrorType >
expected implementation from the C++20 proposal with C++11. The interface is inspired by the proposal but it has changes since we are not allowed to throw an exception.
class iox::cxx::expected< ValueType, ErrorType >
specialization of the expected class which can contain an error as well as a success value
class iox::cxx::expected< void, ErrorType >
class iox::cxx::forward_list
C++11 compatible uni-directional forward list implementation.
class iox::cxx::function_ref
class iox::cxx::function_ref< ReturnType(ArgTypes...)>
cxx::function_ref is a non-owning reference to a callable.
class iox::cxx::GenericRAII
The GenericRAII class is a simple helper class to apply the C++ RAII idiom quickly. You set 2 functions, one which is called in the constructor and another function is called in the destructor which can be useful when handling resources.
struct iox::cxx::greater_or_equal
struct iox::cxx::in_place_index
helper struct to perform an emplacement at a predefined index in the constructor of a variant
struct iox::cxx::in_place_t
helper struct which is used to call the in-place-construction constructor
struct iox::cxx::in_place_type
helper struct to perform an emplacement of a predefined type in in the constructor of a variant
struct iox::cxx::is_function_pointer
Check whether T is a function pointer with arbitrary signature.
struct iox::cxx::is_function_pointer< ReturnType(*)(ArgTypes...)>
struct iox::cxx::is_invocable
Verifies whether the passed Callable type is in fact invocable with the given arguments.
struct iox::cxx::is_invocable_r
Verifies whether the passed Callable type is in fact invocable with the given arguments and the result of the invocation is convertible to ReturnType.
class iox::cxx::list
C++11 compatible bi-directional list implementation.
class iox::cxx::MethodCallback
class iox::cxx::NewType
Implementation of the haskell NewType pattern: https://wiki.haskell.org/Newtype Lets say you would like to have an index which is in the end an integer but with certain restraints. The users should be forced to set it when they are creating it but afterwards it should be immutable. You would like to be able to compare the type as well as to sort it so that it can be stored in a map for instance. An example could be that you would like to have an index class with those properties and some additional methods. Then you can inherit from NewType and add your methods.
struct iox::cxx::not_null
struct iox::cxx::nullopt_t
Helper struct which is used to signal an empty optional. It is equivalent to no value.
class iox::cxx::optional
Optional implementation from the C++17 standard with C++11. The interface is analog to the C++17 standard and it can be used in factory functions which can fail.
class iox::cxx::PoorMansHeap
Reserves space on stack for placement new instatiation.
class iox::cxx::PoorMansHeapType
This is a proxy which must be used for the non default PoorMansHeap ctor.
struct iox::cxx::range
class iox::cxx::Serialization
Simple serializer which serials every given type into the following format: (The type needs to be convertable into a string via cxx::convert::toString) LENGTH:DATALENGTH:DATA... Example: Serializes "hello", 123, 123.01 into 5:hello3:1236:123.01.
class iox::cxx::stack
stack implementation with a simple push pop interface
class iox::cxx::string
string implementation with some adjustments in the API, because we are not allowed to throw exceptions or use heap.
struct iox::cxx::success
helper struct to create an expected which is signalling success more easily
struct iox::cxx::success< void >
helper struct to create an error only expected which is signalling success more easily
struct iox::cxx::TruncateToCapacity_t
struct used to define a compile time variable which is used to distinguish between constructors with certain behavior
class iox::cxx::unique_ptr
The unique_ptr class is a heap-less unique ptr implementation, unlike the STL.
class iox::cxx::variant
Variant implementation from the C++17 standard with C++11. The interface is inspired by the C++17 standard but it has changes in get and emplace since we are not allowed to throw exceptions.
class iox::cxx::VariantQueue
wrapper of multiple fifo's
class iox::cxx::vector
C++11 compatible vector implementation. We needed to do some adjustments in the API since we do not use exceptions and we require a data structure which can be located fully in the shared memory.

Types🔗

Name
enum uint64_t perms { none = 0, owner_read = 0400, owner_write = 0200, owner_exec = 0100, owner_all = 0700, group_read = 040, group_write = 020, group_exec = 010, group_all = 070, others_read = 04, others_write = 02, others_exec = 01, others_all = 07, all = 0777, set_uid = 04000, set_gid = 02000, sticky_bit = 01000, mask = 07777, unknown = 0xFFFF}
this enum class implements the filesystem perms feature of C++17. The API is identical to the C++17 one so that the class can be removed as soon as iceoryx switches to C++17. The enum satisfies also all requirements of the BitmaskType, this means the operators |, &, ^, ~, |=, &= and ^= are implemented as free functions as C++17 requires it.
enum MethodCallbackError { UNINITIALIZED_CALLBACK}
enum uint64_t VariantQueueTypes { FiFo_SingleProducerSingleConsumer = 0, SoFi_SingleProducerSingleConsumer = 1, FiFo_MultiProducerSingleConsumer = 2, SoFi_MultiProducerSingleConsumer = 3}
list of the supported underlying queue types
template <typename Signature ,uint64_t Capacity =128U>
using storable_function< static_storage< Capacity >, Signature >
function
A static memory replacement for std::function Allows storing a callable with a given signature if its size does not exceed a limit. This limit can be adjusted by changing the Bytes parameter. In contrast to cxx::function_ref cxx::function objects own everything needed to invoke the underlying callable and can be safely stored. They also support copy and move semantics in natural way by copying or moving the underlying callable.
template <typename Derived ,typename ValueType ,typename ErrorType >
using internal::FunctionalInterfaceImpl< Derived, ValueType, ErrorType >
FunctionalInterface
Provides a functional interface for types which have a bool conversion operator. This provides the methods.
template <uint64_t Value>
using typename BestFittingType< Value >::Type_t
BestFittingType_t
template <typename T ,typename C >
using typename add_const_conditionally< T, C >::type
add_const_conditionally_t
Helper type for add_const_conditionally which adds const to type T if C has the const qualifier.
template <typename C ,typename... Cargs>
using std::result_of< C(Cargs...)>
invoke_result
template <typename... >
using void
void_t
Maps a sequence of any types to the type void.
using uint8_t byte_t

Functions🔗

Name
perms **[operator
perms operator&(const perms & lhs, const perms & rhs)
Implements the binary and operation.
perms operator^(const perms & lhs, const perms & rhs)
Implements the binary exclusive or operation.
perms operator~(const perms & value)
Implements the binary complement operation.
perms **[operator
perms operator&=(perms & lhs, const perms & rhs)
Implements the binary and assignment operation.
perms operator^=(perms & lhs, const perms & rhs)
Implements the binary exclusive or assignment operation.
template <typename StreamType >
StreamType &
operator<<(StreamType & stream, perms value)
The streaming operator for the perms enum. It handles the enum as if it was a bitset and always lists the values for owner, group, others, special bits.
template <typename T >
T
align(const T value, const T alignment)
void * alignedAlloc(const uint64_t alignment, const uint64_t size)
allocates aligned memory which can only be free'd by alignedFree
void alignedFree(void *const memory)
frees aligned memory allocated with alignedAlloc
template <size_t s =0>
constexpr size_t
maxAlignment()
template recursion stopper for maximum alignment calculation
template <typename T ,typename... Args>
constexpr size_t
maxAlignment()
calculate maximum alignment of supplied types
template <size_t s =0>
constexpr size_t
maxSize()
template recursion stopper for maximum size calculation
template <typename T ,typename... Args>
constexpr size_t
maxSize()
calculate maximum size of supplied types
template <typename T ,typename Enumeration >
const char *
convertEnumToString(T port, const Enumeration source)
Convert Enum class type to string.
template <typename enum_type >
auto
enumTypeAsUnderlyingType(enum_type const value)
cast an enum to its underlying type
template <typename Container ,typename Functor >
void
forEach(Container & c, const Functor & f)
template <uint64_t SizeValue>
constexpr uint64_t
strlen2(char const(&)[SizeValue])
Get the size of a string represented by a char array at compile time.
constexpr bool isCompiledOn32BitSystem()
Returns info whether called on a 32-bit system.
template <typename T >
constexpr bool
isPowerOfTwo(const T n)
Checks if an unsigned integer is a power of two.
template <uint64_t StringCapacity>
bool
isValidFileName(const string< StringCapacity > & name)
checks if the given string is a valid filename
template <uint64_t StringCapacity>
bool
isValidFilePath(const string< StringCapacity > & name)
verifies if the given string is a valid path to a file
template <typename F ,typename T >
constexpr T
from(const F value)
Converts a value of type F to a corresponding value of type T. This function needs to be specialized by the user for the types to be converted.
template <typename T ,typename F >
constexpr T
into(const F value)
Converts a value of type F to a corresponding value of type T. This is a convenience function which is automatically available when from is implemented. This function shall therefore not be specialized but always the from function.
template <typename OptionalBaseType ,typename... Targs>
optional< OptionalBaseType >
make_optional(Targs &&... args)
Creates an optional which contains a value by forwarding the arguments to the constructor of T.
template <typename T ,typename... CTorArgs>
GenericRAII
makeScopedStatic(T & memory, CTorArgs &&... ctorArgs)
template <typename T1 ,typename T2 >
std::enable_if<(internal::IsCharArray< T1 >::value
template <typename T1 ,typename T2 ,typename... Targs>
std::enable_if<(internal::IsCharArray< T1 >::value
template <uint64_t Capacity>
bool
operator==(const std::string & lhs, const string< Capacity > & rhs)
checks if a rhs fixed string is equal to a lhs std::string
template <uint64_t Capacity>
bool
operator==(const string< Capacity > & lhs, const std::string & rhs)
checks if a rhs std::string is equal to a lhs fixed string
template <uint64_t Capacity>
bool
operator!=(const std::string & lhs, const string< Capacity > & rhs)
checks if a rhs fixed string is not equal to a lhs std::string
template <uint64_t Capacity>
bool
operator!=(const string< Capacity > & lhs, const std::string & rhs)
checks if a rhs std::string is not equal to a lhs fixed string
template <uint64_t Capacity>
bool
operator==(const char const lhs, const string< Capacity > & rhs)
The equality operator for char pointer and fixed string is disabled via a static_assert, because it may lead to undefined behavior if the char array is not null-terminated. Please convert the char array to a fixed string with string(TruncateToCapacity_t, const char
const other, const uint64_t count) before compare it to a fixed string.
template <uint64_t Capacity>
bool
operator!=(const char const lhs, const string< Capacity > & rhs)
The inequality operator for char pointer and fixed string is disabled via a static_assert, because it may lead to undefined behavior if the char array is not null-terminated. Please convert the char array to a fixed string with string(TruncateToCapacity_t, const char
const other, const uint64_t count) before compare it to a fixed string.
template <uint64_t Capacity>
std::ostream &
operator<<(std::ostream & stream, const string< Capacity > & str)
outputs the fixed string on stream
template <typename T ,typename... Types>
constexpr bool
holds_alternative(const variant< Types... > & variant)
returns true if the variant holds a given type T, otherwise false

Attributes🔗

Name
class IOX_NO_DISCARD expected
constexpr nullopt_t nullopt
constexpr in_place_t in_place
std::enable_if<(internal::IsCharArray< T1 >::value &&internal::IsCxxString< T2 >::value)
constexpr TruncateToCapacity_t TruncateToCapacity
constexpr bool always_false_v
Helper value to bind a static_assert to a type.
constexpr uint64_t INVALID_VARIANT_INDEX
value which an invalid variant index occupies

Types Documentation🔗

enum perms🔗

Enumerator Value Description
none 0 Deny everything.
owner_read 0400 owner has read permission
owner_write 0200 owner has write permission
owner_exec 0100 owner has execution permission
owner_all 0700 owner has all permissions
group_read 040 group has read permission
group_write 020 group has write permission
group_exec 010 group has execution permission
group_all 070 group has all permissions
others_read 04 others have read permission
others_write 02 others have write permission
others_exec 01 others have execution permission
others_all 07 others have all permissions
all 0777 all permissions for everyone
set_uid 04000 set uid bit
set_gid 02000 set gid bit
sticky_bit 01000 set sticky bit
mask 07777 all permissions for everyone as well as uid, gid and sticky bit
unknown 0xFFFF unknown permissions

this enum class implements the filesystem perms feature of C++17. The API is identical to the C++17 one so that the class can be removed as soon as iceoryx switches to C++17. The enum satisfies also all requirements of the BitmaskType, this means the operators |, &, ^, ~, |=, &= and ^= are implemented as free functions as C++17 requires it.

enum MethodCallbackError🔗

Enumerator Value Description
UNINITIALIZED_CALLBACK

enum VariantQueueTypes🔗

Enumerator Value Description
FiFo_SingleProducerSingleConsumer 0
SoFi_SingleProducerSingleConsumer 1
FiFo_MultiProducerSingleConsumer 2
SoFi_MultiProducerSingleConsumer 3

list of the supported underlying queue types

Note: if a new queue type is added the following steps have to be performed:

  1. add queue type here
  2. add queue type in m_fifo data member variant type
  3. increase numberOfQueueTypes in test_cxx_variant_queue test

using function🔗

template <typename Signature ,
uint64_t Capacity =128U>
using iox::cxx::function = typedef storable_function<static_storage<Capacity>, Signature>;

A static memory replacement for std::function Allows storing a callable with a given signature if its size does not exceed a limit. This limit can be adjusted by changing the Bytes parameter. In contrast to cxx::function_ref cxx::function objects own everything needed to invoke the underlying callable and can be safely stored. They also support copy and move semantics in natural way by copying or moving the underlying callable.

Template Parameters:

  • Signature The signature of the callable to be stored, e.g. int (char, void*).
  • Capacity The static storage capacity available to store a callable in bytes.

Note: If the static storage is insufficient to store the callable we get a compile time error.

Similarly to std::function, they cannot be stored in Shared Memory to be invoked in a different process.

For the API see storable_function.

using FunctionalInterface🔗

template <typename Derived ,
typename ValueType ,
typename ErrorType >
using iox::cxx::FunctionalInterface = typedef internal::FunctionalInterfaceImpl<Derived, ValueType, ErrorType>;

Provides a functional interface for types which have a bool conversion operator. This provides the methods.

Note: When inheriting from this type one does not have to write additional unit tests. Instead add a factory for your class to test_cxx_functional_interface_types.hpp, add the type to the FunctionalInterfaceImplementations and all typed tests will be generated.

  • and_then
  • or_else
  • expect When the class has a value method the method
  • value_or is added and and_then provides a reference in the callback to the underlying value. When the class has a get_error method the or_else method has a parameter to access a reference to the underlying error.

using BestFittingType_t🔗

template <uint64_t Value>
using iox::cxx::BestFittingType_t = typedef typename BestFittingType<Value>::Type_t;

using add_const_conditionally_t🔗

template <typename T ,
typename C >
using iox::cxx::add_const_conditionally_t = typedef typename add_const_conditionally<T, C>::type;

Helper type for add_const_conditionally which adds const to type T if C has the const qualifier.

using invoke_result🔗

template <typename C ,
typename... Cargs>
using iox::cxx::invoke_result = typedef std::result_of<C(Cargs...)>;

using void_t🔗

template <typename... >
using iox::cxx::void_t = typedef void;

Maps a sequence of any types to the type void.

using byte_t🔗

using iox::cxx::byte_t = typedef uint8_t;

Functions Documentation🔗

function operator|🔗

perms operator|(
    const perms & lhs,
    const perms & rhs
)

Implements the binary or operation.

Parameters:

  • lhs left hand side of the operation
  • rhs right hand side of the operation

Return: lhs | rhs

function operator&🔗

perms operator&(
    const perms & lhs,
    const perms & rhs
)

Implements the binary and operation.

Parameters:

  • lhs left hand side of the operation
  • rhs right hand side of the operation

Return: lhs & rhs

function operator^🔗

perms operator^(
    const perms & lhs,
    const perms & rhs
)

Implements the binary exclusive or operation.

Parameters:

  • lhs left hand side of the operation
  • rhs right hand side of the operation

Return: lhs ^ rhs

function operator~🔗

perms operator~(
    const perms & value
)

Implements the binary complement operation.

Parameters:

  • value the value used for the operation

Return: ~value

function operator|=🔗

perms operator|=(
    perms & lhs,
    const perms & rhs
)

Implements the binary or assignment operation.

Parameters:

  • lhs left hand side of the operation
  • rhs right hand side of the operation

Return: lhs = lhs | rhs

function operator&=🔗

perms operator&=(
    perms & lhs,
    const perms & rhs
)

Implements the binary and assignment operation.

Parameters:

  • lhs left hand side of the operation
  • rhs right hand side of the operation

Return: lhs = lhs & rhs

function operator^=🔗

perms operator^=(
    perms & lhs,
    const perms & rhs
)

Implements the binary exclusive or assignment operation.

Parameters:

  • lhs left hand side of the operation
  • rhs right hand side of the operation

Return: lhs = lhs ^ rhs

function operator<<🔗

template <typename StreamType >
StreamType & operator<<(
    StreamType & stream,
    perms value
)

The streaming operator for the perms enum. It handles the enum as if it was a bitset and always lists the values for owner, group, others, special bits.

Parameters:

  • stream reference to the stream
  • value the file permission

Return: the reference to the stream

function align🔗

template <typename T >
T align(
    const T value,
    const T alignment
)

function alignedAlloc🔗

void * alignedAlloc(
    const uint64_t alignment,
    const uint64_t size
)

allocates aligned memory which can only be free'd by alignedFree

Parameters:

  • alignmentalignment of the memory
  • sizememory size

Return: void pointer to the aligned memory

function alignedFree🔗

void alignedFree(
    void *const memory
)

frees aligned memory allocated with alignedAlloc

Parameters:

  • memorypointer to the aligned memory

function maxAlignment🔗

template <size_t s =0>
constexpr size_t maxAlignment()

template recursion stopper for maximum alignment calculation

function maxAlignment🔗

template <typename T ,
typename... Args>
constexpr size_t maxAlignment()

calculate maximum alignment of supplied types

function maxSize🔗

template <size_t s =0>
constexpr size_t maxSize()

template recursion stopper for maximum size calculation

function maxSize🔗

template <typename T ,
typename... Args>
constexpr size_t maxSize()

calculate maximum size of supplied types

function convertEnumToString🔗

template <typename T ,
typename Enumeration >
const char * convertEnumToString(
    T port,
    const Enumeration source
)

Convert Enum class type to string.

function enumTypeAsUnderlyingType🔗

template <typename enum_type >
auto enumTypeAsUnderlyingType(
    enum_type const value
)

cast an enum to its underlying type

function forEach🔗

template <typename Container ,
typename Functor >
void forEach(
    Container & c,
    const Functor & f
)

Template Parameters:


calls a given functor for every element in a given container

function strlen2🔗

template <uint64_t SizeValue>
static constexpr uint64_t strlen2(
    char  const(&)[SizeValue]
)

Get the size of a string represented by a char array at compile time.

Parameters:

  • The actual content of the char array is not of interest. Its just the size of the array that matters.

Template Parameters:

  • The size of the char array filled out by the compiler.

Return: Returns the size of a char array at compile time.

function isCompiledOn32BitSystem🔗

constexpr bool isCompiledOn32BitSystem()

Returns info whether called on a 32-bit system.

Return: True if called on 32-bit, false if not 32-bit system

function isPowerOfTwo🔗

template <typename T >
constexpr bool isPowerOfTwo(
    const T n
)

Checks if an unsigned integer is a power of two.

Return: true if power of two, otherwise false

function isValidFileName🔗

template <uint64_t StringCapacity>
bool isValidFileName(
    const string< StringCapacity > & name
)

checks if the given string is a valid filename

Return: true if the string is a filename, otherwise false

function isValidFilePath🔗

template <uint64_t StringCapacity>
bool isValidFilePath(
    const string< StringCapacity > & name
)

verifies if the given string is a valid path to a file

Return: true if the string is a path to a file, otherwise false

function from🔗

template <typename F ,
typename T >
constexpr T from(
    const F value
)

Converts a value of type F to a corresponding value of type T. This function needs to be specialized by the user for the types to be converted.

Parameters:

  • value of type F to convert to T

Template Parameters:

  • F is the 'from' type
  • T is the 'to' type

Return: converted value of F to corresponding value of T

enum class LowLevel
{
    FileDescriptorInvalid,
    FileDescriptorCorrupt,
    Timeout
};

enum class HighLevel
{
    FileDescriptorError,
    Timeout
};

namespace iox
{
namespace cxx
{
template <>
constexpr HighLevel from<LowLevel, HighLevel>(LowLevel e) noexcept
{
    switch (e)
    {
    case LowLevel::FileDescriptorCorrupt:
        return HighLevel::FileDescriptorError;
    case LowLevel::FileDescriptorInvalid:
        return HighLevel::FileDescriptorError;
    case LowLevel::Timeout:
        return HighLevel::Timeout;
    }
}
} // namespace cxx
} // namespace iox

function into🔗

template <typename T ,
typename F >
constexpr T into(
    const F value
)

Converts a value of type F to a corresponding value of type T. This is a convenience function which is automatically available when from is implemented. This function shall therefore not be specialized but always the from function.

Parameters:

  • value of type F to convert to T

Template Parameters:

  • T is the 'to' type
  • F is the 'from' type

Return: converted value of F to corresponding value of T

Bar b = iox::cxx::into<Bar>(Foo::ENUM_VALUE);

function make_optional🔗

template <typename OptionalBaseType ,
typename... Targs>
optional< OptionalBaseType > make_optional(
    Targs &&... args
)

Creates an optional which contains a value by forwarding the arguments to the constructor of T.

Parameters:

  • args arguments which will be perfectly forwarded to the constructor of T

Return: optional which contains T constructed with args

function makeScopedStatic🔗

template <typename T ,
typename... CTorArgs>
GenericRAII makeScopedStatic(
    T & memory,
    CTorArgs &&... ctorArgs
)

Parameters:

  • memory is a reference to a memory container, e.g. cxx::optional
  • ctorArgs ctor arguments for the object to construct

Template Parameters:

  • [in] T memory container which has emplace(...) and reset
  • [in] CTorArgs ctor types for the object to construct

Return: cxx::GenericRAII

Todo: better name create a GenericRAII object to cleanup a static optional object at the end of the scope

function concatenate🔗

template <typename T1 ,
typename T2 >
std::enable_if<(internal::IsCharArray< T1 >::value||internal::IsCxxString< T1 >::value) &&(internal::IsCharArray< T2 >::value||internal::IsCxxString< T2 >::value), string< internal::GetCapa< T1 >::capa+internal::GetCapa< T2 >::capa > >::type concatenate(
    const T1 & t1,
    const T2 & t2
)

concatenates two fixed strings/string literals

Parameters:

  • fixed strings/string literals to concatenate

Return: a new fixed string with capacity equal to the sum of the capacities of the concatenated strings

string<5> fuu("cdefg");
auto bar = iox::cxx::concatenate(fuu, "ahc");

function concatenate🔗

template <typename T1 ,
typename T2 ,
typename... Targs>
std::enable_if<(internal::IsCharArray< T1 >::value||internal::IsCxxString< T1 >::value) &&(internal::IsCharArray< T2 >::value||internal::IsCxxString< T2 >::value), string< internal::SumCapa< T1, T2, Targs... >::value > >::type concatenate(
    const T1 & t1,
    const T2 & t2,
    const Targs &... targs
)

concatenates an arbitrary number of fixed strings or string literals

Parameters:

  • fixed strings/string literals to concatenate

Return: a new fixed string with capacity equal to the sum of the capacities of the concatenated strings

string<4> fuu("cdef");
auto bar = iox::cxx::concatenate(fuu, "g", "ah", fuu);

function operator==🔗

template <uint64_t Capacity>
inline bool operator==(
    const std::string & lhs,
    const string< Capacity > & rhs
)

checks if a rhs fixed string is equal to a lhs std::string

Parameters:

  • lhs is the std::string
  • rhs is the fixed string

Return: true if both strings are equal, otherwise false

function operator==🔗

template <uint64_t Capacity>
inline bool operator==(
    const string< Capacity > & lhs,
    const std::string & rhs
)

checks if a rhs std::string is equal to a lhs fixed string

Parameters:

  • lhs is the fixed string
  • rhs is the std::string

Return: true if both strings are equal, otherwise false

function operator!=🔗

template <uint64_t Capacity>
inline bool operator!=(
    const std::string & lhs,
    const string< Capacity > & rhs
)

checks if a rhs fixed string is not equal to a lhs std::string

Parameters:

  • lhs is the std::string
  • rhs is the fixed string

Return: true if both strings are not equal, otherwise false

function operator!=🔗

template <uint64_t Capacity>
inline bool operator!=(
    const string< Capacity > & lhs,
    const std::string & rhs
)

checks if a rhs std::string is not equal to a lhs fixed string

Parameters:

  • lhs is the fixed string
  • rhs is the std::string

Return: true if both strings are not equal, otherwise false

function operator==🔗

template <uint64_t Capacity>
inline bool operator==(
    const char *const lhs,
    const string< Capacity > & rhs
)

The equality operator for char pointer and fixed string is disabled via a static_assert, because it may lead to undefined behavior if the char array is not null-terminated. Please convert the char array to a fixed string with string(TruncateToCapacity_t, const char* const other, const uint64_t count) before compare it to a fixed string.

Parameters:

  • lhs is the char pointer to the array to compare
  • rhs is the fixed string

Return: false

function operator!=🔗

template <uint64_t Capacity>
inline bool operator!=(
    const char *const lhs,
    const string< Capacity > & rhs
)

The inequality operator for char pointer and fixed string is disabled via a static_assert, because it may lead to undefined behavior if the char array is not null-terminated. Please convert the char array to a fixed string with string(TruncateToCapacity_t, const char* const other, const uint64_t count) before compare it to a fixed string.

Parameters:

  • lhs is the char pointer to the array to compare
  • rhs is the fixed string

Return: false

function operator<<🔗

template <uint64_t Capacity>
inline std::ostream & operator<<(
    std::ostream & stream,
    const string< Capacity > & str
)

outputs the fixed string on stream

Parameters:

  • stream is the output stream
  • str is the fixed string

Return: the stream output of the fixed string

function holds_alternative🔗

template <typename T ,
typename... Types>
constexpr bool holds_alternative(
    const variant< Types... > & variant
)

returns true if the variant holds a given type T, otherwise false

Attributes Documentation🔗

variable expected🔗

class IOX_NO_DISCARD expected;

variable nullopt🔗

constexpr nullopt_t nullopt = [nullopt_t](/v2.0.5/API-reference/hoofs/Classes/structiox_1_1cxx_1_1nullopt__t/)();

variable in_place🔗

constexpr in_place_t in_place {};

variable operator+🔗

std::enable_if<(internal::IsCharArray< T1 >::value &&internal::IsCxxString< T2 >::value)||(internal::IsCxxString< T1 >::value &&internal::IsCharArray< T2 >::value)||(internal::IsCxxString< T1 >::value &&internal::IsCxxString< T2 >::value), string< internal::GetCapa< T1 >::capa+internal::GetCapa< T2 >::capa > >::type operator+;

concatenates two fixed strings or one fixed fixed string and one string literal; concatenation of two string literals is not possible

Parameters:

  • fixed strings/string literal to concatenate

Return: a new fixed string with capacity equal to the sum of the capacities of the concatenated strings

variable TruncateToCapacity🔗

constexpr TruncateToCapacity_t TruncateToCapacity {};

variable always_false_v🔗

constexpr bool always_false_v = false;

Helper value to bind a static_assert to a type.

static_assert(always_false_v<Foo>, "Not implemented for the given type!");

variable INVALID_VARIANT_INDEX🔗

static constexpr uint64_t INVALID_VARIANT_INDEX = std::numeric_limits<uint64_t>::max();

value which an invalid variant index occupies

cxx::variant<int, float> someVariant;

// every unset variant has an invalid variant in the beginning
if ( someVariant.index() == INVALID_VARIANT_INDEX ) ...

cxx::variant<int, float> someVariant2(cxx::in_place_type<int>, 12);

// variant with setted value therefore the index is not invalid
if ( someVariant.index() != INVALID_VARIANT_INDEX ) ...

Updated on 18 December 2023 at 13:11:42 CET