NDEVR
API Documentation
Set< t_value >

Container that stores unique elements in no particular order, and which allow for fast retrieval or insertion of individual elements based on their value. More...

Inheritance diagram for Set< t_value >:
[legend]
Collaboration diagram for Set< t_value >:
[legend]

Public Member Functions

 Set ()
 Default constructor.
template<class t_type, class t_memory_manager>
 Set (const Buffer< t_type, t_memory_manager > &values)
 Constructs a Set from a Buffer, inserting all Buffer elements.
template<class t_iter>
 Set (const t_iter &begin, const t_iter &end)
 Constructs a Set from an iterator range.
template<class t_type>
 Set (std::initializer_list< t_type > l)
 Constructor that allows for an initializer list, allowing { and } to be used.
void add (const t_value &key)
 Inserts a value into the Set by const reference.
void add (t_value &&key)
 Inserts a value into the Set by move.
template<class t_add_type>
void addAll (const Buffer< t_add_type > &key)
 Inserts all elements from the given Buffer into the Set.
bool hasValue (const t_value &key) const
 Checks whether the Set contains the given value.
uint04 indexOf (const t_value &key) const
 Finds the iteration index of a value within the Set.
uint04 size () const
 Returns the number of elements in the Set.
template<class t_index_type = uint04, class t_memory_manager = BufferAllocator<t_value, DetermineAlignment<sizeof(t_value)>(), ObjectInfo<t_value>::Primitive, t_index_type, false>>
Buffer< t_value, t_memory_manager > values () const
 Returns all elements in the Set as a Buffer.

Detailed Description

template<class t_value>
class Set< t_value >

Container that stores unique elements in no particular order, and which allow for fast retrieval or insertion of individual elements based on their value.


See also
Buffer, Dictionary

Definition at line 58 of file Set.h.

Constructor & Destructor Documentation

◆ Set() [1/3]

template<class t_value>
Set< t_value >::Set ( )
inline

Default constructor.

Creates an empty Set.

Definition at line 64 of file Set.h.

◆ Set() [2/3]

template<class t_value>
template<class t_iter>
Set< t_value >::Set ( const t_iter & begin,
const t_iter & end )
inline

Constructs a Set from an iterator range.

Parameters
[in]beginIterator to the first element.
[in]endIterator past the last element.

Definition at line 73 of file Set.h.

◆ Set() [3/3]

template<class t_value>
template<class t_type, class t_memory_manager>
Set< t_value >::Set ( const Buffer< t_type, t_memory_manager > & values)
inline

Constructs a Set from a Buffer, inserting all Buffer elements.

Parameters
[in]valuesThe Buffer whose elements are inserted into the Set.

Definition at line 81 of file Set.h.

Member Function Documentation

◆ add() [1/2]

template<class t_value>
void Set< t_value >::add ( const t_value & key)
inline

Inserts a value into the Set by const reference.

Duplicates are ignored.

Parameters
[in]keyThe value to insert.

Definition at line 104 of file Set.h.

Referenced by Set< HyperGraphAction * >::addAll(), and GravityIntersection::FindGravityPoints().

◆ add() [2/2]

template<class t_value>
void Set< t_value >::add ( t_value && key)
inline

Inserts a value into the Set by move.

Duplicates are ignored.

Parameters
[in]keyThe value to move-insert.

Definition at line 112 of file Set.h.

◆ addAll()

template<class t_value>
template<class t_add_type>
void Set< t_value >::addAll ( const Buffer< t_add_type > & key)
inline

Inserts all elements from the given Buffer into the Set.

Parameters
[in]keyThe Buffer of values to insert.

Definition at line 121 of file Set.h.

◆ hasValue()

template<class t_value>
bool Set< t_value >::hasValue ( const t_value & key) const
inlinenodiscard

Checks whether the Set contains the given value.

Parameters
[in]keyThe value to search for.
Returns
True if the value exists in the Set, false otherwise.

Definition at line 96 of file Set.h.

Referenced by FactoryModelFilters::FilterGeometryModels(), and FactoryModelFilters::FilterGeometryModels().

◆ indexOf()

template<class t_value>
uint04 Set< t_value >::indexOf ( const t_value & key) const
inlinenodiscard

Finds the iteration index of a value within the Set.

Parameters
[in]keyThe value to search for.
Returns
The zero-based index of the value, or Constant<uint04>::Invalid if not found.

Definition at line 143 of file Set.h.

◆ size()

template<class t_value>
uint04 Set< t_value >::size ( ) const
inlinenodiscard

Returns the number of elements in the Set.

Returns
The element count as a uint04.

Definition at line 158 of file Set.h.

Referenced by SparseOptimizer::initializeOptimization(), SparseOptimizer::initializeOptimization(), OptimizableGraph::isSolverSuitable(), and Set< HyperGraphAction * >::values().

◆ values()

template<class t_value>
template<class t_index_type = uint04, class t_memory_manager = BufferAllocator<t_value, DetermineAlignment<sizeof(t_value)>(), ObjectInfo<t_value>::Primitive, t_index_type, false>>
Buffer< t_value, t_memory_manager > Set< t_value >::values ( ) const
inlinenodiscard

Returns all elements in the Set as a Buffer.

Returns
A Buffer containing all values currently stored in the Set.

Definition at line 131 of file Set.h.

Referenced by GravityIntersection::FindGravityPoints(), and Set< HyperGraphAction * >::values().


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