Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions | Protected Member Functions
core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName > Class Template Reference

#include <setComponents.hpp>

Inheritance diagram for core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >:
[legend]

Public Member Functions

 SetComponent (SetComponentType data)
 
 SetComponent ()=default
 
bool add (ComponentType element)
 
Derived & add (SetComponentType data)
 
Derived & set (SetComponentType data)
 
SetComponentType & get ()
 
const SetComponentType & get () const
 
bool remove (const ComponentType &element)
 
Derived & remove (const SetComponentType &data)
 
bool empty () const
 
template<class AccessedComponentName >
requires std::is_same_v < AccessedComponentName, ComponentName >
const Component< Derived, SetComponentType, component::Set, ComponentName > & accessComponent () const
 
template<class AccessedComponentName >
requires std::is_same_v < AccessedComponentName, ComponentName > Component < Derived, SetComponentType, component::Set, ComponentName >
accessComponent ()
 

Protected Member Functions

void checkState ()
 

Detailed Description

template<class Derived, class SetComponentType, class ComponentType, class ComponentName>
class core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >

Represents a set of elements.

Parameters
Derivedclass representing datatype using this set.
ComponentTypeunderlying type of data in the set.
ComponentNamearbitrary type used to distinguish different components.

Constructor & Destructor Documentation

◆ SetComponent() [1/2]

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::SetComponent ( SetComponentType  data)
inline

Constructs a set containing given elements.

Exceptions
CommonExceptionif elements are not available in context of datatype where the set is used

◆ SetComponent() [2/2]

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::SetComponent ( )
default

Constructs a empty set.

Member Function Documentation

◆ accessComponent() [1/2]

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
template<class AccessedComponentName >
requires std::is_same_v < AccessedComponentName, ComponentName > Component < Derived, SetComponentType, component::Set, ComponentName >
& core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::accessComponent ( )
inline

Allows access to this sub-component using its name.

Parameters
AccessedComponentNametype used to distinguish different components
Returns
this

◆ accessComponent() [2/2]

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
template<class AccessedComponentName >
requires std::is_same_v < AccessedComponentName, ComponentName >
const Component< Derived, SetComponentType, component::Set, ComponentName > & core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::accessComponent ( ) const
inline

Allows access to this sub-component using its name.

Parameters
AccessedComponentNametype used to distinguish different components
Returns
this

◆ add() [1/2]

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
bool core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::add ( ComponentType  element)
inline

Adds an elements to the set.

Parameters
elementto add to the set
Exceptions
CommonExceptionif element is not available in context of datatype where the set is used
Returns
true if element was indeed added false if element was present in the set
Here is the caller graph for this function:

◆ add() [2/2]

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
Derived & core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::add ( SetComponentType  data)
inline

Adds a set of elements to the set.

Parameters
elementsto add to the set
Exceptions
CommonExceptionif one of the elements is not available in context of datatype where the set is used
Here is the call graph for this function:

◆ checkState()

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
void core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::checkState ( )
inlineprotected

Checks the state of the set.

◆ empty()

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
bool core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::empty ( ) const
inline

Component emptiness checker.

Returns
true if set is an empty

◆ get() [1/2]

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
SetComponentType & core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::get ( )
inline
Returns
the set.

◆ get() [2/2]

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
const SetComponentType & core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::get ( ) const
inline
Returns
the set.

◆ remove() [1/2]

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
bool core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::remove ( const ComponentType &  element)
inline

Removes an element from the set if not used.

Exceptions
CommonExceptionif element is used in context of datatype where the set is used
Returns
true if element was indeed removed false if element was not present in the set
Here is the caller graph for this function:

◆ remove() [2/2]

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
Derived & core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::remove ( const SetComponentType &  data)
inline

Removes a set of elements from alphabet if not used.

Exceptions
CommonExceptionif element is used in context of datatype where the set is used
Here is the call graph for this function:

◆ set()

template<class Derived , class SetComponentType , class ComponentType , class ComponentName >
Derived & core::SetComponent< Derived, SetComponentType, ComponentType, ComponentName >::set ( SetComponentType  data)
inline

Changes the set.

Parameters
elementsby which to replace those currently in the set
Exceptions
CommonExceptionif one of the removed elements is used in context of datatype where the set is used CommonException if one of the added elements is not available in context of datatype where the set is used
Here is the call graph for this function:

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