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

#include "aecxdbarbitrationlut.h"
#include "parametersetmanager.h"

AECXDBARBITRATIONLUT_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool LUTRangeResolution::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, "bCheckAgainstCurrRange") == 0)
    {
        ParameterUtils::DoubleToString((double)bCheckAgainstCurrRange, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "modifyBeforeDiscard") == 0)
    {
        ParameterUtils::DoubleToString((double)modifyBeforeDiscard, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool LUTRangeResolution::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, "bCheckAgainstCurrRange") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            bCheckAgainstCurrRange = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "modifyBeforeDiscard") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            modifyBeforeDiscard = (BOOL)dblValue; 
        }
    }

    return __result;
}

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

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

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

    return __result;
}

bool LUTConflictHandling::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, "enforceTime") == 0)
    {
        __result = enforceTime.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "enforceGain") == 0)
    {
        __result = enforceGain.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "applyCondition") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)applyCondition, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool LUTConflictHandling::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, "enforceTime") == 0)
    {
        __result = enforceTime.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "enforceGain") == 0)
    {
        __result = enforceGain.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "applyCondition") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            applyCondition = (ApplyConditionType)(UINT32)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

    return __result;
}

bool LUTKeyType::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, "source") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)source, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "arbKey") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)arbKey, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "bankID") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)bankID, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "dataID") == 0)
    {
        ParameterUtils::DoubleToString((double)dataID, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool LUTKeyType::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, "source") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            source = (KeySource)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "arbKey") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            arbKey = (KeyArbitrationType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "bankID") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            bankID = (aecxglobalelements::AECXBankIDType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "dataID") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            dataID = (INT32)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

    return __result;
}

bool LUTType::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, "keyType1") == 0)
    {
        __result = keyType1.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "keyType2") == 0)
    {
        __result = keyType2.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "outType") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)outType, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "conflictHandling") == 0)
    {
        __result = conflictHandling.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        if (__index < triggerDataCount)
        {
            __result = triggerData[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool LUTType::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, "keyType1") == 0)
    {
        __result = keyType1.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "keyType2") == 0)
    {
        __result = keyType2.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "outType") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            outType = (LUTOutType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "conflictHandling") == 0)
    {
        __result = conflictHandling.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        if (__index < triggerDataCount)
        {
            __result = triggerData[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

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

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

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

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

    return __result;
}

bool DBArbitrationLUTPayload::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, "dataID") == 0)
    {
        ParameterUtils::DoubleToString((double)dataID, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "description") == 0)
    {
        PARAMETER_STRCPY(__value, __size, description);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "value") == 0)
    {
        __result = value.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool DBArbitrationLUTPayload::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, "dataID") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            dataID = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "description") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }
    else if (PARAMETER_STRCMP(__name, "value") == 0)
    {
        __result = value.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

    return __result;
}

