////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 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  aecarbitration.cpp
/// @brief Auto-generated Chromatix parameter file
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include "aecarbitration.h"
#include "parametersetmanager.h"

AECARBITRATION_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool ISOSettingType::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, "previewISO100Gain") == 0)
    {
        ParameterUtils::DoubleToString((double)previewISO100Gain, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "enableAntiBandingVsISOPrio") == 0)
    {
        ParameterUtils::DoubleToString((double)enableAntiBandingVsISOPrio, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "enableISOQuantization") == 0)
    {
        ParameterUtils::DoubleToString((double)enableISOQuantization, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "thresQuantizationISOValue") == 0)
    {
        if (__index < thresQuantizationISOValueCount)
        {
            ParameterUtils::DoubleToString((double)thresQuantizationISOValue[__index], __value, __size);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < thresQuantizationISOValueCount; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)thresQuantizationISOValue[i], &__value[__valuePos], (INT32)(__size - __valuePos));
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "quantizedISOValue") == 0)
    {
        if (__index < quantizedISOValueCount)
        {
            ParameterUtils::DoubleToString((double)quantizedISOValue[__index], __value, __size);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < quantizedISOValueCount; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)quantizedISOValue[i], &__value[__valuePos], (INT32)(__size - __valuePos));
            }
            __result = true;
        }
    }

    return __result;
}

bool ISOSettingType::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, "previewISO100Gain") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            previewISO100Gain = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "enableAntiBandingVsISOPrio") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableAntiBandingVsISOPrio = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "enableISOQuantization") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableISOQuantization = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "thresQuantizationISOValue") == 0)
    {
        if (__index < thresQuantizationISOValueCount)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                thresQuantizationISOValue[__index] = (float)dblValue; 
            }
        }
        else
        {
            SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __pos = 0;

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

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

                const double dblValue = ParameterUtils::StringToDouble(__valueStr, __result);
                if (__result)
                {
                    thresQuantizationISOValue[__index] = (float)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "quantizedISOValue") == 0)
    {
        if (__index < quantizedISOValueCount)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                quantizedISOValue[__index] = (float)dblValue; 
            }
        }
        else
        {
            SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __pos = 0;

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

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

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

    return __result;
}

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

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

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

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

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

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

    return __result;
}

bool ExposureKneeType::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, "gain") == 0)
    {
        ParameterUtils::DoubleToString((double)gain, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "expTime") == 0)
    {
        ParameterUtils::DoubleToString((double)expTime, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "incrementPriority") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)incrementPriority, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "expIndex") == 0)
    {
        ParameterUtils::DoubleToString((double)expIndex, __value, __size);
        __result = true;
    }

    return __result;
}

bool ExposureKneeType::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, "gain") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            gain = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "expTime") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            expTime = (UINT64)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "incrementPriority") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            incrementPriority = (aecglobalelements::AECExpIncPrioType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "expIndex") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            expIndex = (float)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

    return __result;
}

bool ExposureTableType::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, "sensitivityCorrectionFactor") == 0)
    {
        ParameterUtils::DoubleToString((double)sensitivityCorrectionFactor, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "expKneeEntries") == 0)
    {
        if (__index < expKneeEntriesCount)
        {
            __result = expKneeEntries[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "thresAntiBandingMinExpTimePct") == 0)
    {
        ParameterUtils::DoubleToString((double)thresAntiBandingMinExpTimePct, __value, __size);
        __result = true;
    }

    return __result;
}

