CGraph
Private Member Functions | Friends | List of all members
GMultiCondition< type > Class Template Reference

#include <GMultiCondition.h>

Inheritance diagram for GMultiCondition< type >:
Inheritance graph
[legend]
Collaboration diagram for GMultiCondition< type >:
Collaboration graph
[legend]

Private Member Functions

 GMultiCondition ()
 
CStatus run () final
 
CStatus serialRun ()
 
CStatus parallelRun ()
 
CIndex choose () final
 
CBool isSerializable () const override
 
CBool isSeparate (GElementCPtr a, GElementCPtr b) const final
 

Friends

class GPipeline
 
class CAllocator
 

Additional Inherited Members

- 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
 
- Protected Member Functions inherited from GCondition
 GCondition ()
 
CSize getRange () const
 
- Protected Member Functions inherited from GGroup
virtual CStatus addElement (GElementPtr element)
 
CBool isSerializable () const override
 
- 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_
 

Constructor & Destructor Documentation

◆ GMultiCondition()

template<GMultiConditionType type>
CGRAPH_NAMESPACE_BEGIN GMultiCondition< type >::GMultiCondition
explicitprivate
Here is the call graph for this function:

Member Function Documentation

◆ choose()

template<GMultiConditionType type>
CIndex GMultiCondition< type >::choose ( )
finalprivatevirtual

计算需要返回第n个信息 执行最后一个,返回-1即可。 超出-1和size之间的范围,则不执行

Returns

Implements GCondition.

◆ isSeparate()

template<GMultiConditionType type>
CBool GMultiCondition< type >::isSeparate ( GElementCPtr  a,
GElementCPtr  b 
) const
finalprivatevirtual

判断两个element,是否相互独立

Parameters
a
b
Returns
@notice 如果返回 true,则表示一定有前后依赖关系,不可能并发执行。否则表示不确定,原因是并发情况无法完全确定

Reimplemented from GCondition.

◆ isSerializable()

template<GMultiConditionType type>
CBool GMultiCondition< type >::isSerializable
overrideprivatevirtual

判断当前元素,是否可以线性执行。默认返回true

Returns

如果是PARALLEL模式的话,并且其中的元素个数大于1,则一定不可以串行执行 PARALLEL模式中,仅有一个元素的情况,和 SERIAL模式的判断方式一样, 均为判断其中所有的element是否可以并行 故放在下面的条件中判断了

Reimplemented from GElement.

Here is the call graph for this function:

◆ parallelRun()

template<GMultiConditionType type>
CStatus GMultiCondition< type >::parallelRun
private

并行执行

Returns

如果有异常值的化,也等待所有内容计算完成后,统一返回 暂时没有处理超时的情况。预计今后会统一处理

◆ run()

template<GMultiConditionType type>
CStatus GMultiCondition< type >::run ( )
finalprivatevirtual

流程处理函数

Reimplemented from GCondition.

◆ serialRun()

template<GMultiConditionType type>
CStatus GMultiCondition< type >::serialRun
private

串行执行

Returns

Friends And Related Function Documentation

◆ CAllocator

template<GMultiConditionType type>
friend class CAllocator
friend

◆ GPipeline

template<GMultiConditionType type>
friend class GPipeline
friend

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