Class Ase::Member
template <auto setter, auto getter>
Implement C++ member field API with a 0-sized class from setter and getter, maybe combined with [[no_unique_address]]
.
#include <member.hh>
Public Types
Type | Name |
---|---|
typedef typename GetterTraits::ClassType | Class |
typedef typename std::decay< typename GetterTraits::ReturnType >::type | G |
typedef Lib::MemberFunctionTraits< getter > | GetterTraits |
typedef typename std::decay< typename SetterTraits::ReturnType >::type | S |
typedef Lib::MemberFunctionTraits< setter > | SetterTraits |
typedef typename std::decay< typename std::tuple_element< 1, typename SetterTraits::Arguments >::type >::type | T |
typedef T | value_type |
Public Static Attributes
Type | Name |
---|---|
constexpr bool | is_unique_per_member = = true |
Public Functions
Type | Name |
---|---|
Member (Class * o, const String & n="", const StringS & s={}) |
|
Member (Class * o, const String & n, const ParamInitialVal & iv, const StringS & s={}) |
|
Member (Class * o, const String & n, const ParamInitialVal & iv, const ParamExtraVals & ev, const StringS & s={}) |
|
Member (Class * o, const String & n, const ParamExtraVals & ev, const StringS & s={}) |
|
Member (Class * o, const String & n, const ParamInitialVal & iv, const ParamExtraVals & ev, uint64_t hints, const StringS & s={}, bool init=true) |
|
T | get () const |
void | notify () const |
operator T () const |
|
T | operator() () const |
bool | operator() (const T & value) |
bool | operator= (const T & value) |
bool | set (const T & value) |
Public Static Functions
Type | Name |
---|---|
uint64_t | hints () |
Class * | host_ (const Member * m, Class * o=nullptr) Resolve (or assign) host-> Member distance (may be 0). |
String | info (const String & key) |
const StringS & | infos () |
const MemberDetails & | meta_ (const MemberDetails * n=nullptr) Retrieve or assign property meta infos. |
Public Types Documentation
typedef Class
using Ase::Member< setter, getter >::Class = typename GetterTraits::ClassType;
typedef G
using Ase::Member< setter, getter >::G = typename std::decay<typename GetterTraits::ReturnType>::type;
typedef GetterTraits
using Ase::Member< setter, getter >::GetterTraits = Lib::MemberFunctionTraits<getter>;
typedef S
using Ase::Member< setter, getter >::S = typename std::decay<typename SetterTraits::ReturnType>::type;
typedef SetterTraits
using Ase::Member< setter, getter >::SetterTraits = Lib::MemberFunctionTraits<setter>;
typedef T
using Ase::Member< setter, getter >::T = typename std::decay<typename std::tuple_element<1, typename SetterTraits::Arguments>::type>::type;
typedef value_type
using Ase::Member< setter, getter >::value_type = T;
Public Static Attributes Documentation
variable is_unique_per_member
constexpr bool Ase::Member< setter, getter >::is_unique_per_member;
Public Functions Documentation
function Member [1/5]
inline Ase::Member::Member (
Class * o,
const String & n="",
const StringS & s={}
)
function Member [2/5]
inline Ase::Member::Member (
Class * o,
const String & n,
const ParamInitialVal & iv,
const StringS & s={}
)
function Member [3/5]
inline Ase::Member::Member (
Class * o,
const String & n,
const ParamInitialVal & iv,
const ParamExtraVals & ev,
const StringS & s={}
)
function Member [4/5]
inline Ase::Member::Member (
Class * o,
const String & n,
const ParamExtraVals & ev,
const StringS & s={}
)
function Member [5/5]
inline Ase::Member::Member (
Class * o,
const String & n,
const ParamInitialVal & iv,
const ParamExtraVals & ev,
uint64_t hints,
const StringS & s={},
bool init=true
)
function get
inline T Ase::Member::get () const
function notify
inline void Ase::Member::notify () const
function operator T
inline Ase::Member::operator T () const
function operator() [1/2]
inline T Ase::Member::operator() () const
function operator() [2/2]
inline bool Ase::Member::operator() (
const T & value
)
function operator=
inline bool Ase::Member::operator= (
const T & value
)
function set
inline bool Ase::Member::set (
const T & value
)
Public Static Functions Documentation
function hints
static inline uint64_t Ase::Member::hints ()
function host_
static inline Class * Ase::Member::host_ (
const Member * m,
Class * o=nullptr
)
function info
static inline String Ase::Member::info (
const String & key
)
function infos
static inline const StringS & Ase::Member::infos ()
function meta_
static inline const MemberDetails & Ase::Member::meta_ (
const MemberDetails * n=nullptr
)
The documentation for this class was generated from the following file /__w/anklang/anklang/ase/member.hh