Safe DDS
eprosima::safedds::memory::container::PreallocSet< T > Class Template Reference

Set-like data structure. More...

#include <PreallocSet.hpp>

Public Member Functions

 PreallocSet (platform::IAllocator &allocator) noexcept
 Default constructor. More...
 
 PreallocSet (platform::IAllocator &allocator, const PreallocMemoryConfig &configuration) noexcept
 constructor. More...
 
bool init (const memory::container::PreallocMemoryConfig &config) noexcept
 Method required for 2 step initialization. More...
 
virtual ~PreallocSet () noexcept
 Virtual destructor. More...
 
 PreallocSet (const PreallocSet &) noexcept=delete
 Copy deleted. More...
 
 PreallocSet (PreallocSet &&) noexcept=delete
 Movement deleted. More...
 
PreallocSetoperator= (const PreallocSet &) noexcept=delete
 Copy operator delete. More...
 
PreallocSetoperator= (PreallocSet &&) noexcept=delete
 Movement operator delete due private references. More...
 
T * at (uint32_t pos) noexcept override
 Get element of given index. More...
 
const T * at (uint32_t pos) const noexcept override
 Get element of given index. More...
 
bool add (const T &value) noexcept override
 Push back a new element. More...
 
void remove (const T &value) noexcept override
 Remove element from the set. More...
 
bool find (const T &value) noexcept override
 Check if value is present on set. More...
 
uint32_t capacity () const noexcept override
 Max capacity of the container. More...
 
uint32_t size () const noexcept override
 Used size of the container. More...
 
void clear () noexcept override
 Remove all elements from the container. More...
 

Additional Inherited Members

- Protected Member Functions inherited from eprosima::safedds::memory::ISet< T >
 ~ISet () noexcept=default
 Protected destructor ownership defined on creation. More...
 
 ISet () noexcept=default
 Default creation. More...
 
 ISet (const ISet &) noexcept=default
 Default deleted. More...
 
 ISet (ISet &&) noexcept=default
 Default deleted. More...
 
ISetoperator= (const ISet &) noexcept=default
 Copy operator allowed. More...
 
ISetoperator= (ISet &&) noexcept=default
 Movement operator allowed. More...
 
- Protected Member Functions inherited from eprosima::safedds::memory::IContainerBase
 ~IContainerBase () noexcept=default
 Protected destructor ownership defined on creation. More...
 
 IContainerBase () noexcept=default
 Default creation. More...
 
 IContainerBase (const IContainerBase &) noexcept=default
 Copy allowed. More...
 
 IContainerBase (IContainerBase &&) noexcept=default
 Movement allowed. More...
 
IContainerBaseoperator= (const IContainerBase &) noexcept=default
 Copy operator deleted. More...
 
IContainerBaseoperator= (IContainerBase &&) noexcept=default
 Movement operator deleted. More...
 

Detailed Description

template<class T>
class eprosima::safedds::memory::container::PreallocSet< T >

Set-like data structure.

Constructor & Destructor Documentation

◆ PreallocSet() [1/4]

template<class T >
eprosima::safedds::memory::container::PreallocSet< T >::PreallocSet ( platform::IAllocator allocator)
inlineexplicitnoexcept

Default constructor.

Constructs a list with preallocated empty nodes.

Parameters
allocatorAllocator implementation.

◆ PreallocSet() [2/4]

template<class T >
eprosima::safedds::memory::container::PreallocSet< T >::PreallocSet ( platform::IAllocator allocator,
const PreallocMemoryConfig configuration 
)
inlinenoexcept

constructor.

Constructs a set with preallocated empty nodes.

Parameters
allocatorAllocator implementation.
configurationmemory configuration.

◆ ~PreallocSet()

template<class T >
virtual eprosima::safedds::memory::container::PreallocSet< T >::~PreallocSet ( )
inlinevirtualnoexcept

Virtual destructor.

◆ PreallocSet() [3/4]

template<class T >
eprosima::safedds::memory::container::PreallocSet< T >::PreallocSet ( const PreallocSet< T > &  )
deletenoexcept

Copy deleted.

◆ PreallocSet() [4/4]

template<class T >
eprosima::safedds::memory::container::PreallocSet< T >::PreallocSet ( PreallocSet< T > &&  )
deletenoexcept

Movement deleted.

Member Function Documentation

◆ add()

template<class T >
bool eprosima::safedds::memory::container::PreallocSet< T >::add ( const T &  value)
inlineoverridevirtualnoexcept

Push back a new element.

Parameters
valuevalue to add to the list.
Returns
true if OK.

Implements eprosima::safedds::memory::ISet< T >.

◆ at() [1/2]

template<class T >
const T* eprosima::safedds::memory::container::PreallocSet< T >::at ( uint32_t  pos) const
inlineoverridevirtualnoexcept

Get element of given index.

Parameters
posposition index.
Returns
const pointer to value, nullptr if element not set

Implements eprosima::safedds::memory::ISet< T >.

◆ at() [2/2]

template<class T >
T* eprosima::safedds::memory::container::PreallocSet< T >::at ( uint32_t  pos)
inlineoverridevirtualnoexcept

Get element of given index.

Parameters
posposition index.
Returns
pointer to value, nullptr if element not set

Implements eprosima::safedds::memory::ISet< T >.

◆ capacity()

template<class T >
uint32_t eprosima::safedds::memory::container::PreallocSet< T >::capacity ( ) const
inlineoverridevirtualnoexcept

Max capacity of the container.

Returns
uint32_t.

Implements eprosima::safedds::memory::IContainerBase.

◆ clear()

template<class T >
void eprosima::safedds::memory::container::PreallocSet< T >::clear ( )
inlineoverridevirtualnoexcept

Remove all elements from the container.

Implements eprosima::safedds::memory::IContainerBase.

◆ find()

template<class T >
bool eprosima::safedds::memory::container::PreallocSet< T >::find ( const T &  value)
inlineoverridevirtualnoexcept

Check if value is present on set.

Parameters
valuevalue to find.
Returns
true if V is on the set.

Implements eprosima::safedds::memory::ISet< T >.

◆ init()

template<class T >
bool eprosima::safedds::memory::container::PreallocSet< T >::init ( const memory::container::PreallocMemoryConfig config)
inlinenoexcept

Method required for 2 step initialization.

Parameters
configPreallocated memory configuration.
Returns
bool.

◆ operator=() [1/2]

template<class T >
PreallocSet& eprosima::safedds::memory::container::PreallocSet< T >::operator= ( const PreallocSet< T > &  )
deletenoexcept

Copy operator delete.

◆ operator=() [2/2]

template<class T >
PreallocSet& eprosima::safedds::memory::container::PreallocSet< T >::operator= ( PreallocSet< T > &&  )
deletenoexcept

Movement operator delete due private references.

◆ remove()

template<class T >
void eprosima::safedds::memory::container::PreallocSet< T >::remove ( const T &  value)
inlineoverridevirtualnoexcept

Remove element from the set.

Parameters
valuevalue to remove from set.

Implements eprosima::safedds::memory::ISet< T >.

◆ size()

template<class T >
uint32_t eprosima::safedds::memory::container::PreallocSet< T >::size ( ) const
inlineoverridevirtualnoexcept

Used size of the container.

Returns
uint32_t.

Implements eprosima::safedds::memory::IContainerBase.


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