////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// THIS IS AUTO-GENERATED CODE.  PLEASE DO NOT EDIT (File bug reports against tools).
///
/// Auto-generated by: Parameter Parser V5.5.1 (2411131018)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file  aecxconvergence.cpp
/// @brief Auto-generated Chromatix parameter file
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include "aecxconvergence.h"
#include "parametersetmanager.h"

AECXCONVERGENCE_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool SmartADRCType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        ParameterUtils::DoubleToString((double)enable, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "gyroThreshold") == 0)
    {
        ParameterUtils::DoubleToString((double)gyroThreshold, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "gyroExpAdjstableThr") == 0)
    {
        ParameterUtils::DoubleToString((double)gyroExpAdjstableThr, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "IncDownThr") == 0)
    {
        ParameterUtils::DoubleToString((double)IncDownThr, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "IncUpThr") == 0)
    {
        ParameterUtils::DoubleToString((double)IncUpThr, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "DecDownThr") == 0)
    {
        ParameterUtils::DoubleToString((double)DecDownThr, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "DecUpThr") == 0)
    {
        ParameterUtils::DoubleToString((double)DecUpThr, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "BrightRatioHighThr") == 0)
    {
        ParameterUtils::DoubleToString((double)BrightRatioHighThr, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "BrightRatioLowThr") == 0)
    {
        ParameterUtils::DoubleToString((double)BrightRatioLowThr, __value, __size);
        __result = true;
    }

    return __result;
}

bool SmartADRCType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enable = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "gyroThreshold") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            gyroThreshold = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "gyroExpAdjstableThr") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            gyroExpAdjstableThr = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "IncDownThr") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            IncDownThr = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "IncUpThr") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            IncUpThr = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "DecDownThr") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            DecDownThr = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "DecUpThr") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            DecUpThr = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "BrightRatioHighThr") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            BrightRatioHighThr = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "BrightRatioLowThr") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            BrightRatioLowThr = (float)dblValue; 
        }
    }

    return __result;
}

bool SmartADRCType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // enable
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("enable", ParameterParserDataType::Boolean, (double)enable, 0));
    }
    else if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Boolean, (double)enable, 0));
    }

    // gyroThreshold
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("gyroThreshold", ParameterParserDataType::Float, (double)gyroThreshold));
    }
    else if (PARAMETER_STRCMP(__name, "gyroThreshold") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)gyroThreshold));
    }

    // gyroExpAdjstableThr
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("gyroExpAdjstableThr", ParameterParserDataType::Int32, (double)gyroExpAdjstableThr, 0));
    }
    else if (PARAMETER_STRCMP(__name, "gyroExpAdjstableThr") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)gyroExpAdjstableThr, 0));
    }

    // IncDownThr
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("IncDownThr", ParameterParserDataType::Float, (double)IncDownThr));
    }
    else if (PARAMETER_STRCMP(__name, "IncDownThr") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)IncDownThr));
    }

    // IncUpThr
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("IncUpThr", ParameterParserDataType::Float, (double)IncUpThr));
    }
    else if (PARAMETER_STRCMP(__name, "IncUpThr") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)IncUpThr));
    }

    // DecDownThr
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("DecDownThr", ParameterParserDataType::Float, (double)DecDownThr));
    }
    else if (PARAMETER_STRCMP(__name, "DecDownThr") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)DecDownThr));
    }

    // DecUpThr
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("DecUpThr", ParameterParserDataType::Float, (double)DecUpThr));
    }
    else if (PARAMETER_STRCMP(__name, "DecUpThr") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)DecUpThr));
    }

    // BrightRatioHighThr
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("BrightRatioHighThr", ParameterParserDataType::Float, (double)BrightRatioHighThr));
    }
    else if (PARAMETER_STRCMP(__name, "BrightRatioHighThr") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)BrightRatioHighThr));
    }

    // BrightRatioLowThr
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("BrightRatioLowThr", ParameterParserDataType::Float, (double)BrightRatioLowThr));
    }
    else if (PARAMETER_STRCMP(__name, "BrightRatioLowThr") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)BrightRatioLowThr));
    }

    return __result;
}

