Safe DDS
eprosima::safedds::memory::container::StaticSet< T, N > Class Template Reference

Set-like data structure. More...

#include <StaticSet.hpp>

Public Member Functions

 StaticSet () noexcept=default
 Default constructor. More...
 
virtual ~StaticSet () noexcept=default
 Virtual destructor. More...
 
 StaticSet (const StaticSet &) noexcept=delete
 Copy deleted. More...
 
 StaticSet (StaticSet &&) noexcept=delete
 Movement delete. More...
 
StaticSetoperator= (const StaticSet &) noexcept=delete
 Copy operator delete. More...
 
StaticSetoperator= (StaticSet &&) 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, uint32_t N>
class eprosima::safedds::memory::container::StaticSet< T, N >

Set-like data structure.

Constructor & Destructor Documentation

◆ StaticSet() [1/3]

template<class T , uint32_t N>
eprosima::safedds::memory::container::StaticSet< T, N >::StaticSet ( )
defaultnoexcept

Default constructor.

◆ ~StaticSet()

template<class T , uint32_t N>
virtual eprosima::safedds::memory::container::StaticSet< T, N >::~StaticSet ( )
virtualdefaultnoexcept

Virtual destructor.

◆ StaticSet() [2/3]

template<class T , uint32_t N>
eprosima::safedds::memory::container::StaticSet< T, N >::StaticSet ( const StaticSet< T, N > &  )
deletenoexcept

Copy deleted.

◆ StaticSet() [3/3]

template<class T , uint32_t N>
eprosima::safedds::memory::container::StaticSet< T, N >::StaticSet ( StaticSet< T, N > &&  )
deletenoexcept

Movement delete.

Member Function Documentation

◆ add()

template<class T , uint32_t N>
bool eprosima::safedds::memory::container::StaticSet< T, N >::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 , uint32_t N>
const T* eprosima::safedds::memory::container::StaticSet< T, N >::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 , uint32_t N>
T* eprosima::safedds::memory::container::StaticSet< T, N >::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 N>
uint32_t eprosima::safedds::memory::container::StaticSet< T, N >::capacity ( ) const
inlineoverridevirtualnoexcept

Max capacity of the container.

Returns
uint32_t.

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

◆ clear()

template<class T , uint32_t N>
void eprosima::safedds::memory::container::StaticSet< T, N >::clear ( )
inlineoverridevirtualnoexcept

Remove all elements from the container.

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

◆ find()

template<class T , uint32_t N>
bool eprosima::safedds::memory::container::StaticSet< T, N >::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 >.

◆ operator=() [1/2]

template<class T , uint32_t N>
StaticSet& eprosima::safedds::memory::container::StaticSet< T, N >::operator= ( const StaticSet< T, N > &  )
deletenoexcept

Copy operator delete.

◆ operator=() [2/2]

template<class T , uint32_t N>
StaticSet& eprosima::safedds::memory::container::StaticSet< T, N >::operator= ( StaticSet< T, N > &&  )
deletenoexcept

Movement operator delete due private references.

◆ remove()

template<class T , uint32_t N>
void eprosima::safedds::memory::container::StaticSet< T, N >::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 N>
uint32_t eprosima::safedds::memory::container::StaticSet< T, N >::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: