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

默认的前序后继方式只能等待有连接关系的结点 GFence用于在没有依赖关系的情况下,强行等待一个或一组异步结点的运行结束 More...

#include <GFence.h>

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

Public Member Functions

GFencewaitGElement (GElementPtr element)
 
GFencewaitGElements (const std::set< GElementPtr > &elements)
 
CVoid clear ()
 
- 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 CStatus init ()
 
virtual CStatus destroy ()
 
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
 

Protected Member Functions

 GFence ()
 
CStatus checkSuitable () final
 
CVoid dumpElement (std::ostream &oss) final
 
CGRAPH_DECLARE_GPARAM_MANAGER_WRAPPER CGRAPH_DECLARE_GEVENT_MANAGER_WRAPPER CStatus run () final
 
- 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)
 

Private Attributes

std::set< GElementPtrfence_elements_
 

Friends

class GPipeline
 

Additional Inherited Members

- Protected Attributes inherited from CDescInfo
std::string name_
 
std::string session_
 
std::string description_
 

Detailed Description

默认的前序后继方式只能等待有连接关系的结点 GFence用于在没有依赖关系的情况下,强行等待一个或一组异步结点的运行结束

Constructor & Destructor Documentation

◆ GFence()

CGRAPH_NAMESPACE_BEGIN GFence::GFence ( )
explicitprotected
Here is the call graph for this function:

Member Function Documentation

◆ checkSuitable()

CStatus GFence::checkSuitable ( )
finalprotectedvirtual

判断当前节点,是否符合执行逻辑。主要用于init的早期阶段

Returns

Reimplemented from GElement.

◆ clear()

CVoid GFence::clear ( )

清空所有的elements信息

Returns

◆ dumpElement()

CVoid GFence::dumpElement ( std::ostream &  oss)
finalprotectedvirtual

graphviz dump 点逻辑

Parameters
oss

Reimplemented from GElement.

Here is the call graph for this function:

◆ run()

CStatus GFence::run ( )
finalprotectedvirtual

流程处理函数

Implements CObject.

◆ waitGElement()

GFencePtr GFence::waitGElement ( GElementPtr  element)

添加需要等待的element(必须是异步的)

Parameters
element
Returns
@notice 对外仅可以添加异步节点(设置了timeout的节点)
Here is the call graph for this function:

◆ waitGElements()

GFencePtr GFence::waitGElements ( const std::set< GElementPtr > &  elements)

添加需要等待的一组element

Parameters
elements
Returns
@notice 对外仅可以添加异步节点(设置了timeout的节点)
Here is the call graph for this function:

Friends And Related Function Documentation

◆ GPipeline

friend class GPipeline
friend

Member Data Documentation

◆ fence_elements_

std::set<GElementPtr> GFence::fence_elements_
private

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