Safe DDS
eprosima::safedds::memory Namespace Reference

Namespaces

 byte_array
 
 container
 

Classes

class  Bitmap
 Template StandardLayout structure to hold a range of items using a custom bitmap. More...
 
interface  IBaseBitmapSet
 Interface class with the common const methods of Bitmap. More...
 
interface  IByteArrayView
 IByteArrayView interface. More...
 
interface  IConstByteArrayView
 Provides a const interface on an existing memory block. More...
 
interface  IConstMutableByteArrayView
 Provides a const and mutable interface on an existing memory block. More...
 
interface  IContainerBase
 Container base interface. More...
 
interface  IList
 List-like data structure. More...
 
interface  IMap
 Map-like data structure. More...
 
interface  IMapBase
 Base methods for map-like container. More...
 
interface  IMutableByteArrayView
 Allows internal modifications on an existing IByteArrayView. More...
 
interface  IReferenceList
 List-like data structure of references. More...
 
interface  IReferenceMap
 Map-like data structure of references. More...
 
class  IRemovableBitmapSet
 Interface class with the remove method of Bitmap. More...
 
interface  ISet
 Set-like data structure. More...
 
interface  IStringView
 Provides a view on top of a string. More...
 

Functions

void * pointer_alignment (const void *ptr, const uint32_t required_alignment, uint32_t &bytes_moved) noexcept
 Gets a pointer and return the next aligned pointer given a required alignment. The function also returns the number of bytes moved as an output parameter. More...
 
uint32_t align_to (uint32_t v, uint32_t s) noexcept
 gets the aligned position for the current index and element size. More...
 
template<uint32_t T, uint32_t S>
constexpr uint32_t align_to () noexcept
 gets the aligned position for the current index and element size at build time More...
 
template<class T , uint32_t NLONGS>
bool operator== (const Bitmap< T, NLONGS > &first, const Bitmap< T, NLONGS > &second) noexcept
 Operator== for Bitmap objects. More...
 
template<class T , uint32_t NLONGS>
bool operator!= (const Bitmap< T, NLONGS > &first, const Bitmap< T, NLONGS > &second) noexcept
 Operator!= for Bitmap objects. More...
 
bool compare (const IStringView &lhs, const IStringView &rhs)
 Compare content of two IStringView. More...
 

Variables

constexpr uint32_t BITMAP_BIT_SIZE = 256U
 Default Bitmap bit size. More...
 
constexpr uint32_t BITMAP_LONG_SIZE = BITMAP_BIT_SIZE / portable::BITS_IN_LONG
 Default Bitmap long size. More...
 
constexpr uint32_t MAP_MAX_CAPACITY = UINT32_MAX
 Max capacity to return on implementations that do not have capacity limit. More...
 

Function Documentation

◆ align_to() [1/2]

template<uint32_t T, uint32_t S>
constexpr uint32_t eprosima::safedds::memory::align_to ( )
constexprnoexcept

gets the aligned position for the current index and element size at build time

Template Parameters
Tindex of the value.
Ssize, size MUST be power of 2.
Returns
Alignment.

◆ align_to() [2/2]

uint32_t eprosima::safedds::memory::align_to ( uint32_t  v,
uint32_t  s 
)
inlinenoexcept

gets the aligned position for the current index and element size.

Parameters
vindex of the value.
ssize, size MUST be power of 2.
Returns
Alignment.

◆ compare()

bool eprosima::safedds::memory::compare ( const IStringView lhs,
const IStringView rhs 
)
inline

Compare content of two IStringView.

Parameters
[in]lhsleft side string view.
[in]rhsright side string view.
Returns
true if both string are equals.

◆ operator!=()

template<class T , uint32_t NLONGS>
bool eprosima::safedds::memory::operator!= ( const Bitmap< T, NLONGS > &  first,
const Bitmap< T, NLONGS > &  second 
)
noexcept

Operator!= for Bitmap objects.

Parameters
firstfirst Bitmap to compare.
secondsecond Bitmap to compare.
Returns
True if Bitmap are different, false otherwise.

◆ operator==()

template<class T , uint32_t NLONGS>
bool eprosima::safedds::memory::operator== ( const Bitmap< T, NLONGS > &  first,
const Bitmap< T, NLONGS > &  second 
)
noexcept

Operator== for Bitmap objects.

Parameters
firstfirst Bitmap to compare.
secondsecond Bitmap to compare.
Returns
True if Bitmap are equal, false otherwise.

◆ pointer_alignment()

void* eprosima::safedds::memory::pointer_alignment ( const void *  ptr,
const uint32_t  required_alignment,
uint32_t &  bytes_moved 
)
inlinenoexcept

Gets a pointer and return the next aligned pointer given a required alignment. The function also returns the number of bytes moved as an output parameter.

Parameters
ptrpointer to align.
required_alignmentrequired alignment.
bytes_movedbytes moved.
Returns
Aligned pointer.

Variable Documentation

◆ BITMAP_BIT_SIZE

constexpr uint32_t eprosima::safedds::memory::BITMAP_BIT_SIZE = 256U
constexpr

Default Bitmap bit size.

◆ BITMAP_LONG_SIZE

constexpr uint32_t eprosima::safedds::memory::BITMAP_LONG_SIZE = BITMAP_BIT_SIZE / portable::BITS_IN_LONG
constexpr

Default Bitmap long size.

◆ MAP_MAX_CAPACITY

constexpr uint32_t eprosima::safedds::memory::MAP_MAX_CAPACITY = UINT32_MAX
constexpr

Max capacity to return on implementations that do not have capacity limit.