////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 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 V7.4.1 (8cca6579792b9fcef3bc725ff070c5ec453c7c85)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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

#include "aecxcorestatsconfig.h"
#include "parametersetmanager.h"

AECXCORESTATSCONFIG_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool gridOptimizationType::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;

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

    if (PARAMETER_STRCMP(__name, "enableOnlyInROI") == 0)
    {
        ParameterUtils::DoubleToString((double)enableOnlyInROI, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "subSampling") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)subSampling, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool gridOptimizationType::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;

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

    if (PARAMETER_STRCMP(__name, "enableOnlyInROI") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableOnlyInROI = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "subSampling") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            subSampling = (aecxglobalelements::AECXSubSamplingType)(UINT32)dblValue; 
        }
    }

    return __result;
}

bool gridOptimizationType::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;

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

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

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

    return __result;
}

bool ParamExtensionType::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;

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

    if (PARAMETER_STRCMP(__name, "Name") == 0)
    {
        PARAMETER_STRCPY(__value, __size, Name);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "data") == 0)
    {
        if (__index < dataCount)
        {
            ParameterUtils::DoubleToString((double)data[__index], __value, __size);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < dataCount; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)data[i], &__value[__valuePos], (INT32)(__size - __valuePos));
            }
            __result = true;
        }
    }

    return __result;
}

bool ParamExtensionType::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;

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

    if (PARAMETER_STRCMP(__name, "Name") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }
    else if (PARAMETER_STRCMP(__name, "data") == 0)
    {
        if (__index < dataCount)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                data[__index] = (float)dblValue; 
            }
        }
        else
        {
            const SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __valuePos = 0;

            __index = 0;
            while (__valuePos < __valueLen && __index < dataCount)
            {
                CHAR __valueStr[MAX_SIZE];

                __valuePos += ParameterUtils::GetSubString(&__value[__valuePos], ',', __valueStr, MAX_SIZE);
                __valuePos++;

                const double dblValue = ParameterUtils::StringToDouble(__valueStr, __result);
                if (__result)
                {
                    data[__index] = (float)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }

    return __result;
}

bool ParamExtensionType::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;

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

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

    // data
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("data", ParameterParserDataType::Float, true, false, dataCount));
    }

    return __result;
}

bool ResolutionType::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;

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

    if (PARAMETER_STRCMP(__name, "width") == 0)
    {
        ParameterUtils::DoubleToString((double)width, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "height") == 0)
    {
        ParameterUtils::DoubleToString((double)height, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "binCount") == 0)
    {
        ParameterUtils::DoubleToString((double)binCount, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "bitDepth") == 0)
    {
        ParameterUtils::DoubleToString((double)bitDepth, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool ResolutionType::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;

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

    if (PARAMETER_STRCMP(__name, "width") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            width = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "height") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            height = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "binCount") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            binCount = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "bitDepth") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            bitDepth = (INT32)dblValue; 
        }
    }

    return __result;
}

bool ResolutionType::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;

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

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

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

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

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

    return __result;
}

bool channelProcessType::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;

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

    if (PARAMETER_STRCMP(__name, "channelSel") == 0)
    {
        ParameterUtils::DoubleToString((double)channelSel, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "computeMethod") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)computeMethod, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool channelProcessType::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;

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

    if (PARAMETER_STRCMP(__name, "channelSel") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            channelSel = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "computeMethod") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            computeMethod = (channelComputeMethod)(UINT32)dblValue; 
        }
    }

    return __result;
}

bool channelProcessType::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;

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

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

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

    return __result;
}

bool AECCoreStatsType::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, "enable") == 0)
    {
        ParameterUtils::DoubleToString((double)enable, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "HWStatsID") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)HWStatsID, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "exposureType") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)exposureType, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "StatsProcesser") == 0)
    {
        __result = StatsProcesser.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "outResolution") == 0)
    {
        __result = outResolution.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "outStatsType") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)outStatsType, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "outChannelName") == 0)
    {
        PARAMETER_STRCPY(__value, __size, outChannelName);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "extensionParam") == 0)
    {
        if (__index < extensionParamCount)
        {
            __result = extensionParam[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "gridOptimization") == 0)
    {
        __result = gridOptimization.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool AECCoreStatsType::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, "enable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enable = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "HWStatsID") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            HWStatsID = (aecxglobalelements::AECHWStatsInputType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "exposureType") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            exposureType = (aecxglobalelements::AECXExposureSelection)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "StatsProcesser") == 0)
    {
        __result = StatsProcesser.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "outResolution") == 0)
    {
        __result = outResolution.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "outStatsType") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            outStatsType = (aecxglobalelements::AECXStatsType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "outChannelName") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }
    else if (PARAMETER_STRCMP(__name, "extensionParam") == 0)
    {
        if (__index < extensionParamCount)
        {
            __result = extensionParam[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "gridOptimization") == 0)
    {
        __result = gridOptimization.SetValue(&__path[__pos], __value);
    }

    return __result;
}

