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."
On Thursday 20 Apr 2006 17:18, John Metta wrote:
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.
What about: ::Reset(); At least, INFO::Reset(); should work (not very nice, but...). Or am I missing something? Hope this helps. Fred
}; }; struct SURFACE_WATER_INFO : virtual INFO { ... } // cascading to reset the variables at any level.
participants (2)
-
Fred Labrosse
-
John Metta