// Check parameter access path well formed for leaf elements bool CInstanceConfigurableElement::checkPathExhausted(CPathNavigator& pathNavigator, CErrorContext& errorContext) { std::string* pStrChildName = pathNavigator.next(); if (pStrChildName) { // Should be leaf element errorContext.setError("Path not found: " + pathNavigator.getCurrentPath()); return false; } return true; }
// Parameter access bool CConfigurableElement::accessValue(CPathNavigator& pathNavigator, string& strValue, bool bSet, CParameterAccessContext& parameterAccessContext) const { string* pStrChildName = pathNavigator.next(); if (!pStrChildName) { parameterAccessContext.setError("Non accessible element"); return false; } const CConfigurableElement* pChild = static_cast<const CConfigurableElement*>(findChild(*pStrChildName)); if (!pChild) { parameterAccessContext.setError("Path not found: " + pathNavigator.getCurrentPath()); return false; } return pChild->accessValue(pathNavigator, strValue, bSet, parameterAccessContext); }