class strategy {
property_ = array();
function getProperty() { return property_; }
function getDelay() { return 0; }
}
class derivedStrategy extends strategy {
function getDelay() {
local prop = getProperty();
// do some additional work
return 1;
}
}
Simplifying the problem i am facing in the two classes above.
- I could not find in the documentation if i could directly access the property_ member variable in the derivedStrategy class.
- Added an accessor to get around the problem of not being able to access the property_ member in the overridden getDelay() method of the derivedStrategy class. But at the call site in deriveStrategy during runtime i see the error ‘the index of getProperty does not exist’ error.
Is there a reason why i am not able to access the getProperty() function of the base class, in the overridden function getDelay() in the derived class? I have tried many variants including calling it with a base.getProperty(), in which case it finds it, but then i see the error message ‘the index of property_ does not exist’ at runtime.
The example code i posted above, is working if i paste it and run it on the device. But used in my application it is NOT working.