Krita Source Code Documentation
Loading...
Searching...
No Matches
KisOptionTuple.h File Reference
#include <KisMpl.h>
#include <boost/operators.hpp>
#include <boost/tti/has_static_member_data.hpp>

Go to the source code of this file.

Classes

struct  detail::all_support_prefix< T >
 
struct  detail::KisOptionTupleImpl< allSupportPrefix, noneSupportPrefix, Data >
 
struct  detail::KisOptionTupleImpl< false, true, Data... >
 
struct  detail::KisOptionTupleImpl< true, false, FirstData, RestData... >
 
struct  detail::none_support_prefix< T >
 
struct  detail::supports_prefix< T, false >
 
struct  detail::supports_prefix< T, true >
 

Namespaces

namespace  detail
 

Typedefs

template<typename... Data>
using KisOptionTuple
 

Typedef Documentation

◆ KisOptionTuple

template<typename... Data>
using KisOptionTuple
Initial value:

KisOptionTuple is a class that merges multiple option data structs into one by inheriting from all of them.

KisOptionTuple automatically generates read, write and operator== methods for the resulting class.

You may later access the merged types via kislager::lenses::to_base<BaseData> lens.

Restrictions:

1) The merged structs must have different types 2) The arguments passed to the constructor are passed to constructor of the first base class of in the list.

Prefixed data structures

If all the passed data types support 'prefixed' read and write (that is, define 'static constexpr bool T::supports_prefix = true'), then the tuple switches into a "prefixed" mode:

1) KisOptionTuple's first constructor argument starts accepting a prefix string

2) This prefix string is passed to all data objects' constructors

3) The rest of the constructor's arguments are passed to the first data object only

Restrictions:

1) Either all or none data types must support prefixed mode (and define 'supports_prefix). Otherwise KisOptionTuple will fail to compile.

Definition at line 174 of file KisOptionTuple.h.