bool ExposureTableType::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, "sensitivityCorrectionFactor") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            sensitivityCorrectionFactor = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "expKneeEntries") == 0)
    {
        if (__index < expKneeEntriesCount)
        {
            __result = expKneeEntries[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "thresAntiBandingMinExpTimePct") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            thresAntiBandingMinExpTimePct = (float)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

    return __result;
}

bool AECCoreArbitrationType::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, "expTables") == 0)
    {
        if (__index < expTablesCount)
        {
            __result = expTables[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "minPreviewVertBlankTime") == 0)
    {
        ParameterUtils::DoubleToString((double)minPreviewVertBlankTime, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "enableEVExpTableAdj") == 0)
    {
        ParameterUtils::DoubleToString((double)enableEVExpTableAdj, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "enableEVGainCapping") == 0)
    {
        ParameterUtils::DoubleToString((double)enableEVGainCapping, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "maxEVCappingGain") == 0)
    {
        ParameterUtils::DoubleToString((double)maxEVCappingGain, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "ISOData") == 0)
    {
        __result = ISOData.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "antibandingVsFPSMethod") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)antibandingVsFPSMethod, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "enablePreviewManualISO") == 0)
    {
        ParameterUtils::DoubleToString((double)enablePreviewManualISO, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "enablePreviewManualExpTime") == 0)
    {
        ParameterUtils::DoubleToString((double)enablePreviewManualExpTime, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "enablePreviewManualFull") == 0)
    {
        ParameterUtils::DoubleToString((double)enablePreviewManualFull, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "disableBandingGainCapping") == 0)
    {
        ParameterUtils::DoubleToString((double)disableBandingGainCapping, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool AECCoreArbitrationType::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, "expTables") == 0)
    {
        if (__index < expTablesCount)
        {
            __result = expTables[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "minPreviewVertBlankTime") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            minPreviewVertBlankTime = (UINT64)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "enableEVExpTableAdj") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableEVExpTableAdj = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "enableEVGainCapping") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableEVGainCapping = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "maxEVCappingGain") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            maxEVCappingGain = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "ISOData") == 0)
    {
        __result = ISOData.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "antibandingVsFPSMethod") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            antibandingVsFPSMethod = (aecglobalelements::AECAntibandingVsFPSMethod)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "enablePreviewManualISO") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enablePreviewManualISO = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "enablePreviewManualExpTime") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enablePreviewManualExpTime = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "enablePreviewManualFull") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enablePreviewManualFull = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "disableBandingGainCapping") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            disableBandingGainCapping = (BOOL)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

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

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

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

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

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

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

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

    return __result;
}

