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

#include "modsaspatialgenv1.h"
#include "parametersetmanager.h"

MODSASPATIALGENV1_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool DistanceWeightsLevel1Type::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, "Description") == 0)
    {
        PARAMETER_STRCPY(__value, __size, Description);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        ParameterUtils::DoubleToString((double)enableFlag, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "weights") == 0)
    {
        __result = weights.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

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

    return __result;
}

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

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

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

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

    return __result;
}

bool IntensityWeightsLevel1Type::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, "Description") == 0)
    {
        PARAMETER_STRCPY(__value, __size, Description);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        ParameterUtils::DoubleToString((double)enableFlag, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "IntensityWeightComputationSelect") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)IntensityWeightComputationSelect, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "weights") == 0)
    {
        __result = weights.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool IntensityWeightsLevel1Type::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, "Description") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableFlag = (awbglobalelements::enableFlagType)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "IntensityWeightComputationSelect") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            IntensityWeightComputationSelect = (awbglobalelements::awbSAIntensityWeightCmptType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "weights") == 0)
    {
        __result = weights.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

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

    return __result;
}

bool ROIInfoType::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, "Description") == 0)
    {
        PARAMETER_STRCPY(__value, __size, Description);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "TargetColor") == 0)
    {
        __result = TargetColor.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "ROIPosition") == 0)
    {
        __result = ROIPosition.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool ROIInfoType::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, "Description") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }
    else if (PARAMETER_STRCMP(__name, "TargetColor") == 0)
    {
        __result = TargetColor.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "ROIPosition") == 0)
    {
        __result = ROIPosition.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

    return __result;
}

bool chromatixSASpatialGenV1Type::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, "Description") == 0)
    {
        PARAMETER_STRCPY(__value, __size, Description);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        __result = moduleID.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        ParameterUtils::DoubleToString((double)enableFlag, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "weight") == 0)
    {
        ParameterUtils::DoubleToString((double)weight, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "DefaultROIInfo") == 0)
    {
        if (__index < DefaultROIInfoCount)
        {
            __result = DefaultROIInfo[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "IntensityWeights") == 0)
    {
        __result = IntensityWeights.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "DistanceWeights") == 0)
    {
        __result = DistanceWeights.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "confidenceLevel") == 0)
    {
        __result = confidenceLevel.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "ROIAgregationWeights") == 0)
    {
        __result = ROIAgregationWeights.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool chromatixSASpatialGenV1Type::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, "Description") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }
    else if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        __result = moduleID.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableFlag = (awbglobalelements::enableFlagType)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "weight") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            weight = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "DefaultROIInfo") == 0)
    {
        if (__index < DefaultROIInfoCount)
        {
            __result = DefaultROIInfo[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "IntensityWeights") == 0)
    {
        __result = IntensityWeights.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "DistanceWeights") == 0)
    {
        __result = DistanceWeights.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "confidenceLevel") == 0)
    {
        __result = confidenceLevel.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "ROIAgregationWeights") == 0)
    {
        __result = ROIAgregationWeights.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

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

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

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

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

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

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

    return __result;
}