bool AECXDBArbitrationLUTType::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, "dataBank") == 0)
    {
        __result = dataBank.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "data") == 0)
    {
        if (__index < dataCount)
        {
            __result = data[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool AECXDBArbitrationLUTType::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, "dataBank") == 0)
    {
        __result = dataBank.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "data") == 0)
    {
        if (__index < dataCount)
        {
            __result = data[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

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

    return __result;
}

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

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

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

    return __result;
}

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

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

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(ApplyConditionType::ApplyIfValid):
            enumValue = ApplyConditionType::ApplyIfValid;
            result    = true;
            break;
        case static_cast<UINT32>(ApplyConditionType::ApplyIfSmallerThanCurrent):
            enumValue = ApplyConditionType::ApplyIfSmallerThanCurrent;
            result    = true;
            break;
        case static_cast<UINT32>(ApplyConditionType::ApplyIfLargerThanCurrent):
            enumValue = ApplyConditionType::ApplyIfLargerThanCurrent;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to ApplyConditionType", uintValue);
            break;
        }
    }
    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_LUTOutType(
    ParameterFileSymbolTableEntry* const entry,
    LUTOutType& enumValue,
    BYTE const alignment)
{
    bool result {false};

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

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(LUTOutType::ArbLutOutTime):
            enumValue = LUTOutType::ArbLutOutTime;
            result    = true;
            break;
        case static_cast<UINT32>(LUTOutType::ArbLutOutGain):
            enumValue = LUTOutType::ArbLutOutGain;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to LUTOutType", uintValue);
            break;
        }
    }
    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_KeyArbitrationType(
    ParameterFileSymbolTableEntry* const entry,
    KeyArbitrationType& enumValue,
    BYTE const alignment)
{
    bool result {false};

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

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(KeyArbitrationType::LUTKeyGain):
            enumValue = KeyArbitrationType::LUTKeyGain;
            result    = true;
            break;
        case static_cast<UINT32>(KeyArbitrationType::LUTKeyTime):
            enumValue = KeyArbitrationType::LUTKeyTime;
            result    = true;
            break;
        case static_cast<UINT32>(KeyArbitrationType::LUTKeyExposure):
            enumValue = KeyArbitrationType::LUTKeyExposure;
            result    = true;
            break;
        case static_cast<UINT32>(KeyArbitrationType::LUTKeyIndex):
            enumValue = KeyArbitrationType::LUTKeyIndex;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to KeyArbitrationType", uintValue);
            break;
        }
    }
    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_KeySource(
    ParameterFileSymbolTableEntry* const entry,
    KeySource& enumValue,
    BYTE const alignment)
{
    bool result {false};

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

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


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXDBArbitrationLUTTypeClass::AECXDBArbitrationLUTTypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(dataBank);
    PARAMETER_INITIALIZE(dataCount);
    PARAMETER_INITIALIZE(data);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXDBArbitrationLUTTypeClass::AECXDBArbitrationLUTTypeClass(
    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(dataBank);
    PARAMETER_INITIALIZE(data);
}

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

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

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

    PARAMETER_INITIALIZE(bCheckAgainstCurrRange);
    PARAMETER_INITIALIZE(modifyBeforeDiscard);

    SYMBOL_TABLE_ENTRY_READ(entry, result, bCheckAgainstCurrRange, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, modifyBeforeDiscard, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(enforceTime);
    PARAMETER_INITIALIZE(enforceGain);
    PARAMETER_INITIALIZE(applyCondition);

    result = enforceTime.Load(entry, alignment);
    if (result)
    {
        result = enforceGain.Load(entry, alignment);
    }
    if (result)
    {
        result = aecxdbarbitrationlut::ReadEnum_ApplyConditionType(entry, applyCondition, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(source);
    PARAMETER_INITIALIZE(arbKey);
    PARAMETER_INITIALIZE(bankID);
    PARAMETER_INITIALIZE(dataID);

    result = aecxdbarbitrationlut::ReadEnum_KeySource(entry, source, alignment);
    if (result)
    {
        result = aecxdbarbitrationlut::ReadEnum_KeyArbitrationType(entry, arbKey, alignment);
    }
    if (result)
    {
        result = aecxglobalelements::ReadEnum_AECXBankIDType(entry, bankID, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, dataID, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(keyType1);
    PARAMETER_INITIALIZE(keyType2);
    PARAMETER_INITIALIZE(outType);
    PARAMETER_INITIALIZE(conflictHandling);
    PARAMETER_INITIALIZE(triggerData);

    result = keyType1.Load(entry, alignment);
    if (result)
    {
        result = keyType2.Load(entry, alignment);
    }
    if (result)
    {
        result = aecxdbarbitrationlut::ReadEnum_LUTOutType(entry, outType, alignment);
    }
    if (result)
    {
        result = conflictHandling.Load(entry, alignment);
    }

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

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

    return result;
}

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

    PARAMETER_INITIALIZE(dataID);
    PARAMETER_INITIALIZE(description);
    PARAMETER_INITIALIZE(value);

    SYMBOL_TABLE_ENTRY_READ(entry, result, dataID, alignment)

    // Reading String description 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, description, count, alignment)
    }
    if (result)
    {
        result = value.Load(entry, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(dataBank);
    PARAMETER_INITIALIZE(data);

    result = module_version.Load(entry, alignment);
    if (result)
    {
        result = parameter_version.Load(entry, alignment);
    }
    if (result)
    {
        result = dataBank.Load(entry, 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 = (DBArbitrationLUTPayload*)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 = PARAMETER_NEW DBArbitrationLUTPayload[dataCount];
                    (void)pointerEntry->SetDupObject(data, dataCount, file, line);
                }
                if (!result || data == nullptr)
                {
                    if (dataCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate data\n");
                    }
                    dataCount = 0;
                }
                for (UINT32 i = 0; result && i < dataCount; i++)
                {
                    result = data[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (data == nullptr)
        {
            dataCount = 0;
        }
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool AECXDBArbitrationLUTType::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 AECXDBArbitrationLUTType::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 LUTType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void LUTType::Unload(ParameterFileSymbolTable* const __table)
{
    for (UINT32 i = 0; i < triggerDataCount; i++)
    {
        triggerData[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(triggerData))
    {
        PARAMETER_DELETE[] triggerData;
    }
    triggerData = nullptr;
}

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

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

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

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

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

    return (ParameterModule*)cls;
}

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

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

AECXDBARBITRATIONLUT_NAMESPACE_END
