12.07.2015 Views

VisiBroker Edition

VisiBroker Edition

VisiBroker Edition

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

推 型 提 供 者 和 接 收 者 的 实 例推 型 提 供 者 应 用 在 PushModel.C 文 件 中 实 现 , 而 推 型 接 收 者 在 PushView.C 文件 中 实 现 。 这 些 文 件 可 以 在 您 的 系 统 中 安 装 C++ <strong>VisiBroker</strong> <strong>Edition</strong> 的 目 录 下 的examples/CosEvent 子 目 录 中 找 到 。派 生 PushSupplier 类C++:实 现 提 供 者 的 第 一 个 步 骤 是 从 如 下 所 示 的 PushSupplier 接 口 派 生 我 们 自 己 的PushModel 类 。module CosEventComm {interface PushSupplier {void disconnect_push_supplier();};};以 下 的 代 码 示 例 显 示 的 是 在 C++ 下 实 现 的 PushModel 类 。 当 通 道 遭 受 破 坏 时 ,EventChannel 将 调 用 disconnect_push_supplier 方 法 以 断 开 提 供 者 。 该 实 现 仅 打 印一 条 消 息 , 然 后 退 出 。 如 果 PushModel 对 象 是 永 久 型 的 , 该 方 法 也 可 以 调 用deactivate_obj 以 去 激 活 对 象 。// PushModel.C#include "CosEventComm_s.hh"#include "CosEventChannelAdmin_c.hh"class PushModel :public POA_CosEventComm::PushSupplier, public VISThread {public:void disconnect_push_supplier() {cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!