bool chromatixSASpatialGenV1ArrayType::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, "SASpatialROIBasedAWBData") == 0)
    {
        __result = SASpatialROIBasedAWBData.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "SASpatialGenV1Data") == 0)
    {
        if (__index < SASpatialGenV1DataCount)
        {
            __result = SASpatialGenV1Data[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        ParameterUtils::DoubleToString((double)enableFlag, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool chromatixSASpatialGenV1ArrayType::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, "SASpatialROIBasedAWBData") == 0)
    {
        __result = SASpatialROIBasedAWBData.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "SASpatialGenV1Data") == 0)
    {
        if (__index < SASpatialGenV1DataCount)
        {
            __result = SASpatialGenV1Data[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableFlag = (awbglobalelements::enableFlagType)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

    return __result;
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixSASpatialGenV1ArrayTypeClass::chromatixSASpatialGenV1ArrayTypeClass(
    const CHAR* name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(SASpatialROIBasedAWBData);
    PARAMETER_INITIALIZE(SASpatialGenV1DataCount);
    PARAMETER_INITIALIZE(SASpatialGenV1Data);
    PARAMETER_INITIALIZE(enableFlag);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixSASpatialGenV1ArrayTypeClass::chromatixSASpatialGenV1ArrayTypeClass(
    const CHAR*       name,
    ModuleData* const moduleData)
    : ParameterModule(name, MAJOR, MINOR, PATCH, moduleData)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(SASpatialROIBasedAWBData);
    PARAMETER_INITIALIZE(SASpatialGenV1Data);
    PARAMETER_INITIALIZE(enableFlag);
}

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


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load DistanceWeightsLevel1Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void DistanceWeightsLevel1Type::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(Description);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(weights);

    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 = 0xdac0c568d13d0da9;
        entry->ReadStringFixedArray(&Description, 1, localParams, __COUNTER__);
        localParams.NameHash = 0x89a1d7b1468113d1;
        entry->ReadSimpleTypeFixedArray(&enableFlag, 1, localParams);
        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xaf07aeeb13124374;
        weights.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 DistanceWeightsLevel1Type::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        DistanceWeightsLevel1Type* arrayPtr = (DistanceWeightsLevel1Type*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load IntensityWeightsLevel1Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void IntensityWeightsLevel1Type::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(Description);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(IntensityWeightComputationSelect);
    PARAMETER_INITIALIZE(weights);

    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 = 0xdac0c568d13d0da9;
        entry->ReadStringFixedArray(&Description, 1, localParams, __COUNTER__);
        localParams.NameHash = 0x89a1d7b1468113d1;
        entry->ReadSimpleTypeFixedArray(&enableFlag, 1, localParams);
        localParams.NameHash = 0xd0f91788fd467d74;
        entry->ReadEnumFixedArray(&IntensityWeightComputationSelect, 1, localParams);
        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xaf07aeeb13124374;
        weights.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 IntensityWeightsLevel1Type::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        IntensityWeightsLevel1Type* arrayPtr = (IntensityWeightsLevel1Type*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load ROIInfoType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void ROIInfoType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(Description);
    PARAMETER_INITIALIZE(TargetColor);
    PARAMETER_INITIALIZE(ROIPosition);

    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 = 0xdac0c568d13d0da9;
        entry->ReadStringFixedArray(&Description, 1, localParams, __COUNTER__);
        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xbee8c35f0699079f;
        TargetColor.Load(localParams);
        localParams.NameHash        = 0xa8f8c745bb594079;
        ROIPosition.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 ROIInfoType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        ROIInfoType* arrayPtr = (ROIInfoType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load chromatixSASpatialGenV1Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixSASpatialGenV1Type::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(Description);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(weight);
    PARAMETER_INITIALIZE(DefaultROIInfoCount);
    PARAMETER_INITIALIZE(DefaultROIInfo);
    PARAMETER_INITIALIZE(IntensityWeights);
    PARAMETER_INITIALIZE(DistanceWeights);
    PARAMETER_INITIALIZE(confidenceLevel);
    PARAMETER_INITIALIZE(ROIAgregationWeights);

    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 = 0xdac0c568d13d0da9;
        entry->ReadStringFixedArray(&Description, 1, localParams, __COUNTER__);
        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xb5bb6c7a408ed007;
        moduleID.Load(localParams);
        localParams.NameHash = 0x89a1d7b1468113d1;
        entry->ReadSimpleTypeFixedArray(&enableFlag, 1, localParams);
        localParams.NameHash = 0xbe059318b040bcf4;
        entry->ReadSimpleTypeFixedArray(&weight, 1, localParams);
        localParams.NameHash = 0xdcbe3a69468671a1;
        entry->ReadStructureArray(DefaultROIInfo, DefaultROIInfoCount, DefaultROIInfoID, 1, localParams, __COUNTER__);
        localParams.NameHash        = 0xdb005e28f103aff0;
        IntensityWeights.Load(localParams);
        localParams.NameHash        = 0xa842095a01b65425;
        DistanceWeights.Load(localParams);
        localParams.NameHash        = 0xbb1317a4e9e39bd8;
        confidenceLevel.Load(localParams);
        localParams.NameHash        = 0xb978be95f90f3467;
        ROIAgregationWeights.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 chromatixSASpatialGenV1Type::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        chromatixSASpatialGenV1Type* arrayPtr = (chromatixSASpatialGenV1Type*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load chromatixSASpatialGenV1ArrayType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixSASpatialGenV1ArrayType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(SASpatialROIBasedAWBData);
    PARAMETER_INITIALIZE(SASpatialGenV1DataCount);
    PARAMETER_INITIALIZE(SASpatialGenV1Data);
    PARAMETER_INITIALIZE(enableFlag);

    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        = 0xb70cb45df22b9684;
        SASpatialROIBasedAWBData.Load(localParams);
        localParams.NameHash = 0xb8106a1054bf8d19;
        entry->ReadStructureArray(SASpatialGenV1Data, SASpatialGenV1DataCount, SASpatialGenV1DataID, 0, localParams, __COUNTER__);
        localParams.NameHash = 0x89a1d7b1468113d1;
        entry->ReadSimpleTypeFixedArray(&enableFlag, 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 chromatixSASpatialGenV1ArrayType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        chromatixSASpatialGenV1ArrayType* arrayPtr = (chromatixSASpatialGenV1ArrayType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixSASpatialGenV1ArrayType::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 chromatixSASpatialGenV1ArrayType::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* chromatixSASpatialGenV1ArrayType::module_versionStruct::AllocArray(
    UINT32 __count)
{
    module_versionStruct* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW module_versionStruct[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload DistanceWeightsLevel1Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void DistanceWeightsLevel1Type::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, Description);
    weights.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload IntensityWeightsLevel1Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void IntensityWeightsLevel1Type::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, Description);
    weights.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload ROIInfoType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void ROIInfoType::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, Description);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload chromatixSASpatialGenV1Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixSASpatialGenV1Type::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, Description);
    for (UINT32 i = 0; DefaultROIInfo != nullptr && i < DefaultROIInfoCount; i++)
    {
        DefaultROIInfo[i].Unload(__table);
    }
    ParameterFileSymbolTable::ReleaseObject(__table, DefaultROIInfo);
    IntensityWeights.Unload(__table);
    DistanceWeights.Unload(__table);
    confidenceLevel.Unload(__table);
    ROIAgregationWeights.Unload(__table);
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Release the ParameterModule object
/// Requires that this object was created via a ParameterSetManager::GetModule call
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixSASpatialGenV1ArrayType::Release()
{
    ((chromatixSASpatialGenV1ArrayTypeClass*)this)->Release();
}

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Create module, and return a new object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ParameterModule* chromatixSASpatialGenV1ArrayTypeClass::Create(
    ModuleData* const    moduleData,
    DefaultModule* const defModule) const
{
    chromatixSASpatialGenV1ArrayTypeClass* 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 = (chromatixSASpatialGenV1ArrayTypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW chromatixSASpatialGenV1ArrayTypeClass(Name, moduleData);
            cls->SymbolTableID = id;
            defModule->AddModule((ParameterModule*)cls);
        }
    }
    else if (Version.Value != moduleData->Version.Value)
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatixSASpatialGenV1ArrayTypeClass, binary version (%lld) does not match source version (%lld)\n",
            moduleData->Version.Value, Version.Value);
    }
    else
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatixSASpatialGenV1ArrayTypeClass, 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 chromatixSASpatialGenV1ArrayTypeClass::LoadModule(
    ParameterFileSymbolTable* const table)
{
    bool result = true;

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

    if (!Loaded)
    {
        chromatixSASpatialGenV1ArrayTypeClass* 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, "chromatixSASpatialGenV1ArrayTypeClass::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 chromatixSASpatialGenV1ArrayTypeClass::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 chromatixSASpatialGenV1ArrayTypeClass::Release()
{
    ParameterModule::Release();
}

MODSASPATIALGENV1_NAMESPACE_END
