Inherit debug value in derived class?
Is there a way to do this? I have slight variations of a model that I would like to be able to turn on debugging for by "flipping" the switch of the base class.
|
Hi Pete,
An example would make it easier to give a counter example and to test it to be certain of it... Anyway, in theory, simply use the usual "access methods and variables from the parent class by calling it directly". For example, if you have something that is somehow derived from "fvPatchField", you should be able to simply do: Code:
fvPatchField::debug = 1; Bruno |
Thanks for your insight Bruno!
This seems to suit my needs (inside constructor for derived class): Code:
if (not debug and baseClass::debug) |
There is an issue with using this method, however. You can turn on debugging using the switch for the base class, but you can't turn it off.
|
All times are GMT -4. The time now is 19:20. |