|
Boost Users : |
From: John Metta (penningj_at_[hidden])
Date: 2006-04-20 12:18:50
Does Boost have any magic to help with a class method cascade? Consider:
struct INFO
{
float mass;
float volume;
...
virtual void Reset()
{
mass = 0.0f;
volume = 0.0f;
...
};
}
struct WATER_INFO : virtual INFO
{
float rateInfow;
float rateOutflow;
...
virtual void Reset()
{
rateInflow = 0.0f;
rateOutflow = 0.0f;
super.Reset(); // Wish to cascade a reset function down.
};
};
struct SURFACE_WATER_INFO : virtual INFO
{ ... } // cascading to reset the variables at any level.
Disclaimer: I recognize that this is a ... let's say "less than elegant"
solution. Unfortunately, I've been given a 20,000 line monolithic
implementation (there should be no fewer than 10 in here) of a jungle
and am trying to put a bit of duct tape on some things in order to make
it run to finish my thesis. Given time, I would re-write the entire
thing correctly, but I don't have that luxury currently.
Cheers,
-j
-- John Metta http://jmetta.com "A computer without windows is like a dog without bricks tied to its head."
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net