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

    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;

    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;

    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;

    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;

    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
        {
            SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __pos = 0;

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

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

                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;

    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;

    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;

    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;

    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;

    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;

    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;

    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;

    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;

    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;

    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;

    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;

    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;

    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;

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

    if (PARAMETER_STRCMP(__name, "ChannelWeights") == 0)
    {
        if (__index < 4)
        {
            ParameterUtils::DoubleToString((double)ChannelWeights[__index], __value, __size);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < 4; 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;

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

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

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

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

                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;

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @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_channelComputeMethod(
    ParameterFileSymbolTableEntry* const entry,
    channelComputeMethod& enumValue,
    BYTE const alignment)
{
    bool result {false};

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

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(channelComputeMethod::Grid_CalculateLuma):
            enumValue = channelComputeMethod::Grid_CalculateLuma;
            result    = true;
            break;
        case static_cast<UINT32>(channelComputeMethod::Grid_CalculateSatCnt):
            enumValue = channelComputeMethod::Grid_CalculateSatCnt;
            result    = true;
            break;
        case static_cast<UINT32>(channelComputeMethod::Grid_CalculateRG):
            enumValue = channelComputeMethod::Grid_CalculateRG;
            result    = true;
            break;
        case static_cast<UINT32>(channelComputeMethod::Grid_CalculateBG):
            enumValue = channelComputeMethod::Grid_CalculateBG;
            result    = true;
            break;
        case static_cast<UINT32>(channelComputeMethod::Hist_CopySelChannel):
            enumValue = channelComputeMethod::Hist_CopySelChannel;
            result    = true;
            break;
        case static_cast<UINT32>(channelComputeMethod::BFW_CalculateLuma):
            enumValue = channelComputeMethod::BFW_CalculateLuma;
            result    = true;
            break;
        case static_cast<UINT32>(channelComputeMethod::BFW_CalculateSatCnt):
            enumValue = channelComputeMethod::BFW_CalculateSatCnt;
            result    = true;
            break;
        case static_cast<UINT32>(channelComputeMethod::BFW_CalculateRG):
            enumValue = channelComputeMethod::BFW_CalculateRG;
            result    = true;
            break;
        case static_cast<UINT32>(channelComputeMethod::BFW_CalculateBG):
            enumValue = channelComputeMethod::BFW_CalculateBG;
            result    = true;
            break;
        case static_cast<UINT32>(channelComputeMethod::ChannelComputeMethodMax):
            enumValue = channelComputeMethod::ChannelComputeMethodMax;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to channelComputeMethod", uintValue);
            break;
        }
    }
    return result;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXCoreStatsConfigTypeClass::AECXCoreStatsConfigTypeClass(
    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(coreStatsConfigCount);
    PARAMETER_INITIALIZE(coreStatsConfig);
}

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

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

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

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

    PARAMETER_INITIALIZE(enableOnlyInROI);
    PARAMETER_INITIALIZE(subSampling);

    SYMBOL_TABLE_ENTRY_READ(entry, result, enableOnlyInROI, alignment)
    if (result)
    {
        result = aecxglobalelements::ReadEnum_AECXSubSamplingType(entry, subSampling, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(Name);
    PARAMETER_INITIALIZE(data);


    // Reading String Name 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, Name, count, alignment)
    }

    // Reading Array data from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        dataCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, dataCount, 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)
        {
            dataID = pointerEntry->ID;
            DupObjInfo* dataDupInfo = pointerEntry->GetDupObject(dataCount, file, line);
            if (dataDupInfo != nullptr && dataDupInfo->Object != nullptr)
            {
                data = (float*)dataDupInfo->Object;
                if (data == nullptr)
                {
                    if (dataDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "data duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            dataDupInfo->File, dataDupInfo->Line, dataDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "data duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            dataDupInfo->Line, dataDupInfo->RefCount);
                    }
                }
            }

            if (data == nullptr)
            {
                if (result && dataCount > 0)
                {
                    data = pointerEntry->ReadArray<float>(dataCount, alignment);
                    result = data != nullptr;
                }
                if (!result || data == nullptr)
                {
                    if (dataCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate data\n");
                    }
                    dataCount = 0;
                }
            }
        }
        if (data == nullptr)
        {
            dataCount = 0;
        }
    }

    return result;
}

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

    PARAMETER_INITIALIZE(width);
    PARAMETER_INITIALIZE(height);
    PARAMETER_INITIALIZE(binCount);
    PARAMETER_INITIALIZE(bitDepth);

    SYMBOL_TABLE_ENTRY_READ(entry, result, width, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, height, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, binCount, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, bitDepth, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(channelSel);
    PARAMETER_INITIALIZE(computeMethod);

    SYMBOL_TABLE_ENTRY_READ(entry, result, channelSel, alignment)
    if (result)
    {
        result = aecxcorestatsconfig::ReadEnum_channelComputeMethod(entry, computeMethod, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(enable);
    PARAMETER_INITIALIZE(HWStatsID);
    PARAMETER_INITIALIZE(exposureType);
    PARAMETER_INITIALIZE(StatsProcesser);
    PARAMETER_INITIALIZE(outResolution);
    PARAMETER_INITIALIZE(outStatsType);
    PARAMETER_INITIALIZE(outChannelName);
    PARAMETER_INITIALIZE(extensionParam);
    PARAMETER_INITIALIZE(gridOptimization);

    SYMBOL_TABLE_ENTRY_READ(entry, result, enable, alignment)
    if (result)
    {
        result = aecxglobalelements::ReadEnum_AECHWStatsInputType(entry, HWStatsID, alignment);
    }
    if (result)
    {
        result = aecxglobalelements::ReadEnum_AECXExposureSelection(entry, exposureType, alignment);
    }
    if (result)
    {
        result = StatsProcesser.Load(entry, alignment);
    }
    if (result)
    {
        result = outResolution.Load(entry, alignment);
    }
    if (result)
    {
        result = aecxglobalelements::ReadEnum_AECXStatsType(entry, outStatsType, alignment);
    }

    // Reading String outChannelName 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, outChannelName, count, alignment)
    }

    // Reading Array extensionParam from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        extensionParamCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, extensionParamCount, 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)
        {
            extensionParamID = pointerEntry->ID;
            DupObjInfo* extensionParamDupInfo = pointerEntry->GetDupObject(extensionParamCount, file, line);
            if (extensionParamDupInfo != nullptr && extensionParamDupInfo->Object != nullptr)
            {
                extensionParam = (ParamExtensionType*)extensionParamDupInfo->Object;
                if (extensionParam == nullptr)
                {
                    if (extensionParamDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "extensionParam duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            extensionParamDupInfo->File, extensionParamDupInfo->Line, extensionParamDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "extensionParam duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            extensionParamDupInfo->Line, extensionParamDupInfo->RefCount);
                    }
                }
            }

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

    return result;
}

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

    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(coreStatsConfig);

    result = module_version.Load(entry, alignment);
    if (result)
    {
        result = parameter_version.Load(entry, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, moduleID, alignment)

    // Reading Array coreStatsConfig from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        coreStatsConfigCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, coreStatsConfigCount, 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)
        {
            coreStatsConfigID = pointerEntry->ID;
            DupObjInfo* coreStatsConfigDupInfo = pointerEntry->GetDupObject(coreStatsConfigCount, file, line);
            if (coreStatsConfigDupInfo != nullptr && coreStatsConfigDupInfo->Object != nullptr)
            {
                coreStatsConfig = (AECCoreStatsType*)coreStatsConfigDupInfo->Object;
                if (coreStatsConfig == nullptr)
                {
                    if (coreStatsConfigDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "coreStatsConfig duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            coreStatsConfigDupInfo->File, coreStatsConfigDupInfo->Line, coreStatsConfigDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "coreStatsConfig duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            coreStatsConfigDupInfo->Line, coreStatsConfigDupInfo->RefCount);
                    }
                }
            }

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

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool AECXCoreStatsConfigType::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 AECXCoreStatsConfigType::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;
}

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

    PARAMETER_INITIALIZE(ChannelWeights);
    PARAMETER_INITIALIZE(count);

    result = entry->ReadArray(ChannelWeights, 4, alignment);
    SYMBOL_TABLE_ENTRY_READ(entry, result, count, alignment)

    return result;
}

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXCoreStatsConfigType::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 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;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Create module, and return a new object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ParameterModule* AECXCoreStatsConfigTypeClass::Create(
    ModuleData*    moduleData,
    DefaultModule* const defModule) const
{
    AECXCoreStatsConfigTypeClass* 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 = (AECXCoreStatsConfigTypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW AECXCoreStatsConfigTypeClass(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 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 (%s) does not match source name (%s)\n",
            moduleData->Type, Type);
    }

    return (ParameterModule*)cls;
}

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

    if (!Loaded)
    {
        BYTE const alignment = table->Alignment;
        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 & 0x00ffffff);

        if (!result)
        {
            PARAMETER_LOG_ERROR(entry->SetManager, "AECXCoreStatsConfigTypeClass::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 AECXCoreStatsConfigTypeClass::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 AECXCoreStatsConfigTypeClass::Release()
{
    ParameterModule::Release();
}

AECXCORESTATSCONFIG_NAMESPACE_END
