9 #ifndef _LOOKUP_ELEMENT_VALUE_FINFO_H
10 #define _LOOKUP_ELEMENT_VALUE_FINFO_H
28 void ( T::*setFunc )(
const Eref&, L, F ),
29 F ( T::*getFunc )(
const Eref&, L )
const )
32 string setname =
"set" +
name;
33 setname[3] = std::toupper( setname[3] );
36 "Assigns field value.",
39 string getname =
"get" +
name;
40 getname[3] = std::toupper( getname[3] );
43 "Requests field value. The requesting Element must "
44 "provide a handler for the returned value.",
55 const string& arg )
const {
56 string fieldPart = field.substr( 0, field.find(
"[" ) );
57 string indexPart = field.substr( field.find(
"[" ) + 1, field.find(
"]" ) );
59 tgt.
objId(), fieldPart, indexPart, arg );
63 string& returnValue )
const {
64 string fieldPart = field.substr( 0, field.find(
"[" ) );
65 string indexPart = field.substr( field.find(
"[" ) + 1, field.find(
"]" ) );
67 tgt.
objId(), fieldPart, indexPart, returnValue );
79 template <
class T,
class L,
class F >
88 const string& name,
const string& doc,
89 F ( T::*getFunc )(
const Eref& e, L )
const )
92 string getname =
"get" +
name;
93 getname[3] = std::toupper( getname[3] );
96 "Requests field value. The requesting Element must "
97 "provide a handler for the returned value.",
107 const string& arg )
const {
112 string& returnValue )
const {
113 string fieldPart = field.substr( 0, field.find(
"[" ) );
114 string indexPart = field.substr( field.find(
"[" ) + 1, field.find(
"]" ) );
116 tgt.
objId(), fieldPart, indexPart, returnValue );
127 #endif // _LOOKUP_ELEMENT_VALUE_FINFO_H
void registerFinfo(Cinfo *c)
~ReadOnlyLookupElementValueFinfo()
~LookupElementValueFinfo()
const string & name() const
void registerFinfo(Finfo *f)
static bool innerStrSet(const ObjId &dest, const string &field, const string &indexStr, const string &val)
void registerFinfo(Cinfo *c)
bool strSet(const Eref &tgt, const string &field, const string &arg) const
ReadOnlyLookupElementValueFinfo(const string &name, const string &doc, F(T::*getFunc)(const Eref &e, L) const )
static bool innerStrGet(const ObjId &dest, const string &field, const string &indexStr, string &str)
bool strGet(const Eref &tgt, const string &field, string &returnValue) const
bool strGet(const Eref &tgt, const string &field, string &returnValue) const
bool strSet(const Eref &tgt, const string &field, const string &arg) const
LookupElementValueFinfo(const string &name, const string &doc, void(T::*setFunc)(const Eref &, L, F), F(T::*getFunc)(const Eref &, L) const )