////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All rights reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// THIS IS AUTO-GENERATED CODE.  PLEASE DO NOT EDIT (File bug reports against tools).
///
/// Auto-generated by: Parameter Parser V7.4.1 (8cca6579792b9fcef3bc725ff070c5ec453c7c85)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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

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

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

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

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

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

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

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

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

    return __result;
}

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

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

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

    return __result;
}

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

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

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

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

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

    return __result;
}

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

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

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

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

    return __result;
}

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

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

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

    return __result;
}

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


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load LUTRangeResolution
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void LUTRangeResolution::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(bCheckAgainstCurrRange);
    PARAMETER_INITIALIZE(modifyBeforeDiscard);

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

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

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

        localParams.NameHash = 0xb1226a79659462a9;
        entry->ReadSimpleTypeFixedArray(&bCheckAgainstCurrRange, 1, localParams);
        localParams.NameHash = 0xa999db717c5f4afd;
        entry->ReadSimpleTypeFixedArray(&modifyBeforeDiscard, 1, localParams);

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load LUTConflictHandling
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void LUTConflictHandling::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(enforceTime);
    PARAMETER_INITIALIZE(enforceGain);
    PARAMETER_INITIALIZE(applyCondition);

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

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

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

        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xdf9fec80c5b2fdaf;
        enforceTime.Load(localParams);
        localParams.NameHash        = 0x8b97c63867d6bc86;
        enforceGain.Load(localParams);
        localParams.NameHash = 0x955de24fa6db3c13;
        entry->ReadEnumFixedArray(&applyCondition, 1, localParams);

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load LUTKeyType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void LUTKeyType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(source);
    PARAMETER_INITIALIZE(arbKey);
    PARAMETER_INITIALIZE(bankID);
    PARAMETER_INITIALIZE(dataID);

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

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

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

        localParams.NameHash = 0xae9a0e57576b7a72;
        entry->ReadEnumFixedArray(&source, 1, localParams);
        localParams.NameHash = 0xe6597e86792d00a3;
        entry->ReadEnumFixedArray(&arbKey, 1, localParams);
        localParams.NameHash = 0xb0f9b2597f48fdb7;
        entry->ReadEnumFixedArray(&bankID, 1, localParams);
        localParams.NameHash = 0xeda696b9df26939b;
        entry->ReadSimpleTypeFixedArray(&dataID, 1, localParams);

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load LUTType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void LUTType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(keyType1);
    PARAMETER_INITIALIZE(keyType2);
    PARAMETER_INITIALIZE(outType);
    PARAMETER_INITIALIZE(conflictHandling);
    PARAMETER_INITIALIZE(triggerDataCount);
    PARAMETER_INITIALIZE(triggerData);

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

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

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

        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xa329a5083e8762f8;
        keyType1.Load(localParams);
        localParams.NameHash        = 0xea051a6923cb9ef6;
        keyType2.Load(localParams);
        localParams.NameHash = 0xd9ad53d0ea883cd6;
        entry->ReadEnumFixedArray(&outType, 1, localParams);
        localParams.NameHash        = 0xb1ceb0a31fbc4b04;
        conflictHandling.Load(localParams);
        localParams.NameHash = 0xd5dc9fcb428af073;
        entry->ReadStructureArray(triggerData, triggerDataCount, triggerDataID, 1, localParams, __COUNTER__);

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load DBArbitrationLUTPayload
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void DBArbitrationLUTPayload::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(dataID);
    PARAMETER_INITIALIZE(description);
    PARAMETER_INITIALIZE(value);

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

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

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

        localParams.NameHash = 0xeda696b9df26939b;
        entry->ReadSimpleTypeFixedArray(&dataID, 1, localParams);
        localParams.NameHash = 0x938412c624b5c1a1;
        entry->ReadStringFixedArray(&description, 1, localParams, __COUNTER__);
        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0x99e86049a1c11b8b;
        value.Load(localParams);

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load AECXDBArbitrationLUTType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXDBArbitrationLUTType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(dataBank);
    PARAMETER_INITIALIZE(dataCount);
    PARAMETER_INITIALIZE(data);

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

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

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

        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xe11cd9f365a2599f;
        module_version.Load(localParams);
        localParams.NameHash        = 0xca3106e199a12935;
        parameter_version.Load(localParams);
        localParams.NameHash        = 0x9f9db225b8d486ed;
        dataBank.Load(localParams);
        localParams.NameHash = 0x8c93b82417321453;
        entry->ReadStructureArray(data, dataCount, dataID, 1, localParams, __COUNTER__);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload DBArbitrationLUTPayload
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void DBArbitrationLUTPayload::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, description);
    value.Unload(__table);
}

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Release the ParameterModule object
/// Requires that this object was created via a ParameterSetManager::GetModule call
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void 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;
}

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

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

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

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

        ParameterModule* const module = defModule->Find(id);
        if (module != nullptr)
        {
            cls = (AECXDBArbitrationLUTTypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW AECXDBArbitrationLUTTypeClass(Name, 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 hash (0x%016llx) does not match source name hash (0x%016llx)\n",
            moduleData->NameHash, NameHash);
    }

    return (ParameterModule*)cls;
}

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

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

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

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


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

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

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

    return result;
}

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

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

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

AECXDBARBITRATIONLUT_NAMESPACE_END
