G
Gernot Frisch
Hi,
assume you have a class with members (or member get/set functions) and want
to call them by a string name with the least code to maintain.
I like to just have one macro line per member. The class should have a
working assignment operator.
The end class should look like:
class foo
{
int bar;
int goo;
public:
....
int GetGoo()const {return goo;}
void SetGoo(int g) {goo = g;}
....
std::map<std::string, something_to_map_the_GET_function> getfunctions;
static std::string GetAllParams() {return std::string("bar,goo");}
int GetVar(std::string name) {return getfunctions[name] () ; }
};
assume you have a class with members (or member get/set functions) and want
to call them by a string name with the least code to maintain.
I like to just have one macro line per member. The class should have a
working assignment operator.
The end class should look like:
class foo
{
int bar;
int goo;
public:
....
int GetGoo()const {return goo;}
void SetGoo(int g) {goo = g;}
....
std::map<std::string, something_to_map_the_GET_function> getfunctions;
static std::string GetAllParams() {return std::string("bar,goo");}
int GetVar(std::string name) {return getfunctions[name] () ; }
};