ACE_Reactor 机制下的其他事件触发器
2012-07-26 13:51
393 查看
ACE_Reactor 机制下的其他事件触发器
检查控制台的输入动作
控制台事件handle :ACE_STDIN
当用户输入回车时会触发信号,执行 handle_signal 方法
通过ACE_OS::read (ACE_STDIN, buffer, sizeof buffer)方法读取用户的输入
检查目录是否发生变化
目录改变事件handle:
int change_notification_flags = FILE_NOTIFY_CHANGE_FILE_NAME;
this->handle_ = ACE_TEXT_FindFirstChangeNotification (directory, // pointer to name of directory to watch
FALSE, // flag for monitoring directory or directory tree
change_notification_flags // filter conditions to watch for
);
事件触发后,如想继续保持触发,须调用::FindNextChangeNotification (this->handle_);方法
如下关闭触发,应调用::FindCloseChangeNotification (this->handle_);方法
目录内容发生改变时会触发信号,执行handle_singnal方法
检查注册表项是否发生了变化
注册表项改变事件HANDLE:
(::RegNotifyChangeKeyValue (this->context_.key (), // handle of key to watch
FALSE, // flag for subkey notification
REG_NOTIFY_CHANGE_NAME, // changes to be reported
this->event_.handle (), // handle of signaled event
TRUE // flag for asynchronous reporting
)
涉及了下面这个主要类:
ACE_Registry::Naming_Context context_;
其提供有
bind_new_context (temp_context_name,temp_context); 新建一个注册表项
unbind_context (temp_context_name);删除一个注册表项
方法
检查控制台的输入动作
控制台事件handle :ACE_STDIN
当用户输入回车时会触发信号,执行 handle_signal 方法
通过ACE_OS::read (ACE_STDIN, buffer, sizeof buffer)方法读取用户的输入
检查目录是否发生变化
目录改变事件handle:
int change_notification_flags = FILE_NOTIFY_CHANGE_FILE_NAME;
this->handle_ = ACE_TEXT_FindFirstChangeNotification (directory, // pointer to name of directory to watch
FALSE, // flag for monitoring directory or directory tree
change_notification_flags // filter conditions to watch for
);
事件触发后,如想继续保持触发,须调用::FindNextChangeNotification (this->handle_);方法
如下关闭触发,应调用::FindCloseChangeNotification (this->handle_);方法
目录内容发生改变时会触发信号,执行handle_singnal方法
检查注册表项是否发生了变化
注册表项改变事件HANDLE:
(::RegNotifyChangeKeyValue (this->context_.key (), // handle of key to watch
FALSE, // flag for subkey notification
REG_NOTIFY_CHANGE_NAME, // changes to be reported
this->event_.handle (), // handle of signaled event
TRUE // flag for asynchronous reporting
)
涉及了下面这个主要类:
ACE_Registry::Naming_Context context_;
其提供有
bind_new_context (temp_context_name,temp_context); 新建一个注册表项
unbind_context (temp_context_name);删除一个注册表项
方法
相关文章推荐
- ACE笔记(5) -ACE_Reactor 机制下的其他事件触发器
- ACE_Reactor 机制下的其他事件触发器
- ACE笔记(5)-ACE_Reactor 机制下的其他事件触发器
- ACE笔记(3) -用ACE_Reactor 实现SOCKET事件处理
- ACE笔记(4) -ACE_Reactor 机制下 的ACE异常处理
- 解决SorollView中和其他控件的事件分发机制-例如嵌套地图
- ACE Reactor框架处理事件及多个I/O流,应用举例。
- Reactor的事件处理机制
- [ACE源码分析]ACE_Reactor是如何做到事件分发的
- 对ACE_TP_Reactor定时器处理机制做一点修改。
- ACE:Reactor框架--处理事件及多个I/O流
- ACE_Reactor是如何做到事件分发的
- 用 ACE_Reactor 实现SOCKET事件处理
- ACE笔记(3)-用 ACE_Reactor 实现SOCKET事件处理
- Atitit 数据库的事件机制--触发器与定时任务attilax总结
- ACE_Reactor是如何做到事件分发的
- ACE笔记(4)- ACE_Reactor 机制下 的ACE异常处理
- 修改ACE的Reactor模式示例中的参数后测试,依据测试结果,猜测Reactor似乎可以突破62个事件的限制。但是...
- Atitit 数据库的事件机制--触发器与定时任务attilax总结
- ACE Reactor框架处理事件及多个I/O流