I'm trying to figure out what works best here. Basically I have a system where I get external requests to set / get values ββin my model. The problem is that my model consists of C ++ classes that can be nested, while queries are simple (key, value) pairs.
For instance:
struct Foo { void setX(int x); int getX() const; struct Boo { void setY(float y); float getY() const; }: };
If I get a request that says set(y, 21) for a given element e, then the actions I need to perform will be different depending on whether foo and boo already exist. To take care of the various possibilities for each property, a lot of code will be written in the end.
Before inventing the wheel, I was wondering if there is a library in C ++ or a well-known technique that allows you to display these flat actions in changes in C ++ structures (which can be nested) in a general way.
thanks
source share