bool SmoothNodeType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "minNodeDRCGain") == 0)
    {
        ParameterUtils::DoubleToString((double)minNodeDRCGain, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "maxNodeDRCGain") == 0)
    {
        ParameterUtils::DoubleToString((double)maxNodeDRCGain, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "nodeSize") == 0)
    {
        ParameterUtils::DoubleToString((double)nodeSize, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "triggerPointUp") == 0)
    {
        ParameterUtils::DoubleToString((double)triggerPointUp, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "triggerPointDown") == 0)
    {
        ParameterUtils::DoubleToString((double)triggerPointDown, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "multiplierIncrement") == 0)
    {
        ParameterUtils::DoubleToString((double)multiplierIncrement, __value, __size);
        __result = true;
    }

    return __result;
}

bool SmoothNodeType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "minNodeDRCGain") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            minNodeDRCGain = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "maxNodeDRCGain") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            maxNodeDRCGain = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "nodeSize") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            nodeSize = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "triggerPointUp") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            triggerPointUp = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "triggerPointDown") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            triggerPointDown = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "multiplierIncrement") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            multiplierIncrement = (float)dblValue; 
        }
    }

    return __result;
}

bool SmoothNodeType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // minNodeDRCGain
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("minNodeDRCGain", ParameterParserDataType::Float, (double)minNodeDRCGain));
    }
    else if (PARAMETER_STRCMP(__name, "minNodeDRCGain") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)minNodeDRCGain));
    }

    // maxNodeDRCGain
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("maxNodeDRCGain", ParameterParserDataType::Float, (double)maxNodeDRCGain));
    }
    else if (PARAMETER_STRCMP(__name, "maxNodeDRCGain") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)maxNodeDRCGain));
    }

    // nodeSize
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("nodeSize", ParameterParserDataType::Float, (double)nodeSize));
    }
    else if (PARAMETER_STRCMP(__name, "nodeSize") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)nodeSize));
    }

    // triggerPointUp
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("triggerPointUp", ParameterParserDataType::Float, (double)triggerPointUp));
    }
    else if (PARAMETER_STRCMP(__name, "triggerPointUp") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)triggerPointUp));
    }

    // triggerPointDown
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("triggerPointDown", ParameterParserDataType::Float, (double)triggerPointDown));
    }
    else if (PARAMETER_STRCMP(__name, "triggerPointDown") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)triggerPointDown));
    }

    // multiplierIncrement
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("multiplierIncrement", ParameterParserDataType::Float, (double)multiplierIncrement));
    }
    else if (PARAMETER_STRCMP(__name, "multiplierIncrement") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)multiplierIncrement));
    }

    return __result;
}

bool DRCSmoothType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "enableSmoothDRC") == 0)
    {
        ParameterUtils::DoubleToString((double)enableSmoothDRC, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "nodes") == 0)
    {
        if (__index < nodesCount)
        {
            __result = nodes[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool DRCSmoothType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "enableSmoothDRC") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableSmoothDRC = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "nodes") == 0)
    {
        if (__index < nodesCount)
        {
            __result = nodes[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

bool DRCSmoothType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // enableSmoothDRC
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("enableSmoothDRC", ParameterParserDataType::Boolean, (double)enableSmoothDRC, 0));
    }
    else if (PARAMETER_STRCMP(__name, "enableSmoothDRC") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Boolean, (double)enableSmoothDRC, 0));
    }

    // nodes
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("nodes", ParameterParserDataType::Structure, true, false, nodesCount));
    }
    else if (PARAMETER_STRCMP(__name, "nodes") == 0)
    {
        if (__index < nodesCount)
        {
            __result = nodes[__index].GetInfo(&__path[__pos], __info);
        }
        else
        {
            __result = true;
            __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Structure, true, false, nodesCount));
        }
    }

    return __result;
}

