Dark_Tower
13th March 2006, 09:38
Hi, I'm programming a class that handles a certain types of parameters. And also can save/load them from disk. Well for each parameter I have it's corresponding setter and getter method all similar to the following:
double ProcParamsHandler::sizeH()
{
return m_sizeh;
}
void ProcParamsHandler::setSizeH(double newSizeH)
{
if (newSizeH < 0 || newSizeH > MAX_SIZE_H)
newSizeH = INVALID_SIZE;
m_sizeH = newSizeH;
}
I also have implemented a method to set the value for all the parameters (like the setter above) all in just a simple call. Well my question is: what's the common way to implement this "global" setter: calling its setter for each parameter or putting directly the code of its corresponding setter for each parameter?
Thanks.
double ProcParamsHandler::sizeH()
{
return m_sizeh;
}
void ProcParamsHandler::setSizeH(double newSizeH)
{
if (newSizeH < 0 || newSizeH > MAX_SIZE_H)
newSizeH = INVALID_SIZE;
m_sizeH = newSizeH;
}
I also have implemented a method to set the value for all the parameters (like the setter above) all in just a simple call. Well my question is: what's the common way to implement this "global" setter: calling its setter for each parameter or putting directly the code of its corresponding setter for each parameter?
Thanks.