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

#include <components.hpp>

Public Member Functions

 Component (ComponentType element)
 
bool set (ComponentType element)
 
ComponentType & get ()
 
const ComponentType & get () const
 
template<class AccessedComponentName >
requires std::is_same_v < AccessedComponentName, ComponentName >
const Component< Derived, ComponentType, component::Value, ComponentName > & accessComponent () const
 
template<class AccessedComponentName >
requires std::is_same_v < AccessedComponentName, ComponentName > Component < Derived, ComponentType, component::Value, ComponentName >
accessComponent ()
 

Static Public Member Functions

static void registerComponent ()
 
static void unregisterComponent ()
 

Protected Member Functions

void checkState ()
 

Detailed Description

template<class Derived, class ComponentType, class ComponentName>
class core::Component< Derived, ComponentType, component::Value, ComponentName >

Represents an element.

Parameters
Derivedclass representing datatype using this set.
ComponentTypethe type of element.
ComponentNamearbitrary type used to distinguish different components.

Constructor & Destructor Documentation

◆ Component()

template<class Derived , class ComponentType , class ComponentName >
core::Component< Derived, ComponentType, component::Value, ComponentName >::Component ( ComponentType  element)
inline

Constructs a notable element.

Exceptions
CommonExceptionif element is not available in context of datatype where the class is used

Member Function Documentation

◆ accessComponent() [1/2]

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

Allows access to this sub-component using its name.

Parameters
AccessedComponentNametype used to distinguish different elements
Returns
this

◆ accessComponent() [2/2]

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

Allows access to this sub-component using its name.

Parameters
AccessedComponentNametype used to distinguish different elements
Returns
this

◆ checkState()

template<class Derived , class ComponentType , class ComponentName >
void core::Component< Derived, ComponentType, component::Value, ComponentName >::checkState ( )
inlineprotected

Checks the state of the element.

◆ get() [1/2]

template<class Derived , class ComponentType , class ComponentName >
ComponentType & core::Component< Derived, ComponentType, component::Value, ComponentName >::get ( )
inline

Returns the current notable element of ComponentName.

Returns
the notable element

◆ get() [2/2]

template<class Derived , class ComponentType , class ComponentName >
const ComponentType & core::Component< Derived, ComponentType, component::Value, ComponentName >::get ( ) const
inline

Returns the current notable element of ComponentName.

Returns
the notable element

◆ registerComponent()

template<class Derived , class ComponentType , class ComponentName >
static void core::Component< Derived, ComponentType, component::Value, ComponentName >::registerComponent ( )
inlinestatic

Register this component's accessors to abstraction

◆ set()

template<class Derived , class ComponentType , class ComponentName >
bool core::Component< Derived, ComponentType, component::Value, ComponentName >::set ( ComponentType  element)
inline

Changes the notable element.

Parameters
newvalue of the element
Returns
bool true if the element was set false if the element was the same as already present
Exceptions
CommonExceptionif the new element is not available in context of datatype where the class is used

◆ unregisterComponent()

template<class Derived , class ComponentType , class ComponentName >
static void core::Component< Derived, ComponentType, component::Value, ComponentName >::unregisterComponent ( )
inlinestatic

Register this component's accessors to abstraction


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