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

事件机制,addGEvent将事件注册到pipeline notify触发,process处理信号,trigger同步执行,asyncProcess异步执行,asyncWait等待异步任务结束 More...

#include <GEvent.h>

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

Protected Member Functions

virtual CVoid trigger (GEventParamPtr param)=0
 
 GEvent ()
 
 ~GEvent () override
 
- Protected Member Functions inherited from GEventObject
CStatus run () final
 
virtual GEventObjectsetThreadPool (UThreadPoolPtr ptr)
 

Private Member Functions

CStatus init () final
 
CStatus destroy () final
 
CStatus process (GEventType type, GEventAsyncStrategy strategy)
 
std::shared_future< CVoidasyncProcess (GEventAsyncStrategy strategy)
 
CVoid asyncWait (GEventAsyncStrategy strategy)
 

Private Attributes

std::vector< std::shared_future< CVoid > > async_run_finish_futures_ {}
 
std::vector< std::shared_future< CVoid > > async_destroy_futures_ {}
 
GEventParamPtr param_ { nullptr }
 
std::mutex async_run_finished_lock_
 
std::mutex async_destroy_lock_
 

Friends

class GEventManager
 

Additional Inherited Members

- 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 setName (const std::string &name) -> decltype(this)
 
virtual auto setDescription (const std::string &description) -> decltype(this)
 
virtual ~CDescInfo ()=default
 
- Protected Attributes inherited from GEventObject
UThreadPoolPtr thread_pool_ = nullptr
 
GParamManagerPtr param_manager_ = nullptr
 
- Protected Attributes inherited from CDescInfo
std::string name_
 
std::string session_
 
std::string description_
 

Detailed Description

事件机制,addGEvent将事件注册到pipeline notify触发,process处理信号,trigger同步执行,asyncProcess异步执行,asyncWait等待异步任务结束

Constructor & Destructor Documentation

◆ GEvent()

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

◆ ~GEvent()

GEvent::~GEvent ( )
overrideprotected

Member Function Documentation

◆ asyncProcess()

std::shared_future< CVoid > GEvent::asyncProcess ( GEventAsyncStrategy  strategy)
private

异步事件处理

Parameters
strategy
Returns

根据具体策略,将 future信息放到对应的容器中 在特定的时间点,等待执行结束

Here is the call graph for this function:

◆ asyncWait()

CVoid GEvent::asyncWait ( GEventAsyncStrategy  strategy)
private

等待并清理所有异步的event逻辑

Parameters
strategy
Returns

◆ destroy()

CStatus GEvent::destroy ( )
finalprivatevirtual

释放函数

Reimplemented from CObject.

Here is the call graph for this function:

◆ init()

CStatus GEvent::init ( )
finalprivatevirtual

初始化函数

Reimplemented from CObject.

◆ process()

CStatus GEvent::process ( GEventType  type,
GEventAsyncStrategy  strategy 
)
private

处理信号事件

Parameters
type
strategy
Returns
Here is the call graph for this function:

◆ trigger()

virtual CVoid GEvent::trigger ( GEventParamPtr  param)
protectedpure virtual

事件被触发的时候,执行的函数

Parameters
param是pipeline那一层,注册进来的参数,可以为空
Returns

Implemented in ShowGEvent.

Friends And Related Function Documentation

◆ GEventManager

friend class GEventManager
friend

Member Data Documentation

◆ async_destroy_futures_

std::vector<std::shared_future<CVoid> > GEvent::async_destroy_futures_ {}
private

◆ async_destroy_lock_

std::mutex GEvent::async_destroy_lock_
private

◆ async_run_finish_futures_

std::vector<std::shared_future<CVoid> > GEvent::async_run_finish_futures_ {}
private

◆ async_run_finished_lock_

std::mutex GEvent::async_run_finished_lock_
private

◆ param_

GEventParamPtr GEvent::param_ { nullptr }
private

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