Re: Properties Shared Amongst Objects
- From: "Daniel T." <daniel_t@xxxxxxxxxxxxx>
- Date: Sun, 17 Feb 2008 09:10:05 -0500
"Leslie Sanford" <jabberdabber@xxxxxxxxxxxxxxxxx> wrote:
My approach was to factor out properties into classes of their own.
Instances of the property classes are passed to component objects. In the
case of the "smoothed" properties, the smoothing takes place in one property
object and the results shared amongst a group of components.
class SmoothProperty
{
public:
void Render(int count)
{
// Smooth parameter changes...
}
const float *GetOutput() const
{
// Return the results of smoothing property changes.
return buffer;
}
float GetValue() const
{
return value;
}
void SetValue(float value)
{
this->value = value;
// Do stuff to calibrate property smoothing...
}
};
SmoothParameter param;
Component c1(param);
Component c2(param);
param.SetValue(1000);
param.Render(1024);
I'm looking for comments or insights into the above approach. Also, are
there any sources that describe an approach similar to the above?
It sounds like the Strategy pattern to me.
.
- References:
- Properties Shared Amongst Objects
- From: Leslie Sanford
- Properties Shared Amongst Objects
- Prev by Date: Re: Inheritance of implementation: what is the reason of?
- Next by Date: Re: Variant record issues (Re: Why is Object Oriented so successfull)
- Previous by thread: Properties Shared Amongst Objects
- Next by thread: Re: Properties Shared Amongst Objects
- Index(es):