bool AECCoreStatsType::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);

    // 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));
    }

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

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

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

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

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

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

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

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

    return __result;
}

bool AECXCoreStatsConfigType::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)moduleID, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "coreStatsConfig") == 0)
    {
        if (__index < coreStatsConfigCount)
        {
            __result = coreStatsConfig[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool AECXCoreStatsConfigType::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 = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "coreStatsConfig") == 0)
    {
        if (__index < coreStatsConfigCount)
        {
            __result = coreStatsConfig[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

bool AECXCoreStatsConfigType::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::Int32, (double)moduleID, 0));
    }
    else if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)moduleID, 0));
    }

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

    return __result;
}

bool AECXCoreStatsConfigType::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;

    (void)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 AECXCoreStatsConfigType::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;

    (void)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 AECXCoreStatsConfigType::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;

    (void)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 AECXCoreStatsConfigType::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;

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

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

    return __result;
}

bool AECXCoreStatsConfigType::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;

    (void)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 AECXCoreStatsConfigType::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;

    (void)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;
}

bool ChannelWeightsType::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;

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

    if (PARAMETER_STRCMP(__name, "ChannelWeights") == 0)
    {
        if (__index < ChannelWeightsFixedCount)
        {
            ParameterUtils::DoubleToString((double)ChannelWeights[__index], __value, __size);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < ChannelWeightsFixedCount; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)ChannelWeights[i], &__value[__valuePos], (INT32)(__size - __valuePos));
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "count") == 0)
    {
        ParameterUtils::DoubleToString((double)count, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool ChannelWeightsType::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;

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

    if (PARAMETER_STRCMP(__name, "ChannelWeights") == 0)
    {
        if (__index < ChannelWeightsFixedCount)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                ChannelWeights[__index] = (float)dblValue; 
            }
        }
        else
        {
            const SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __valuePos = 0;

            __index = 0;
            while (__valuePos < __valueLen && __index < ChannelWeightsFixedCount)
            {
                CHAR __valueStr[MAX_SIZE];

                __valuePos += ParameterUtils::GetSubString(&__value[__valuePos], ',', __valueStr, MAX_SIZE);
                __valuePos++;

                const double dblValue = ParameterUtils::StringToDouble(__valueStr, __result);
                if (__result)
                {
                    ChannelWeights[__index] = (float)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "count") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            count = (INT32)dblValue; 
        }
    }

    return __result;
}

