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.

访 问 接 口 仓 库继 承 的 接 口三 个 非 可 实 例 化 ( 即 抽 象 ) 的 IDL 接 口 定 义 由 IR ( 参 见 上 表 ) 中 包 含 的 许 多 对 象继 承 的 公 共 方 法 。 下 表 总 结 出 了 这 些 被 广 泛 继 承 的 接 口 。 有 关 这 些 接 口 的 其 它 方 法的 详 情 , 请 参 阅 程 序 员 参 考 。表 17.3由 许 多 IR 对 象 继 承 的 接 口接 口 继 承 者 主 要 查 询 方 法IRObject 包 含 Repository 所 有 IR def_kind(): 返 回 IR 对 象 的 定 义类 型 , 例 如 , 模 块 或 接 口 ;destroy(): 销 毁 一 个 IR 对 象ContainerContained包 含 其 它 IR 对 象 ( 例 如 模 块 或 接口 ) 的 IR 对 象 。可 被 包 含 于 其 它 对 象 中 ( 即Containers) 中 的 IR 对 象 。lookup(): 根 据 名 称 查 询 一 个 包 含的 对 象 ; contents(): 列 出Container 中 所 包 含 的 对 象 ;describe_contents()/code> ; 描述 Container 中 的 对 象 。name(): 该 对 象 的 名 称 ;defined_in(): 包 含 一 个 对 象 的Container ; describe(): 描 述 一个 对 象 ; move (): 将 一 个 对 象 移到 另 一 个 container。访 问 接 口 仓 库您 的 客 户 端 程 序 可 以 使 用 一 个 接 口 仓 库 的 IDL 接 口 来 取 得 关 于 它 所 包 含 的 对 象 的信 息 。 您 的 客 户 端 程 序 可 以 限 制 到 Repository , 然 后 调 用 以 下 所 示 的 方 法 。 关 于该 接 口 的 完 整 描 述 , 请 参 阅 程 序 员 参 考C++: class CORBA {class Repository : public Container {. . .CORBA::Contained_ptr lookup_id(const char * search_id);CORBA::PrimitiveDef_ptr get_primitive(CORBA::PrimitiveKind kind);CORBA::StringDef_ptr create_string(CORBA::ULong bound);CORBA::SequenceDef_ptr create_sequence(CORBA::ULong bound,CORBA::IDLType_ptr element_type);CORBA::ArrayDef_ptr create_array(CORBA::ULong length,CORBA::IDLType_ptr element_type);. . .};. . .};注 : 使 用 接 口 仓 库 的 程 序 必 须 用 -D_VIS_INCLUDE_IR 标 志 来 编 译 。Java:package org.omg.CORBA;public interface Repository extends Container {. . .org.omg.CORBA.Contained lookup_id(string id);org.omg.CORBA.PrimitiveDef get_primitive(org.omg.CORBA.PrimitiveKind kind);org.omg.CORBA.StringDef create_string(long bound);使 用 接 口 仓 库 17-7

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

Saved successfully!

Ooh no, something went wrong!