Loading...
Searching...
No Matches
idol::Object< T, CRTP > Class Template Reference

Description

template<class T, class CRTP>
class idol::Object< T, CRTP >

Definition at line 26 of file Object.h.

Public Methods

 Object (ObjectId< T > &&t_object_id)
 Object (const Object &)=default
 Object (Object &&) noexcept=default
Object & operator= (const Object &)=default
Object & operator= (Object &&) noexcept=default
const std::string & name () const
unsigned int id () const
bool is_in (const Model &t_model) const
template<class ValueT>
const ValueT & get (const Annotation< ValueT > &t_annotation) const
template<class ValueT, class ... ArgsT>
void set (const Annotation< ValueT > &t_annotation, ArgsT &&...t_args) const

Protected Methods

auto & versions ()
const auto & versions () const
template<class ... ArgsT>
void create_version (const Model &t_model, unsigned int t_index, ArgsT &&...t_args) const
void remove_version (const Model &t_model) const

Constructor & Destructor Documentation

◆ Object()

template<class T, class CRTP>
idol::Object< T, CRTP >::Object ( ObjectId< T > && t_object_id)
inlineexplicit

Definition at line 42 of file Object.h.

Methods Documentation

◆ create_version()

template<class T, class CRTP>
template<class ... ArgsT>
void idol::Object< T, CRTP >::create_version ( const Model & t_model,
unsigned int t_index,
ArgsT &&... t_args ) const
inlineprotected

Definition at line 34 of file Object.h.

◆ get()

template<class T, class CRTP>
template<class ValueT>
const ValueT & idol::Object< T, CRTP >::get ( const Annotation< ValueT > & t_annotation) const
inline

Returns the value of the given annotation t_annotation associated to the object.

If no value is found, the default value of the annotation is returned. If no default value was set, an exception is thrown.

Template Parameters
ValueTThe value type of the annotation.
Parameters
t_annotationThe annotation.
Returns
The value of the annotation.

Definition at line 78 of file Object.h.

◆ id()

template<class T, class CRTP>
unsigned int idol::Object< T, CRTP >::id ( ) const
inlinenodiscard

Returns the id of the optimization object.

Returns
The id of the optimization object.

Definition at line 60 of file Object.h.

◆ is_in()

template<class T, class CRTP>
bool idol::Object< T, CRTP >::is_in ( const Model & t_model) const
inlinenodiscard

Returns true if the optimization object is part of the model t_model, false otherwise.

Parameters
t_modelThe model.
Returns
True if the optimization object is part of the model t_model, false otherwise.

Definition at line 67 of file Object.h.

◆ name()

template<class T, class CRTP>
const std::string & idol::Object< T, CRTP >::name ( ) const
inlinenodiscard

Returns the name of the optimization object.

Returns
The name of the optimization object.

Definition at line 54 of file Object.h.

◆ remove_version()

template<class T, class CRTP>
void idol::Object< T, CRTP >::remove_version ( const Model & t_model) const
inlineprotected

Definition at line 38 of file Object.h.

◆ set()

template<class T, class CRTP>
template<class ValueT, class ... ArgsT>
void idol::Object< T, CRTP >::set ( const Annotation< ValueT > & t_annotation,
ArgsT &&... t_args ) const
inline

Sets the value of the given annotation t_annotation associated to the object.

Template Parameters
ValueTThe value type of the annotation.
ArgsTThe parameter pack types for constructing the value of the annotation.
Parameters
t_annotationThe annotation.
t_argsThe parameter pack arguments used to construct "in place" the value of the annotation.

Definition at line 96 of file Object.h.

◆ versions() [1/2]

template<class T, class CRTP>
auto & idol::Object< T, CRTP >::versions ( )
inlinenodiscardprotected

Definition at line 29 of file Object.h.

◆ versions() [2/2]

template<class T, class CRTP>
const auto & idol::Object< T, CRTP >::versions ( ) const
inlinenodiscardprotected

Definition at line 31 of file Object.h.