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

#include "modmlczv2.h"
#include "parametersetmanager.h"

MODMLCZV2_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixMLCZV2Type::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, "moduleID") == 0)
    {
        __result = moduleID.GetValue(&__path[__pos], __value, __size);
    }
    else 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, "enableFlag") == 0)
    {
        ParameterUtils::DoubleToString((double)enableFlag, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "detectionZoneV2") == 0)
    {
        if (__index < detectionZoneV2Count)
        {
            __result = detectionZoneV2[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "MLCZV2") == 0)
    {
        if (__index < MLCZV2Count)
        {
            __result = MLCZV2[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "MLCGrid") == 0)
    {
        __result = MLCGrid.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool chromatixMLCZV2Type::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, "moduleID") == 0)
    {
        __result = moduleID.SetValue(&__path[__pos], __value);
    }
    else 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, "enableFlag") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableFlag = (awbglobalelements::enableFlagType)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "detectionZoneV2") == 0)
    {
        if (__index < detectionZoneV2Count)
        {
            __result = detectionZoneV2[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "MLCZV2") == 0)
    {
        if (__index < MLCZV2Count)
        {
            __result = MLCZV2[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "MLCGrid") == 0)
    {
        __result = MLCGrid.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

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

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

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

    return __result;
}

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

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

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

    return __result;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixMLCZV2TypeClass::chromatixMLCZV2TypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(detectionZoneV2Count);
    PARAMETER_INITIALIZE(detectionZoneV2);
    PARAMETER_INITIALIZE(MLCZV2Count);
    PARAMETER_INITIALIZE(MLCZV2);
    PARAMETER_INITIALIZE(MLCGrid);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixMLCZV2TypeClass::chromatixMLCZV2TypeClass(
    const CHAR* const name,
    ModuleData* const moduleData)
    : ParameterModule(name, MAJOR, MINOR, PATCH, moduleData)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(detectionZoneV2);
    PARAMETER_INITIALIZE(MLCZV2);
    PARAMETER_INITIALIZE(MLCGrid);
}

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

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

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

    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(detectionZoneV2);
    PARAMETER_INITIALIZE(MLCZV2);
    PARAMETER_INITIALIZE(MLCGrid);

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

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

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

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

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

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixMLCZV2Type::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 chromatixMLCZV2Type::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 chromatixMLCZV2Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixMLCZV2Type::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
    for (UINT32 i = 0; i < detectionZoneV2Count; i++)
    {
        detectionZoneV2[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(detectionZoneV2))
    {
        PARAMETER_DELETE[] detectionZoneV2;
    }
    detectionZoneV2 = nullptr;
    for (UINT32 i = 0; i < MLCZV2Count; i++)
    {
        MLCZV2[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(MLCZV2))
    {
        PARAMETER_DELETE[] MLCZV2;
    }
    MLCZV2 = nullptr;
}

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

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

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

    return (ParameterModule*)cls;
}

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

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

MODMLCZV2_NAMESPACE_END
