I'm writing a library, which will allow clients/users to interact with an object E. E has different properties but one of the member variables stores an enum. I have defined a list of enums which the client can set the variable as but I'd like the user to be able to define their own enums.
now, if you had some magic class called "properties"
and that lived inside another class called "OOO"
you might have something cool like this
class OOO
{
vector <properties> ps; //and accessor functions and something that fills it in and stuff like that, right?
}
the the client can have his own enum…
lets call some functions I didn't write above with names that let you guess what they do:
enum myenum{a,b,c,d, enum_max};
OOO var;
var.allocate_properties(enum_max);
var[a].setproperty(value); //overload the [] operator maybe? to access the vector directly, or whatever design...