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

#include "aecxexternalmapprocessor.h"
#include "parametersetmanager.h"

AECXEXTERNALMAPPROCESSOR_NAMESPACE_BEGIN

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

    return __result;
}

bool OutputInfoType::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, "dataIDWeight2D") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            dataIDWeight2D = (INT32)dblValue; 
        }
    }

    return __result;
}

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

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

    return __result;
}

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

    return __result;
}

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

    return __result;
}

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

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

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

    return __result;
}

bool MapProcessorRangeType::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, "trigger1Data") == 0)
    {
        if (__index < trigger1DataCount)
        {
            __result = trigger1Data[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool MapProcessorRangeType::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, "trigger1Data") == 0)
    {
        if (__index < trigger1DataCount)
        {
            __result = trigger1Data[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

    return __result;
}

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

    return __result;
}

bool InputInfoType::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, "mapType") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            mapType = (ExternalMapType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "dataIDWeight2D") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            dataIDWeight2D = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "statsThres") == 0)
    {
        __result = statsThres.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

    return __result;
}

bool ExternalMapProcessorType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        ParameterUtils::DoubleToString((double)enable, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "description") == 0)
    {
        PARAMETER_STRCPY(__value, __size, description);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "input") == 0)
    {
        __result = input.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "output") == 0)
    {
        __result = output.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "validGridRatio") == 0)
    {
        ParameterUtils::DoubleToString((double)validGridRatio, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "validStateConsecutiveFrameCount") == 0)
    {
        ParameterUtils::DoubleToString((double)validStateConsecutiveFrameCount, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "invalidGridRatio") == 0)
    {
        ParameterUtils::DoubleToString((double)invalidGridRatio, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "invalidStateConsecutiveFrameCount") == 0)
    {
        ParameterUtils::DoubleToString((double)invalidStateConsecutiveFrameCount, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "timeoutGridRatio") == 0)
    {
        ParameterUtils::DoubleToString((double)timeoutGridRatio, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "timeoutStateConsecutiveFrameCount") == 0)
    {
        ParameterUtils::DoubleToString((double)timeoutStateConsecutiveFrameCount, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "spatialConsistencyStrength") == 0)
    {
        ParameterUtils::DoubleToString((double)spatialConsistencyStrength, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool ExternalMapProcessorType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enable = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "description") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }
    else if (PARAMETER_STRCMP(__name, "input") == 0)
    {
        __result = input.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "output") == 0)
    {
        __result = output.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "validGridRatio") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            validGridRatio = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "validStateConsecutiveFrameCount") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            validStateConsecutiveFrameCount = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "invalidGridRatio") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            invalidGridRatio = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "invalidStateConsecutiveFrameCount") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            invalidStateConsecutiveFrameCount = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "timeoutGridRatio") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            timeoutGridRatio = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "timeoutStateConsecutiveFrameCount") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            timeoutStateConsecutiveFrameCount = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "spatialConsistencyStrength") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            spatialConsistencyStrength = (UINT32)dblValue; 
        }
    }

    return __result;
}

bool ExternalMapProcessorType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

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

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

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

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

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

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

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

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

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

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

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

    return __result;
}

bool AECXExternalMapProcessorType::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, "externalMapProcessor") == 0)
    {
        if (__index < externalMapProcessorCount)
        {
            __result = externalMapProcessor[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool AECXExternalMapProcessorType::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, "externalMapProcessor") == 0)
    {
        if (__index < externalMapProcessorCount)
        {
            __result = externalMapProcessor[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

    return __result;
}

bool AECXExternalMapProcessorType::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 AECXExternalMapProcessorType::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 AECXExternalMapProcessorType::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 AECXExternalMapProcessorType::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 AECXExternalMapProcessorType::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 AECXExternalMapProcessorType::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_ExternalMapType(
    ParameterFileSymbolTableEntry* const entry,
    ExternalMapType& enumValue,
    BYTE const alignment)
{
    bool result {false};

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

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


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXExternalMapProcessorTypeClass::AECXExternalMapProcessorTypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(externalMapProcessorCount);
    PARAMETER_INITIALIZE(externalMapProcessor);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXExternalMapProcessorTypeClass::AECXExternalMapProcessorTypeClass(
    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(externalMapProcessor);
}

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

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

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

    PARAMETER_INITIALIZE(dataIDWeight2D);

    SYMBOL_TABLE_ENTRY_READ(entry, result, dataIDWeight2D, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(trigger1Lux);
    PARAMETER_INITIALIZE(triggerDataRange);

    result = trigger1Lux.Load(entry, alignment);
    if (result)
    {
        result = triggerDataRange.Load(entry, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(trigger1Data);


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

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

    return result;
}

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

    PARAMETER_INITIALIZE(mapType);
    PARAMETER_INITIALIZE(dataIDWeight2D);
    PARAMETER_INITIALIZE(statsThres);

    result = aecxexternalmapprocessor::ReadEnum_ExternalMapType(entry, mapType, alignment);
    SYMBOL_TABLE_ENTRY_READ(entry, result, dataIDWeight2D, alignment)
    if (result)
    {
        result = statsThres.Load(entry, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(enable);
    PARAMETER_INITIALIZE(description);
    PARAMETER_INITIALIZE(input);
    PARAMETER_INITIALIZE(output);
    PARAMETER_INITIALIZE(validGridRatio);
    PARAMETER_INITIALIZE(validStateConsecutiveFrameCount);
    PARAMETER_INITIALIZE(invalidGridRatio);
    PARAMETER_INITIALIZE(invalidStateConsecutiveFrameCount);
    PARAMETER_INITIALIZE(timeoutGridRatio);
    PARAMETER_INITIALIZE(timeoutStateConsecutiveFrameCount);
    PARAMETER_INITIALIZE(spatialConsistencyStrength);

    SYMBOL_TABLE_ENTRY_READ(entry, result, enable, 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 = input.Load(entry, alignment);
    }
    if (result)
    {
        result = output.Load(entry, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, validGridRatio, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, validStateConsecutiveFrameCount, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, invalidGridRatio, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, invalidStateConsecutiveFrameCount, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, timeoutGridRatio, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, timeoutStateConsecutiveFrameCount, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, spatialConsistencyStrength, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(externalMapProcessor);

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

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

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

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool AECXExternalMapProcessorType::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 AECXExternalMapProcessorType::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 MapProcessorRangeType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void MapProcessorRangeType::Unload(ParameterFileSymbolTable* const __table)
{
    if (__table != nullptr && __table->ReleaseDupObject(trigger1Data))
    {
        PARAMETER_DELETE[] trigger1Data;
    }
    trigger1Data = nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload InputInfoType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void InputInfoType::Unload(ParameterFileSymbolTable* const __table)
{
    statsThres.Unload(__table);
}

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

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

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

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

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

    return (ParameterModule*)cls;
}

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

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

AECXEXTERNALMAPPROCESSOR_NAMESPACE_END
