1 #ifndef OPALS_IOPTION_HPP_INCLUDED
2 #define OPALS_IOPTION_HPP_INCLUDED
11 #include <opals/fwd.hpp>
12 #include <opals/UsageLevel.hpp>
13 #include <opals/ValueSource.hpp>
14 #include <opals/OptionNames.hpp>
15 #include <type_traits>
17 namespace opals {
namespace opts
32 template< Names::Type name_ >
33 struct NameT : std::integral_constant< Names::Type, name_ > {};
37 template<
class Head_,
class Tail_ = Vo
id >
47 template<
class Head_,
class Tail_ >
48 struct IsCons<
Cons< Head_, Tail_ > > : std::true_type {};
82 virtual bool empty()
const = 0;
89 template< Names::Type name_,
bool readOnly_,
class T >
96 virtual const T &
get()
const = 0;
98 virtual const T &
getOr(
const T &default_ )
const = 0;
104 template< Names::Type name_,
class T >
110 virtual const T &
get()
const = 0;
112 virtual const T &
getOr(
const T &default_ )
const = 0;
114 virtual void set(
const T &value ) = 0;
117 #include <opals/IAccess.hpp>
124 template< Names::Type name_,
bool readOnly_,
class Opts_ >
126 : IAcc< readOnly_, Opts_ >::Type
137 template< Names::Type name_,
bool readOnly_,
class Opts_ >
141 typedef typename std::conditional<
148 virtual std::size_t
size()
const = 0;
152 virtual const Element &
all()
const = 0;
155 virtual const Element &
operator[]( std::size_t idx )
const = 0;
163 template< Names::Type name_,
class Opts_ >
167 typedef typename std::conditional<
174 virtual std::size_t
size()
const = 0;
179 virtual const Element &
all()
const = 0;
180 virtual Element &
all() = 0;
185 virtual const Element &
operator[]( std::size_t idx )
const = 0;
186 virtual Element &
operator[]( std::size_t idx ) = 0;
195 template< Names::Type name_,
bool readOnly_,
class Opts_ >
206 template< Names::Type name_,
class Opts_ >
213 virtual void resize( std::size_t
size ) = 0;
222 template< Names::Type name_,
bool readOnly_, std::
size_t N,
class Opts_ >