加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ACE_Reactor 机制下的其他事件触发器

发布时间:2020-12-15 04:57:35 所属栏目:百科 来源:网络整理
导读:ACE_Reactor 机制下的其他事件触发器 检查控制台的输入动作 控制台事件handle :ACE_STDIN 当用户输入回车时会触发信号,执行 handle_signal 方法 通过ACE_OS::read (ACE_STDIN,buffer,sizeof buffer)方法读取用户的输入 检查目录是否发生变化 目录改变事件ha
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);删除一个注册表项 方法

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读