bool AECXConvergenceType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "parameter_version") == 0)
    {
        __result = parameter_version.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)moduleID, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "unitStepSize") == 0)
    {
        ParameterUtils::DoubleToString((double)unitStepSize, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "drcStretchAgg") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)drcStretchAgg, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "smoothADRC") == 0)
    {
        __result = smoothADRC.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "smoothDarkBoost") == 0)
    {
        __result = smoothDarkBoost.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "smartADRC") == 0)
    {
        __result = smartADRC.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool AECXConvergenceType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "parameter_version") == 0)
    {
        __result = parameter_version.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            moduleID = (aecxglobalelements::AECXModuleIDType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "unitStepSize") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            unitStepSize = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "drcStretchAgg") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            drcStretchAgg = (AECConvDRCStretchAggType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "smoothADRC") == 0)
    {
        __result = smoothADRC.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "smoothDarkBoost") == 0)
    {
        __result = smoothDarkBoost.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "smartADRC") == 0)
    {
        __result = smartADRC.SetValue(&__path[__pos], __value);
    }

    return __result;
}

bool AECXConvergenceType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // module_version
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("module_version", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.GetInfo(&__path[__pos], __info);
    }

    // parameter_version
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("parameter_version", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "parameter_version") == 0)
    {
        __result = parameter_version.GetInfo(&__path[__pos], __info);
    }

    // moduleID
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("moduleID", ParameterParserDataType::Enum, (double)(UINT32)moduleID, 0));
    }
    else if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Enum, (double)(UINT32)moduleID, 0));
    }

    // unitStepSize
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("unitStepSize", ParameterParserDataType::Float, (double)unitStepSize));
    }
    else if (PARAMETER_STRCMP(__name, "unitStepSize") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)unitStepSize));
    }

    // drcStretchAgg
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("drcStretchAgg", ParameterParserDataType::Enum, (double)(UINT32)drcStretchAgg, 0));
    }
    else if (PARAMETER_STRCMP(__name, "drcStretchAgg") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Enum, (double)(UINT32)drcStretchAgg, 0));
    }

    // smoothADRC
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("smoothADRC", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "smoothADRC") == 0)
    {
        __result = smoothADRC.GetInfo(&__path[__pos], __info);
    }

    // smoothDarkBoost
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("smoothDarkBoost", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "smoothDarkBoost") == 0)
    {
        __result = smoothDarkBoost.GetInfo(&__path[__pos], __info);
    }

    // smartADRC
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("smartADRC", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "smartADRC") == 0)
    {
        __result = smartADRC.GetInfo(&__path[__pos], __info);
    }

    return __result;
}

bool AECXConvergenceType::module_versionStruct::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)major_revision, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)minor_revision, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)incr_revision, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool AECXConvergenceType::module_versionStruct::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            major_revision = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            minor_revision = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            incr_revision = (INT32)dblValue; 
        }
    }

    return __result;
}

bool AECXConvergenceType::module_versionStruct::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // major_revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("major_revision", ParameterParserDataType::Int32, (double)major_revision, 0));
    }
    else if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)major_revision, 0));
    }

    // minor_revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("minor_revision", ParameterParserDataType::Int32, (double)minor_revision, 0));
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)minor_revision, 0));
    }

    // incr_revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("incr_revision", ParameterParserDataType::Int32, (double)incr_revision, 0));
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)incr_revision, 0));
    }

    return __result;
}

bool AECXConvergenceType::parameter_versionStruct::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "revision") == 0)
    {
        PARAMETER_STRCPY(__value, __size, revision);
        __result = true;
    }

    return __result;
}

bool AECXConvergenceType::parameter_versionStruct::SetValue(
    const CHAR* const __path,
    const CHAR* const /*__value*/)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "revision") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }

    return __result;
}

