iceoryx2
C++ Language Bindings
Loading...
Searching...
No Matches
iox2::bb::Layout Class Reference

#include <layout.hpp>

Public Member Functions

auto size () const -> uint64_t
 Returns the stored size.
 
auto alignment () const -> uint64_t
 Returns the stored alignment.
 

Static Public Member Functions

template<typename T >
static auto from () -> std::enable_if_t<!std::is_same< T, void >::value, Layout >
 
template<typename T >
static auto from () -> std::enable_if_t< std::is_same< T, void >::value, Layout >
 Creates a new [Layout] with size == 0 and alignment == 1.
 
static auto create (uint64_t size, uint64_t align) -> iox2::bb::Expected< Layout, LayoutCreationError >
 

Detailed Description

Contains a valid [Layout], meaning the alignment is a power of two and the size is zero or a multiple of the alignment.

Definition at line 31 of file layout.hpp.

Member Function Documentation

◆ alignment()

auto iox2::bb::Layout::alignment ( ) const -> uint64_t
inline

Returns the stored alignment.

Definition at line 89 of file layout.hpp.

◆ create()

auto iox2::bb::Layout::create ( uint64_t  size,
uint64_t  align 
) -> iox2::bb::Expected<Layout, LayoutCreationError>
inlinestatic

Creates a new [Layout] from the given size and align.

  • If the size is not a multiple of align it will be rounded up so that it becomes a multiple of align.
  • If align is not a power of two it fails.

Definition at line 76 of file layout.hpp.

References iox2::bb::err(), iox2::bb::InvalidAlignment, and size().

◆ from() [1/2]

template<typename T >
static auto iox2::bb::Layout::from ( ) -> std::enable_if_t< std::is_same< T, void >::value, Layout >
static

Creates a new [Layout] with size == 0 and alignment == 1.

◆ from() [2/2]

template<typename T >
auto iox2::bb::Layout::from ( ) -> std::enable_if_t<!std::is_same<T, void>::value, Layout>
inlinestatic

Creates a new [Layout] from the provided type T by using sizeof(T) and alignof(T)

Definition at line 67 of file layout.hpp.

◆ size()

auto iox2::bb::Layout::size ( ) const -> uint64_t
inline

Returns the stored size.

Definition at line 85 of file layout.hpp.

Referenced by create().


The documentation for this class was generated from the following file: