CGraph
Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
GMutable Class Referenceabstract

常规的GGroup及其派生类在运行时是不允许再修改前序后继关系的,但是GMutable可以 具体做法是GMutable在每次run的时候会先调用setup初始化自己这张子图(实际上就是清空),再调用reshape修改前序后继关系,最后才是正常运行子图 GMutable的reshape是纯虚函数,派生类必须实现,可以参考MyMutable示例 More...

#include <GMutable.h>

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

Protected Member Functions

virtual CStatus reshape (GElementPtrArr &elements)=0
 
 GMutable ()
 
 ~GMutable () override
 
- Protected Member Functions inherited from GGroup
virtual CStatus addElement (GElementPtr element)
 
- 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 Member Functions

CStatus init () final
 
CStatus run () final
 
CStatus destroy () final
 
CBool isSerializable () const override
 
CVoid setup ()
 

Private Attributes

GElementManagerPtr manager_ = nullptr
 

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 Attributes inherited from CDescInfo
std::string name_
 
std::string session_
 
std::string description_
 

Detailed Description

常规的GGroup及其派生类在运行时是不允许再修改前序后继关系的,但是GMutable可以 具体做法是GMutable在每次run的时候会先调用setup初始化自己这张子图(实际上就是清空),再调用reshape修改前序后继关系,最后才是正常运行子图 GMutable的reshape是纯虚函数,派生类必须实现,可以参考MyMutable示例

Constructor & Destructor Documentation

◆ GMutable()

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

◆ ~GMutable()

GMutable::~GMutable ( )
overrideprotected

Member Function Documentation

◆ destroy()

CStatus GMutable::destroy ( )
finalprivatevirtual

释放函数

Reimplemented from GGroup.

Here is the call graph for this function:

◆ init()

CStatus GMutable::init ( )
finalprivatevirtual

初始化函数

Reimplemented from GGroup.

Here is the call graph for this function:

◆ isSerializable()

CBool GMutable::isSerializable ( ) const
overrideprivatevirtual

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

Returns

针对group的情况,应该是所有在其中的element 都是可以串行的,才认定为可串行 但是在 region和 multiCondition中,有针对性的判断

Reimplemented from GGroup.

◆ reshape()

virtual CStatus GMutable::reshape ( GElementPtrArr elements)
protectedpure virtual

重新设定内部数据的结构信息

Parameters
elements
Returns

◆ run()

CStatus GMutable::run ( )
finalprivatevirtual

流程处理函数

  1. 初始化内容
  2. 通过外部复写 reshape(),来实现关系设定。其中,通过 --> 设定的,是会自动恢复visible的
  3. 通过 manager 执行

Implements CObject.

Here is the call graph for this function:

◆ setup()

CVoid GMutable::setup ( )
private

将数据进行恢复

Returns

Friends And Related Function Documentation

◆ CAllocator

friend class CAllocator
friend

◆ GPipeline

friend class GPipeline
friend

Member Data Documentation

◆ manager_

GElementManagerPtr GMutable::manager_ = nullptr
private

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