bool AECXConvergenceType::parameter_versionStruct::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("revision", ParameterParserDataType::String, revision));
    }
    else if (PARAMETER_STRCMP(__name, "revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::String, revision));
    }

    return __result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Read enum value
/// @param entry [in] Symbol table entry
/// @param enumValue [out] Enum value to read
/// @param alignment [in] Symbol table byte alignment
/// @return true if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool ReadEnum_AECConvDRCStretchAggType(
    ParameterFileSymbolTableEntry* const entry,
    AECConvDRCStretchAggType& enumValue,
    BYTE const alignment)
{
    bool result {false};

    UINT32 uintValue {entry->ReadEnum(&result, alignment)};

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(AECConvDRCStretchAggType::AggTypeDRCPrefParallel):
            enumValue = AECConvDRCStretchAggType::AggTypeDRCPrefParallel;
            result    = true;
            break;
        case static_cast<UINT32>(AECConvDRCStretchAggType::AggTypeCascade):
            enumValue = AECConvDRCStretchAggType::AggTypeCascade;
            result    = true;
            break;
        case static_cast<UINT32>(AECConvDRCStretchAggType::AggTypeDisableDRCInPredictive):
            enumValue = AECConvDRCStretchAggType::AggTypeDisableDRCInPredictive;
            result    = true;
            break;
        case static_cast<UINT32>(AECConvDRCStretchAggType::Res):
            enumValue = AECConvDRCStretchAggType::Res;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to AECConvDRCStretchAggType", uintValue);
            break;
        }
    }
    return result;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXConvergenceTypeClass::AECXConvergenceTypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(unitStepSize);
    PARAMETER_INITIALIZE(drcStretchAgg);
    PARAMETER_INITIALIZE(smoothADRC);
    PARAMETER_INITIALIZE(smoothDarkBoost);
    PARAMETER_INITIALIZE(smartADRC);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXConvergenceTypeClass::AECXConvergenceTypeClass(
    const CHAR* const name,
    ModuleData* const moduleData)
    : ParameterModule(name, MAJOR, MINOR, PATCH, moduleData)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(unitStepSize);
    PARAMETER_INITIALIZE(drcStretchAgg);
    PARAMETER_INITIALIZE(smoothADRC);
    PARAMETER_INITIALIZE(smoothDarkBoost);
    PARAMETER_INITIALIZE(smartADRC);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Destructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXConvergenceTypeClass::~AECXConvergenceTypeClass()
{
    if (Loaded)
    {
        UnloadModule();
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetName
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const CHAR* AECXConvergenceTypeClass::GetName(
    const CHAR* const type)
{
    const CHAR* name = type;
    CHAR temp[ParameterFileSymbolTableEntry::TYPE_LEN + 1];
    if (PARAMETER_STRCMP(type, ModuleData::GetType(temp, "aecxconvergence")) == 0)
    {
        name = "aecxconvergence";
    }
    return name;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load SmartADRCType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool SmartADRCType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(enable);
    PARAMETER_INITIALIZE(gyroThreshold);
    PARAMETER_INITIALIZE(gyroExpAdjstableThr);
    PARAMETER_INITIALIZE(IncDownThr);
    PARAMETER_INITIALIZE(IncUpThr);
    PARAMETER_INITIALIZE(DecDownThr);
    PARAMETER_INITIALIZE(DecUpThr);
    PARAMETER_INITIALIZE(BrightRatioHighThr);
    PARAMETER_INITIALIZE(BrightRatioLowThr);

    SYMBOL_TABLE_ENTRY_READ(entry, result, enable, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, gyroThreshold, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, gyroExpAdjstableThr, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, IncDownThr, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, IncUpThr, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, DecDownThr, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, DecUpThr, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, BrightRatioHighThr, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, BrightRatioLowThr, alignment)

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load SmoothNodeType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool SmoothNodeType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(minNodeDRCGain);
    PARAMETER_INITIALIZE(maxNodeDRCGain);
    PARAMETER_INITIALIZE(nodeSize);
    PARAMETER_INITIALIZE(triggerPointUp);
    PARAMETER_INITIALIZE(triggerPointDown);
    PARAMETER_INITIALIZE(multiplierIncrement);

    SYMBOL_TABLE_ENTRY_READ(entry, result, minNodeDRCGain, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, maxNodeDRCGain, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, nodeSize, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, triggerPointUp, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, triggerPointDown, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, multiplierIncrement, alignment)

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load DRCSmoothType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool DRCSmoothType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(enableSmoothDRC);
    PARAMETER_INITIALIZE(nodes);

    SYMBOL_TABLE_ENTRY_READ(entry, result, enableSmoothDRC, alignment)

    // Reading Array nodes from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        nodesCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, nodesCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            nodesID = pointerEntry->ID;
            DupObjInfo* nodesDupInfo = pointerEntry->GetDupObject(nodesCount, file, line);
            if (nodesDupInfo != nullptr && nodesDupInfo->Object != nullptr)
            {
                nodes = (SmoothNodeType*)nodesDupInfo->Object;
                if (nodes == nullptr)
                {
                    if (nodesDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "nodes duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            nodesDupInfo->File, nodesDupInfo->Line, nodesDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "nodes duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            nodesDupInfo->Line, nodesDupInfo->RefCount);
                    }
                }
            }

            if (nodes == nullptr)
            {
                if (result && nodesCount > 0)
                {
                    nodes = PARAMETER_NEW SmoothNodeType[nodesCount];
                    (void)pointerEntry->SetDupObject(nodes, nodesCount, file, line);
                }
                if (!result || nodes == nullptr)
                {
                    if (nodesCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate nodes\n");
                    }
                    nodesCount = 0;
                }
                for (UINT32 i = 0; result && i < nodesCount; i++)
                {
                    result = nodes[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (nodes == nullptr)
        {
            nodesCount = 0;
        }
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load AECXConvergenceType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool AECXConvergenceType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(unitStepSize);
    PARAMETER_INITIALIZE(drcStretchAgg);
    PARAMETER_INITIALIZE(smoothADRC);
    PARAMETER_INITIALIZE(smoothDarkBoost);
    PARAMETER_INITIALIZE(smartADRC);

    result = module_version.Load(entry, alignment);
    if (result)
    {
        result = parameter_version.Load(entry, alignment);
    }
    if (result)
    {
        result = aecxglobalelements::ReadEnum_AECXModuleIDType(entry, moduleID, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, unitStepSize, alignment)
    if (result)
    {
        result = aecxconvergence::ReadEnum_AECConvDRCStretchAggType(entry, drcStretchAgg, alignment);
    }
    if (result)
    {
        result = smoothADRC.Load(entry, alignment);
    }
    if (result)
    {
        result = smoothDarkBoost.Load(entry, alignment);
    }
    if (result)
    {
        result = smartADRC.Load(entry, alignment);
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool AECXConvergenceType::module_versionStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(major_revision);
    PARAMETER_INITIALIZE(minor_revision);
    PARAMETER_INITIALIZE(incr_revision);

    SYMBOL_TABLE_ENTRY_READ(entry, result, major_revision, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, minor_revision, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, incr_revision, alignment)

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool AECXConvergenceType::parameter_versionStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(revision);


    // Reading String revision from symbol table
    {
        UINT32 count = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, count, alignment)
        ParameterFileSymbolTableEntry stringPointerEntryCls;
        ParameterFileSymbolTableEntry* const stringPointerEntry = &stringPointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(stringPointerEntryCls, entry, alignment);
        }
        SYMBOL_TABLE_ENTRY_READ_STRING(stringPointerEntry, result, revision, count, alignment)
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload DRCSmoothType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void DRCSmoothType::Unload(ParameterFileSymbolTable* const __table)
{
    if (__table != nullptr && __table->ReleaseDupObject(nodes))
    {
        PARAMETER_DELETE[] nodes;
    }
    nodes = nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload AECXConvergenceType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXConvergenceType::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
    smoothADRC.Unload(__table);
    smoothDarkBoost.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXConvergenceType::parameter_versionStruct::Unload(ParameterFileSymbolTable* const __table)
{
    if (__table != nullptr && __table->ReleaseDupObject(revision))
    {
        PARAMETER_DELETE[] revision;
    }
    revision = nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Release the ParameterModule object
/// Requires that this object was created via a ParameterSetManager::GetModule call
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXConvergenceType::Release()
{
    ((AECXConvergenceTypeClass*)this)->Release();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Returns the ParameterModule::Modified value
/// The Modified value is incremented when the module's data or pointer values change
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
UINT32 AECXConvergenceType::GetModified()
{
    return ((AECXConvergenceTypeClass*)this)->Modified;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Create module, and return a new object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ParameterModule* AECXConvergenceTypeClass::Create(
    ModuleData*    moduleData,
    DefaultModule* const defModule) const
{
    AECXConvergenceTypeClass* cls = nullptr;

    if (PARAMETER_STRCMP(Type, moduleData->Type) == 0 && Version.Value == moduleData->Version.Value)
    {
        const UINT32 id = moduleData->DuplicateID > 0 ? moduleData->DuplicateID : moduleData->ID;

        ParameterModule* const module = defModule->Find(id);
        if (module != nullptr)
        {
            cls = (AECXConvergenceTypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW AECXConvergenceTypeClass(GetName(moduleData->Type), moduleData);
            cls->SymbolTableID = id;
            defModule->AddModule((ParameterModule*)cls);
        }
    }
    else if (Version.Value != moduleData->Version.Value)
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create AECXConvergenceTypeClass, binary version (%lld) does not match source version (%lld)\n",
            moduleData->Version.Value, Version.Value);
    }
    else
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create AECXConvergenceTypeClass, binary name (%s) does not match source name (%s)\n",
            moduleData->Type, Type);
    }

    return (ParameterModule*)cls;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module data, return true is successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool AECXConvergenceTypeClass::LoadModule(
    ParameterFileSymbolTable* const table)
{
    bool result = true;

    if (!Loaded)
    {
        BYTE const alignment = table->Alignment;
        AECXConvergenceTypeClass* const cls = this;

        ParameterFileSymbolTableEntry  entryObj;
        ParameterFileSymbolTableEntry* const entry = &entryObj;
        // With EzTune enabled, the unused upper byte of SymbolTableID value can change, so clear it
        result = table->Find(entryObj, SymbolTableID & 0x00ffffff);

        if (!result)
        {
            PARAMETER_LOG_ERROR(entry->SetManager, "AECXConvergenceTypeClass::LoadModule Failed to find module ID (%d) in Symbol Table\n", SymbolTableID);
        }

        if (result)
        {
            result = cls->Load(entry, alignment);
        }
        Modified++;
        Loaded = true;
    }

    if (!result)
    {
        /// Module failed to fully load, unload it
        UnloadModule();
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload module data
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXConvergenceTypeClass::UnloadModule()
{
    if (Loaded)
    {
        if (Data != nullptr && Data->SymbolTable != nullptr)
        {
            Unload(Data->SymbolTable);
        }
        else
        {
            PARAMETER_LOG_ERROR(Data != nullptr ? Data->SetManager : nullptr, "UnloadModule %s called with nullptr "
                "Data->SymbolTable object\n", Name);
            Unload(nullptr);
        }
        Loaded = false;
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// /// Release the ParameterModule object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXConvergenceTypeClass::Release()
{
    ParameterModule::Release();
}

AECXCONVERGENCE_NAMESPACE_END
