CGraph
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
GFunction Class Reference

将一个函数注入成一个GElement,函数可以注入为这个新的GElement的init/run/destroy More...

#include <GFunction.h>

Inheritance diagram for GFunction:
Inheritance graph
[legend]
Collaboration diagram for GFunction:
Collaboration graph
[legend]

Public Member Functions

GFunctionsetFunction (const CFunctionType &type, CGRAPH_CSTATUS_CONST_FUNCTION_REF func)
 
- Public Member Functions inherited from GElement
template<typename TAspect , typename TParam = GAspectDefaultParam, c_enable_if_t< std::is_base_of< GAspect, TAspect >::value, int > = 0, c_enable_if_t< std::is_base_of< GAspectParam, TParam >::value, int > = 0>
GElementaddGAspect (TParam *param=nullptr)
 
template<typename TAspect , typename ... Args, c_enable_if_t< std::is_base_of< GTemplateAspect< Args... >, TAspect >::value, int > = 0>
GElementaddGAspect (Args... args)
 
template<typename T , c_enable_if_t< std::is_base_of< GElementParam, T >::value, int > = 0>
GElementaddEParam (const std::string &key, T *param)
 
CStatus addDependGElements (const std::set< GElement * > &elements)
 
GElementsetName (const std::string &name) override
 
GElementsetLoop (CSize loop)
 
GElementsetLevel (CLevel level)
 
GElementsetVisible (CBool visible)
 
GElementsetBindingIndex (CIndex index)
 
GElementsetTimeout (CMSec timeout, GElementTimeoutStrategy strategy=GElementTimeoutStrategy::AS_ERROR)
 
GElementsetMacro (CBool macro)
 
CBool isGGroup () const
 
CBool isGAdaptor () const
 
CBool isGNode () const
 
GElementState getCurState () const
 
CStatus removeDepend (GElement *element)
 
GElementoperator-- (int) noexcept
 
GElementoperator> (GElement *element)
 
GElementoperator& (GElement *element)
 
GElementoperator* (CSize loop) noexcept
 
template<typename TAspect , typename TParam , c_enable_if_t< std::is_base_of< GAspect, TAspect >::value, int > , c_enable_if_t< std::is_base_of< GAspectParam, TParam >::value, int > >
CGRAPH_NAMESPACE_BEGIN GElementPtr addGAspect (TParam *param)
 
template<typename TAspect , typename ... Args, c_enable_if_t< std::is_base_of< GTemplateAspect< Args... >, TAspect >::value, int > >
GElementPtr addGAspect (Args... args)
 
template<typename T , c_enable_if_t< std::is_base_of< GElementParam, T >::value, int > >
GElementPtr addEParam (const std::string &key, T *param)
 
- Public Member Functions inherited from CObject
 CObject ()=default
 
virtual ~CObject ()=default
 
- Public Member Functions inherited from CDescInfo
virtual const std::string & getName () const
 
const std::string & getSession () const
 
const std::string & getDescription () const
 
virtual auto setDescription (const std::string &description) -> decltype(this)
 
virtual ~CDescInfo ()=default
 

Private Member Functions

 GFunction ()
 
CStatus init () final
 
CStatus run () final
 
CStatus destroy () final
 

Private Attributes

CGRAPH_CSTATUS_FUNCTION init_function_ = nullptr
 
CGRAPH_CSTATUS_FUNCTION run_function_ = nullptr
 
CGRAPH_CSTATUS_FUNCTION destroy_function_ = nullptr
 

Friends

class GPipeline
 

Additional Inherited Members

- Protected Member Functions inherited from GAdapter
 GAdapter ()
 
- Protected Member Functions inherited from GElement
 GElement ()=default
 
 ~GElement () override
 
virtual CStatus prepareRun ()
 
virtual CStatus checkRunResult ()
 
virtual CBool isHold ()
 
virtual CBool isMatch ()
 
CStatus crashed (const CException &ex)
 
template<typename T , c_enable_if_t< std::is_base_of< GElementParam, T >::value, int > = 0>
T * getEParam (const std::string &key)
 
CIndex getThreadIndex ()
 
CBool isTimeout () const
 
CIndex getBindingIndex () const
 
GElementRelation getRelation () const
 
 CGRAPH_NO_ALLOWED_COPY (GElement)
 
- Protected Attributes inherited from CDescInfo
std::string name_
 
std::string session_
 
std::string description_
 

Detailed Description

将一个函数注入成一个GElement,函数可以注入为这个新的GElement的init/run/destroy

Constructor & Destructor Documentation

◆ GFunction()

GFunction::GFunction ( )
explicitprivate
Here is the call graph for this function:

Member Function Documentation

◆ destroy()

CStatus GFunction::destroy ( )
finalprivatevirtual

释放函数

Reimplemented from CObject.

◆ init()

CStatus GFunction::init ( )
finalprivatevirtual

初始化函数

Reimplemented from CObject.

◆ run()

CStatus GFunction::run ( )
finalprivatevirtual

流程处理函数

Implements CObject.

◆ setFunction()

CGRAPH_NAMESPACE_BEGIN GFunctionPtr GFunction::setFunction ( const CFunctionType type,
CGRAPH_CSTATUS_CONST_FUNCTION_REF  func 
)

设置执行函数具体内容

Parameters
type
func
Returns

Friends And Related Function Documentation

◆ GPipeline

friend class GPipeline
friend

Member Data Documentation

◆ destroy_function_

CGRAPH_CSTATUS_FUNCTION GFunction::destroy_function_ = nullptr
private

◆ init_function_

CGRAPH_CSTATUS_FUNCTION GFunction::init_function_ = nullptr
private

◆ run_function_

CGRAPH_CSTATUS_FUNCTION GFunction::run_function_ = nullptr
private

The documentation for this class was generated from the following files: