M
mliptak
Hi, I'm implementing a class which will serve as a callback. It will
have multiple virtual operations, which will be called upon certain
events.
The user of the class can inherit from this class and implement the
virtual operations to fit his/her needs.
Each operation will have up to 3 parameters of either basic integral
types (e.g. int, unsigned, size_t) or pointers (e.g. const char*).
However these parameters can be stored in the class as attributes.
My question is - whould you rather design operations with parameters
or have these parameters as members of the class and the operations
would have no parameters?
Can this have a impact on the performance (copying the parameters via
stack)? I know, design first, then do the profiling and see.. But
I'd like to hear your opinion.
Thanks
have multiple virtual operations, which will be called upon certain
events.
The user of the class can inherit from this class and implement the
virtual operations to fit his/her needs.
Each operation will have up to 3 parameters of either basic integral
types (e.g. int, unsigned, size_t) or pointers (e.g. const char*).
However these parameters can be stored in the class as attributes.
My question is - whould you rather design operations with parameters
or have these parameters as members of the class and the operations
would have no parameters?
Can this have a impact on the performance (copying the parameters via
stack)? I know, design first, then do the profiling and see.. But
I'd like to hear your opinion.
Thanks