soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SEvent Class Reference

表示一个事件对象 More...

#include <SEventSet.h>

Public Member Functions

 SEvent (DWORD dwEventID, LPCWSTR pszEventName)
 构造函数
 
virtual ~SEvent ()
 析构函数
 
DWORD GetID ()
 获取事件ID
 
SStringW GetName () const
 获取事件名称
 
SStringA GetScriptHandler () const
 获取脚本处理程序
 
void SetScriptHandler (const SStringA &strScriptHandler)
 设置脚本处理程序
 
BOOL subscribe (const IEvtSlot *slot)
 订阅事件
 
BOOL unsubscribe (const IEvtSlot *slot)
 取消订阅事件
 
void fire (IEvtArgs *args)
 触发事件
 

Protected Member Functions

int findSlotFunctor (const IEvtSlot *slot)
 查找事件槽对象
 

Protected Attributes

DWORD m_dwEventID
 事件ID
 
SStringW m_strEventName
 事件名称
 
SStringA m_strScriptHandler
 脚本处理程序字符串
 
SArray< IEvtSlot * > m_evtSlots
 事件槽数组
 

Detailed Description

表示一个事件对象

Definition at line 12 of file SEventSet.h.

Constructor & Destructor Documentation

◆ SEvent()

SNSBEGIN SEvent::SEvent ( DWORD dwEventID,
LPCWSTR pszEventName )

构造函数

Parameters
dwEventID事件ID
pszEventName事件名称

Definition at line 8 of file SEventSet.cpp.

◆ ~SEvent()

SEvent::~SEvent ( )
virtual

析构函数

Definition at line 14 of file SEventSet.cpp.

Member Function Documentation

◆ findSlotFunctor()

int SEvent::findSlotFunctor ( const IEvtSlot * slot)
protected

查找事件槽对象

Parameters
slot事件槽对象
Returns
找到的事件槽索引,未找到返回-1

Definition at line 42 of file SEventSet.cpp.

◆ fire()

void SEvent::fire ( IEvtArgs * args)

触发事件

Parameters
args事件参数对象

Definition at line 54 of file SEventSet.cpp.

◆ GetID()

DWORD SEvent::GetID ( )

获取事件ID

Returns
事件ID

Definition at line 93 of file SEventSet.cpp.

◆ GetName()

SStringW SEvent::GetName ( ) const

获取事件名称

Returns
事件名称

Definition at line 88 of file SEventSet.cpp.

◆ GetScriptHandler()

SStringA SEvent::GetScriptHandler ( ) const

获取脚本处理程序

Returns
脚本处理程序字符串

Definition at line 83 of file SEventSet.cpp.

◆ SetScriptHandler()

void SEvent::SetScriptHandler ( const SStringA & strScriptHandler)

设置脚本处理程序

Parameters
strScriptHandler脚本处理程序字符串

Definition at line 78 of file SEventSet.cpp.

◆ subscribe()

BOOL SEvent::subscribe ( const IEvtSlot * slot)

订阅事件

Parameters
slot事件槽对象
Returns
成功返回TRUE,失败返回FALSE

Definition at line 23 of file SEventSet.cpp.

◆ unsubscribe()

BOOL SEvent::unsubscribe ( const IEvtSlot * slot)

取消订阅事件

Parameters
slot事件槽对象
Returns
成功返回TRUE,失败返回FALSE

Definition at line 31 of file SEventSet.cpp.

Member Data Documentation

◆ m_dwEventID

DWORD SEvent::m_dwEventID
protected

事件ID

Definition at line 78 of file SEventSet.h.

◆ m_evtSlots

SArray<IEvtSlot *> SEvent::m_evtSlots
protected

事件槽数组

Definition at line 82 of file SEventSet.h.

◆ m_strEventName

SStringW SEvent::m_strEventName
protected

事件名称

Definition at line 79 of file SEventSet.h.

◆ m_strScriptHandler

SStringA SEvent::m_strScriptHandler
protected

脚本处理程序字符串

Definition at line 80 of file SEventSet.h.


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