bool AECCoreArbitrationType::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 AECCoreArbitrationType::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 AECCoreArbitrationType::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 AECCoreArbitrationType::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 AECCoreArbitrationType::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 AECCoreArbitrationType::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;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECCoreArbitrationTypeClass::AECCoreArbitrationTypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(expTablesCount);
    PARAMETER_INITIALIZE(expTables);
    PARAMETER_INITIALIZE(minPreviewVertBlankTime);
    PARAMETER_INITIALIZE(enableEVExpTableAdj);
    PARAMETER_INITIALIZE(enableEVGainCapping);
    PARAMETER_INITIALIZE(maxEVCappingGain);
    PARAMETER_INITIALIZE(ISOData);
    PARAMETER_INITIALIZE(antibandingVsFPSMethod);
    PARAMETER_INITIALIZE(enablePreviewManualISO);
    PARAMETER_INITIALIZE(enablePreviewManualExpTime);
    PARAMETER_INITIALIZE(enablePreviewManualFull);
    PARAMETER_INITIALIZE(disableBandingGainCapping);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECCoreArbitrationTypeClass::AECCoreArbitrationTypeClass(
    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(expTables);
    PARAMETER_INITIALIZE(minPreviewVertBlankTime);
    PARAMETER_INITIALIZE(enableEVExpTableAdj);
    PARAMETER_INITIALIZE(enableEVGainCapping);
    PARAMETER_INITIALIZE(maxEVCappingGain);
    PARAMETER_INITIALIZE(ISOData);
    PARAMETER_INITIALIZE(antibandingVsFPSMethod);
    PARAMETER_INITIALIZE(enablePreviewManualISO);
    PARAMETER_INITIALIZE(enablePreviewManualExpTime);
    PARAMETER_INITIALIZE(enablePreviewManualFull);
    PARAMETER_INITIALIZE(disableBandingGainCapping);
}

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

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

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

    PARAMETER_INITIALIZE(previewISO100Gain);
    PARAMETER_INITIALIZE(enableAntiBandingVsISOPrio);
    PARAMETER_INITIALIZE(enableISOQuantization);
    PARAMETER_INITIALIZE(thresQuantizationISOValue);
    PARAMETER_INITIALIZE(quantizedISOValue);

    SYMBOL_TABLE_ENTRY_READ(entry, result, previewISO100Gain, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, enableAntiBandingVsISOPrio, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, enableISOQuantization, alignment)

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

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

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

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

    return result;
}

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

    PARAMETER_INITIALIZE(gain);
    PARAMETER_INITIALIZE(expTime);
    PARAMETER_INITIALIZE(incrementPriority);
    PARAMETER_INITIALIZE(expIndex);

    SYMBOL_TABLE_ENTRY_READ(entry, result, gain, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, expTime, alignment)
    if (result)
    {
        result = aecglobalelements::ReadEnum_AECExpIncPrioType(entry, incrementPriority, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, expIndex, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(sensitivityCorrectionFactor);
    PARAMETER_INITIALIZE(expKneeEntries);
    PARAMETER_INITIALIZE(thresAntiBandingMinExpTimePct);

    SYMBOL_TABLE_ENTRY_READ(entry, result, sensitivityCorrectionFactor, alignment)

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

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

    return result;
}

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

    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(expTables);
    PARAMETER_INITIALIZE(minPreviewVertBlankTime);
    PARAMETER_INITIALIZE(enableEVExpTableAdj);
    PARAMETER_INITIALIZE(enableEVGainCapping);
    PARAMETER_INITIALIZE(maxEVCappingGain);
    PARAMETER_INITIALIZE(ISOData);
    PARAMETER_INITIALIZE(antibandingVsFPSMethod);
    PARAMETER_INITIALIZE(enablePreviewManualISO);
    PARAMETER_INITIALIZE(enablePreviewManualExpTime);
    PARAMETER_INITIALIZE(enablePreviewManualFull);
    PARAMETER_INITIALIZE(disableBandingGainCapping);

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

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

            if (expTables == nullptr)
            {
                if (result && expTablesCount > 0)
                {
                    expTables = PARAMETER_NEW ExposureTableType[expTablesCount];
                    (void)pointerEntry->SetDupObject(expTables, expTablesCount, file, line);
                }
                if (!result || expTables == nullptr)
                {
                    if (expTablesCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate expTables\n");
                    }
                    expTablesCount = 0;
                }
                for (UINT32 i = 0; result && i < expTablesCount; i++)
                {
                    result = expTables[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (expTables == nullptr)
        {
            expTablesCount = 0;
        }
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, minPreviewVertBlankTime, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, enableEVExpTableAdj, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, enableEVGainCapping, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, maxEVCappingGain, alignment)
    if (result)
    {
        result = ISOData.Load(entry, alignment);
    }
    if (result)
    {
        result = aecglobalelements::ReadEnum_AECAntibandingVsFPSMethod(entry, antibandingVsFPSMethod, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, enablePreviewManualISO, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, enablePreviewManualExpTime, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, enablePreviewManualFull, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, disableBandingGainCapping, alignment)

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool AECCoreArbitrationType::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 AECCoreArbitrationType::parameter_versionStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(revision);


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

    return result;
}

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECCoreArbitrationType::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 AECCoreArbitrationType::Release()
{
    ((AECCoreArbitrationTypeClass*)this)->Release();
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Create module, and return a new object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ParameterModule* AECCoreArbitrationTypeClass::Create(
    ModuleData*    moduleData,
    DefaultModule* const defModule) const
{
    AECCoreArbitrationTypeClass* 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 = (AECCoreArbitrationTypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW AECCoreArbitrationTypeClass(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 AECCoreArbitrationTypeClass, binary version (%lld) does not match source version (%lld)\n",
            moduleData->Version.Value, Version.Value);
    }
    else
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create AECCoreArbitrationTypeClass, binary name (%s) does not match source name (%s)\n",
            moduleData->Type, Type);
    }

    return (ParameterModule*)cls;
}

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

    if (!Loaded)
    {
        BYTE const alignment = table->Alignment;
        AECCoreArbitrationTypeClass* 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, "AECCoreArbitrationTypeClass::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 AECCoreArbitrationTypeClass::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 AECCoreArbitrationTypeClass::Release()
{
    ParameterModule::Release();
}

AECARBITRATION_NAMESPACE_END
