// Used for simulation and virtual subsystems
void CParameter::setDefaultValues(CParameterAccessContext& parameterAccessContext) const
{
    // Get default value from type
    uint32_t uiDefaultValue = static_cast<const CParameterType*>(getTypeElement())->getDefaultValue();

    // Write blackboard
    CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();

    // Beware this code works on little endian architectures only!
    pBlackboard->writeInteger(&uiDefaultValue, getSize(), getOffset() - parameterAccessContext.getBaseOffset(), parameterAccessContext.isBigEndianSubsystem());
}
bool CParameter::doGet(type& value, uint32_t uiOffset, CParameterAccessContext& parameterAccessContext) const
{
    uint32_t uiData = 0;

    // Read blackboard
    const CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();

    // Beware this code works on little endian architectures only!
    pBlackboard->readInteger(&uiData, getSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());

    return static_cast<const CParameterType*>(getTypeElement())->fromBlackboard(value, uiData, parameterAccessContext);
}
void CInstanceConfigurableElement::getListOfElementsWithMapping(
        std::list<const CConfigurableElement*>& configurableElementPath) const
{
    const CTypeElement* pTypeElement = getTypeElement();

    if (pTypeElement && pTypeElement->hasMappingData()) {

        configurableElementPath.push_back(this);
    }

    base::getListOfElementsWithMapping(configurableElementPath);
}
bool CParameter::doSet(type value, uint32_t uiOffset, CParameterAccessContext& parameterAccessContext) const
{
    uint32_t uiData;

    if (!static_cast<const CParameterType*>(getTypeElement())->toBlackboard(value, uiData, parameterAccessContext)) {

        return false;
    }
    // Write blackboard
    CParameterBlackboard* pBlackboard = parameterAccessContext.getParameterBlackboard();

    // Beware this code works on little endian architectures only!
    pBlackboard->writeInteger(&uiData, getSize(), uiOffset, parameterAccessContext.isBigEndianSubsystem());

    return true;
}
bool CInstanceConfigurableElement::map(IMapper& mapper, std::string& strError)
{
    bool bHasMappingData = getTypeElement()->hasMappingData();
    bool bKeepDiving = true;

    // Begin
    if (bHasMappingData && !mapper.mapBegin(this, bKeepDiving, strError)) {

        return false;
    }

    // Go on through children?
    if (bKeepDiving) {

        // Map children
        size_t uiNbChildren = getNbChildren();
        size_t uiChild;

        for (uiChild = 0; uiChild < uiNbChildren; uiChild++) {

            CInstanceConfigurableElement* pInstanceConfigurableChildElement =
                    static_cast<CInstanceConfigurableElement*>(getChild(uiChild));

            if (!pInstanceConfigurableChildElement->map(mapper, strError)) {

                return false;
            }
        }
    }

    // End
    if (bHasMappingData) {

        mapper.mapEnd();
    }
    return true;
}
uint32_t CParameter::getSize() const
{
    return static_cast<const CParameterType*>(getTypeElement())->getSize();
}
// Value space handling for configuration import
void CParameter::handleValueSpaceAttribute(CXmlElement& xmlConfigurableElementSettingsElement, CConfigurationAccessContext& configurationAccessContext) const
{
    // Delegate to type
    static_cast<const CParameterType*>(getTypeElement())->handleValueSpaceAttribute(xmlConfigurableElementSettingsElement, configurationAccessContext);
}
// Returns the formatted mapping
std::string CInstanceConfigurableElement::getFormattedMapping() const
{
    // Delegate
    return getTypeElement()->getFormattedMapping();
}
// Mapping
bool CInstanceConfigurableElement::getMappingData(const std::string& strKey, const std::string*& pStrValue) const
{
    // Delegate
    return getTypeElement()->getMappingData(strKey, pStrValue);
}