D
ddtbhai
Hello folks,
Just wanted to know if there are some 'standard' approaches to
enforcing an order in the invocation of calling functions. It is
usually needed when initializing some object.
e.g
class A
{
void setFunc1(int a);
void setFunc2(int a);
void setFunc3(int a);
};
now, when a user of this object initializes the object, i want to
enforce :
setFunc1 "called before" setFunc2 "called before" setFunc3
At a quick glance some form of solution that stores some flags
internally and raises exceptions come to mind. But has anyone tried
some particularly elegant solution that achieves the same ends?
Thanks in advance,
ddtbhai
Just wanted to know if there are some 'standard' approaches to
enforcing an order in the invocation of calling functions. It is
usually needed when initializing some object.
e.g
class A
{
void setFunc1(int a);
void setFunc2(int a);
void setFunc3(int a);
};
now, when a user of this object initializes the object, i want to
enforce :
setFunc1 "called before" setFunc2 "called before" setFunc3
At a quick glance some form of solution that stores some flags
internally and raises exceptions come to mind. But has anyone tried
some particularly elegant solution that achieves the same ends?
Thanks in advance,
ddtbhai