bool ChannelWeightsType::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;

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

    // ChannelWeights
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("ChannelWeights", ParameterParserDataType::Float, true, false, ChannelWeightsFixedCount));
    }

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

    return __result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXCoreStatsConfigTypeClass::AECXCoreStatsConfigTypeClass(
    const CHAR* name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(coreStatsConfigCount);
    PARAMETER_INITIALIZE(coreStatsConfig);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXCoreStatsConfigTypeClass::AECXCoreStatsConfigTypeClass(
    const CHAR*       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(coreStatsConfig);
}

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


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load gridOptimizationType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void gridOptimizationType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(enableOnlyInROI);
    PARAMETER_INITIALIZE(subSampling);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xea843951f7528c42;
        entry->ReadSimpleTypeFixedArray(&enableOnlyInROI, 1, localParams);
        localParams.NameHash = 0xe8dc216e68b5e92d;
        entry->ReadEnumFixedArray(&subSampling, 1, localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void gridOptimizationType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        gridOptimizationType* arrayPtr = (gridOptimizationType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* gridOptimizationType::AllocArray(
    UINT32 __count)
{
    gridOptimizationType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW gridOptimizationType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load ParamExtensionType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void ParamExtensionType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(Name);
    PARAMETER_INITIALIZE(dataCount);
    PARAMETER_INITIALIZE(data);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xa8a406624050bf0c;
        entry->ReadStringFixedArray(&Name, 1, localParams, __COUNTER__);
        localParams.NameHash = 0x8c93b82417321453;
        entry->ReadSimpleTypeArray(data, dataCount, dataID, 1,
            localParams, __COUNTER__);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void ParamExtensionType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        ParamExtensionType* arrayPtr = (ParamExtensionType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* ParamExtensionType::AllocArray(
    UINT32 __count)
{
    ParamExtensionType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW ParamExtensionType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load ResolutionType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void ResolutionType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(width);
    PARAMETER_INITIALIZE(height);
    PARAMETER_INITIALIZE(binCount);
    PARAMETER_INITIALIZE(bitDepth);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0x95e3f2e09f80d163;
        entry->ReadSimpleTypeFixedArray(&width, 1, localParams);
        localParams.NameHash = 0xc392d392df42a99b;
        entry->ReadSimpleTypeFixedArray(&height, 1, localParams);
        localParams.NameHash = 0x8f29e7679e7e0416;
        entry->ReadSimpleTypeFixedArray(&binCount, 1, localParams);
        localParams.NameHash = 0xaab439c4c2ada27b;
        entry->ReadSimpleTypeFixedArray(&bitDepth, 1, localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void ResolutionType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        ResolutionType* arrayPtr = (ResolutionType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* ResolutionType::AllocArray(
    UINT32 __count)
{
    ResolutionType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW ResolutionType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load channelProcessType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void channelProcessType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(channelSel);
    PARAMETER_INITIALIZE(computeMethod);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xa7a34415adce485a;
        entry->ReadSimpleTypeFixedArray(&channelSel, 1, localParams);
        localParams.NameHash = 0xa1c54bb0b4b701e9;
        entry->ReadEnumFixedArray(&computeMethod, 1, localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void channelProcessType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        channelProcessType* arrayPtr = (channelProcessType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* channelProcessType::AllocArray(
    UINT32 __count)
{
    channelProcessType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW channelProcessType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load AECCoreStatsType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECCoreStatsType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(enable);
    PARAMETER_INITIALIZE(HWStatsID);
    PARAMETER_INITIALIZE(exposureType);
    PARAMETER_INITIALIZE(StatsProcesser);
    PARAMETER_INITIALIZE(outResolution);
    PARAMETER_INITIALIZE(outStatsType);
    PARAMETER_INITIALIZE(outChannelName);
    PARAMETER_INITIALIZE(extensionParamCount);
    PARAMETER_INITIALIZE(extensionParam);
    PARAMETER_INITIALIZE(gridOptimization);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xb3c00adf8e304e57;
        entry->ReadSimpleTypeFixedArray(&enable, 1, localParams);
        localParams.NameHash = 0xce4bdf33810c2c61;
        entry->ReadEnumFixedArray(&HWStatsID, 1, localParams);
        localParams.NameHash = 0xfda6dd830f4f8886;
        entry->ReadEnumFixedArray(&exposureType, 1, localParams);
        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xe82b37b6953ae10b;
        StatsProcesser.Load(localParams);
        localParams.NameHash        = 0xc721dc1787b13905;
        outResolution.Load(localParams);
        localParams.NameHash = 0xcc0951726335617b;
        entry->ReadEnumFixedArray(&outStatsType, 1, localParams);
        localParams.NameHash = 0x8e84b729e38ff041;
        entry->ReadStringFixedArray(&outChannelName, 1, localParams, __COUNTER__);
        localParams.NameHash = 0xc99912cc5145a4aa;
        entry->ReadStructureArray(extensionParam, extensionParamCount, extensionParamID, 1, localParams, __COUNTER__);
        localParams.NameHash        = 0xe0701bc9708e4106;
        gridOptimization.Load(localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void AECCoreStatsType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        AECCoreStatsType* arrayPtr = (AECCoreStatsType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* AECCoreStatsType::AllocArray(
    UINT32 __count)
{
    AECCoreStatsType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW AECCoreStatsType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load AECXCoreStatsConfigType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXCoreStatsConfigType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(coreStatsConfigCount);
    PARAMETER_INITIALIZE(coreStatsConfig);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xe11cd9f365a2599f;
        module_version.Load(localParams);
        localParams.NameHash        = 0xca3106e199a12935;
        parameter_version.Load(localParams);
        localParams.NameHash = 0xb5bb6c7a408ed007;
        entry->ReadSimpleTypeFixedArray(&moduleID, 1, localParams);
        localParams.NameHash = 0x84aab3601f081ea3;
        entry->ReadStructureArray(coreStatsConfig, coreStatsConfigCount, coreStatsConfigID, 1, localParams, __COUNTER__);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void AECXCoreStatsConfigType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        AECXCoreStatsConfigType* arrayPtr = (AECXCoreStatsConfigType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* AECXCoreStatsConfigType::AllocArray(
    UINT32 __count)
{
    AECXCoreStatsConfigType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW AECXCoreStatsConfigType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXCoreStatsConfigType::module_versionStruct::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(major_revision);
    PARAMETER_INITIALIZE(minor_revision);
    PARAMETER_INITIALIZE(incr_revision);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xcd66249477636693;
        entry->ReadSimpleTypeFixedArray(&major_revision, 1, localParams);
        localParams.NameHash = 0xc5497493137a9c25;
        entry->ReadSimpleTypeFixedArray(&minor_revision, 1, localParams);
        localParams.NameHash = 0xb27b8a668efb2a56;
        entry->ReadSimpleTypeFixedArray(&incr_revision, 1, localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void AECXCoreStatsConfigType::module_versionStruct::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        module_versionStruct* arrayPtr = (module_versionStruct*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* AECXCoreStatsConfigType::module_versionStruct::AllocArray(
    UINT32 __count)
{
    module_versionStruct* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW module_versionStruct[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXCoreStatsConfigType::parameter_versionStruct::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(revision);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xd594eed07a5650c5;
        entry->ReadStringFixedArray(&revision, 1, localParams, __COUNTER__);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void AECXCoreStatsConfigType::parameter_versionStruct::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        parameter_versionStruct* arrayPtr = (parameter_versionStruct*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* AECXCoreStatsConfigType::parameter_versionStruct::AllocArray(
    UINT32 __count)
{
    parameter_versionStruct* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW parameter_versionStruct[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load ChannelWeightsType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void ChannelWeightsType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(ChannelWeights);
    PARAMETER_INITIALIZE(count);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0x95f19236d2fb6585;
        entry->ReadSimpleTypeFixedArray<float>(ChannelWeights, ChannelWeightsFixedCount,
            localParams);
        localParams.NameHash = 0xe7190ff1df19094b;
        entry->ReadSimpleTypeFixedArray(&count, 1, localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void ChannelWeightsType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        ChannelWeightsType* arrayPtr = (ChannelWeightsType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* ChannelWeightsType::AllocArray(
    UINT32 __count)
{
    ChannelWeightsType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW ChannelWeightsType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload ParamExtensionType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void ParamExtensionType::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, Name);
    ParameterFileSymbolTable::ReleaseObject(__table, data);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload AECCoreStatsType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECCoreStatsType::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, outChannelName);
    for (UINT32 i = 0; extensionParam != nullptr && i < extensionParamCount; i++)
    {
        extensionParam[i].Unload(__table);
    }
    ParameterFileSymbolTable::ReleaseObject(__table, extensionParam);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload AECXCoreStatsConfigType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXCoreStatsConfigType::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
    for (UINT32 i = 0; coreStatsConfig != nullptr && i < coreStatsConfigCount; i++)
    {
        coreStatsConfig[i].Unload(__table);
    }
    ParameterFileSymbolTable::ReleaseObject(__table, coreStatsConfig);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXCoreStatsConfigType::parameter_versionStruct::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, revision);
}

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetModuleName: Returns ParameterModule::Name variable
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const CHAR* AECXCoreStatsConfigType::GetModuleName()
{
    return ((AECXCoreStatsConfigTypeClass*)this)->Name;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetModuleName: Returns ParameterModule::NameHash variable
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
UINT64 AECXCoreStatsConfigType::GetModuleNameHash()
{
    return ((AECXCoreStatsConfigTypeClass*)this)->NameHash;
}

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

    if (IsModuleMatch(moduleData) && 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 = (AECXCoreStatsConfigTypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW AECXCoreStatsConfigTypeClass(Name, moduleData);
            cls->SymbolTableID = id;
            defModule->AddModule((ParameterModule*)cls);
        }
    }
    else if (Version.Value != moduleData->Version.Value)
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create AECXCoreStatsConfigTypeClass, binary version (%lld) does not match source version (%lld)\n",
            moduleData->Version.Value, Version.Value);
    }
    else
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create AECXCoreStatsConfigTypeClass, binary name hash (0x%016llx) does not match source name hash (0x%016llx)\n",
            moduleData->NameHash, NameHash);
    }

    return (ParameterModule*)cls;
}

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

#ifdef PARAMETER_USE_MUTEX
    ParameterMutexLocker lock(Mutex); // Unique LOCK
#endif

    if (!Loaded)
    {
        AECXCoreStatsConfigTypeClass* 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 & 0x00ffffffU);

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


        ParameterDefinitionElement* _element = nullptr;
        if (table->ModuleDefinitions != nullptr && !table->ModuleDefinitions->empty())
        {
            _element = table->BuildModuleElement(NameHash);
        }

        ParameterLoadParameters parentParams(entry, NameHash, true, true, _element, entry->Position, 0, ParameterFileSymbolTableEntry::LOAD_LIMIT_MAX);
        cls->Load(parentParams);
        PARAMETER_DELETE _element;
        Modified++;
        Loaded = true;
    }

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

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload module data
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXCoreStatsConfigTypeClass::UnloadModule()
{
#ifdef PARAMETER_USE_MUTEX
    ParameterMutexLocker lock(Mutex); // Unique LOCK
#endif

    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 AECXCoreStatsConfigTypeClass::Release()
{
    ParameterModule::Release();
}

AECXCORESTATSCONFIG_NAMESPACE_END
