idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
idol::Object< T, CRTP > Class Template Reference
Inheritance diagram for idol::Object< T, CRTP >:
Inheritance graph
Collaboration diagram for idol::Object< T, CRTP >:
Collaboration graph

Public Member Functions

 Object (ObjectId< T > &&t_object_id)
 
 Object (const Object &)=default
 
 Object (Object &&) noexcept=default
 
Objectoperator= (const Object &)=default
 
Objectoperator= (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 Member Functions

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
 

Detailed Description

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

Definition at line 26 of file Object.h.

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.

Member Function 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
inline

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
inline

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
inline

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 ( )
inlineprotected

Definition at line 29 of file Object.h.

◆ versions() [2/2]

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

Definition at line 31 of file Object.h.