logplus/Workflow/WFEngine/WorkflowEngine/include/ModuleInformation.h

252 lines
5.2 KiB
C
Raw Normal View History

2026-01-16 17:18:41 +08:00
/**
* @file ModuleInfomation.h
* @brief
*
* @author
* @date 2011-7-27
*/
#ifndef PAI_FRAME_WORKFLOWENGINE_MODULEINFORMATION_H
#define PAI_FRAME_WORKFLOWENGINE_MODULEINFORMATION_H
#include <iostream>
#include "Module.h"
#include "ModuleParameter.h"
// #include "ModuleConnection.h"
namespace pai {
namespace workflow {
using namespace pai::module;
/**
* @brief
*
*/
class PAI_WORKFLOWENGINE_EXPORT CModuleInformation
{
private:
CModule* m_oModule;
int m_iStepId;
/*
* id
*
* */
int m_iId;
/*
* namespace
*
* */
std::string m_strNamespace;
/*
* class name
*
* */
std::string m_strName;
//模块版本
std::string m_strVersion;
//模块qc,默认值等于false
bool m_bQC;
//模块断点默认值等于false
bool m_bBreakpoint;
std::string m_strComments;
//模块是否可用默认值等于true
bool m_bEnabled;
//模块的参数集合
CModuleParameter* m_ModParam;
//模块的
std::vector<CModuleInformation*> inModules;
std::vector<CModuleInformation*> outModules;
bool m_bBlankModule;//blank module or not
CModuleInformation & operator=(const workflow::CModuleInformation&);
public:
/**
* @biref GUI排查内存增长问题
* @return
*/
unsigned long GetMemorySize();
/**@brief 设置 @ref CModule
* @param[in] module
*/
//REMOVEME
void SetModule(CModule* module)
{
m_oModule = module;
}
/**@brief 获取@ref CModule 模块
* @return CModule*
*/
CModule* GetModule() const
{
return m_oModule;
}
/**
* @brief
*/
void SetStepID(int iStepID)
{
m_iStepId = iStepID;
}
/**@brief 获取模块在工作流中的位置
*@see CModule
*/
int GetStepID() const
{
return m_iStepId;
}
/**@brief 获取模块ID
* @return string ID
*/
std::string GetModuleID() const
{
return m_oModule->GetMetaData()->GetID();
}
std::string GetClassName() const
{
if (m_oModule)
return m_oModule->GetClassName();
else
return "";
}
/**@brief 获取模块的元数据
* @return CModuleMetaData*
* @see CModuleMetaData
*/
const CModuleMetaData* GetModuleMetaData() const;
/**
*
* @param[in] _parammmmeter
* @see ModuleParameter
*/
void SetParameters(CModuleParameter* _parameter)
{
m_oModule->SetParameters(_parameter);
}
/**
*
* @return ModuleParameter*
* @see ModuleParameter
*/
CModuleParameter* GetModuleParameter() const;
// Deprecated methods
int GetId() const
{
return this->GetStepID();
}
void SetId(int iId)
{
SetStepID(iId);
}
std::string GetNamespace() const
{
return this->m_strNamespace;
}
void SetNamespace(const std::string& strNamespace)
{
this->m_strNamespace = strNamespace;
}
//REMOVEME
void SetName(const std::string& strName)
{
this->m_strName = strName;
}
std::string GetName() const;
bool GetQC() const
{
return this->m_bQC;
}
void SetQC(bool bQC)
{
this->m_bQC = bQC;
}
bool GetBreakpoint() const
{
return this->m_bBreakpoint;
}
void SetBreakpoint(bool bBreakpoint)
{
this->m_bBreakpoint = bBreakpoint;
}
std::string GetComments() const
{
return this->m_strComments;
}
std::string GetComments2() const;
void SetComments(const std::string& strComments)
{
this->m_strComments = strComments;
}
std::string GetVersion() const
{
return this->m_strVersion;
}
void SetVersion(const std::string& strVersion)
{
this->m_strVersion = strVersion;
}
bool GetEnabled() const
{
return this->m_bEnabled;
}
void SetEnabled(bool bEnabled)
{
this->m_bEnabled = bEnabled;
}
/**
* @brief Get whether it is blank module or not
*/
bool IsBlankModule() const;
/**
* @brief Set whether it is blank module or not
*/
void SetBlankModule(bool bBlankModule);
//REMOVEME
CModuleParameter* GetModuleParam()
{
return this->m_ModParam;
}
void Print();
std::string static ParamItemTypeToString(ParameterType type);
CModuleInformation();
CModuleInformation(const workflow::CModuleInformation&);
CModuleInformation(const std::string& moduleClass);
virtual ~CModuleInformation();
/**
* @brief
* @param srcModuleInfo
*/
void Clone(const workflow::CModuleInformation& srcModuleInfo);
/**
* @brief
*
*/
friend bool operator ==(CModuleInformation &info, CModuleInformation &info2);
};
}
}
#endif