idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
Annotation.h
1//
2// Created by henri on 03/02/23.
3//
4
5#ifndef IDOL_ANNOTATION_H
6#define IDOL_ANNOTATION_H
7
8#include "impl_Annotation.h"
9
10namespace idol {
11 template<class ValueT>
12 class Annotation;
13}
14
15template<class ValueT = unsigned int>
16class idol::Annotation : public impl::Annotation {
17public:
18 Annotation(Env& t_env, std::string t_name) : impl::Annotation(t_env, std::move(t_name)) {}
19
20 template<class ...ArgsT> Annotation(Env& t_env, std::string t_name, ArgsT&& ...t_args)
21 : impl::Annotation(t_env, std::move(t_name)) {
22
23 set_default_value<ValueT>(std::forward<ArgsT>(t_args)...);
24
25 }
26
27 template<class ...ArgsT>
28 static Annotation<ValueT> make_with_default_value(Env& t_env, std::string t_name, ArgsT&& ...t_args) {
29 Annotation<ValueT> result(t_env, std::move(t_name));
30 result.set_default_value<ValueT>(std::forward<ArgsT>(t_args)...);
31 return result;
32 }
33
34 [[nodiscard]] const ValueT& default_value() const { return impl::Annotation::cast_default_value<ValueT>(); }
35};
36
37#endif //IDOL_ANNOTATION_H