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.

查 看 Java 下 生 成 的 代 码}}public org.omg.PortableServer.POA _default_POA () {. . .public int op1 (char x, org.omg.CORBA.ShortHolder y) {. . .}查 看 为 客 户 所 生 成 的 代 码 ( 在 C++ 下 )以 下 的 代 码 示 例 说 明 IDL 编 译 器 如 何 从 “ 实 例 IDL 规 范 ” 生 成 两 个 文 件 :example_c.hh 和 example_c.cc。 这 两 个 文 件 提 供 客 户 使 用 的 example 类 。 习 惯 上 ,由 IDL 编 译 器 生 成 的 文 件 使 用 一 个 .cc 或 .hh 后 缀 , 以 便 于 区 别 它 们 与 您 自 己 创建 的 文 件 。 当 然 , 如 果 您 乐 意 , 您 也 可 以 改 变 这 一 习 惯 , 以 产 生 带 不 同 后 缀 的 文件 。 请 参 阅 程 序 员 参 考 。小 心 : 不 要 修 改 由 IDL 编 译 器 生 成 的 文 件 的 内 容 。C++: class example : public virtual CORBA_Object {protected:example() {}example(const example&) {}public:virtual ~example() {}static const CORBA::TypeInfo *_desc();virtual const CORBA::TypeInfo *_type_info() const;virtual void *_safe_narrow(const CORBA::TypeInfo& ) const;static CORBA::Object*_factory();example_ptr _this();static example_ptr _duplicate(example_ptr _obj) { /* . . . */ }static example_ptr _nil() { /* . . . */ }static example_ptr _narrow(CORBA::Object* _obj);static example_ptr _clone(example_ptr _obj) { /* . . . */ }static example_ptr _bind(const char *_object_name = NULL,const char *_host_name = NULL,const CORBA::BindOptions* _opt = NULL,CORBA::ORB_ptr _orb = NULL);static example_ptr _bind(const char *_poa_name,const CORBA::OctetSequence& _id,const char *_host_name = NULL,const CORBA::BindOptions* _opt = NULL,CORBA::ORB_ptr _orb = NULL);virtual CORBA::Long op1(CORBA::Char _x, CORBA::Short_out _y);};编 译 器 生 成 的 方 法 ( 存 根 )以 上 的 代 码 示 例 显 示 由 IDL 编 译 器 生 成 的 op1 方 法 及 其 它 一 些 方 法 。op1 方 法 被 称为 stub , 因 为 当 您 的 客 户 程 序 调 用 它 时 , 它 实 际 上 将 接 口 请 求 和 变 量 封 包 在 一 个11-6 <strong>VisiBroker</strong> 开 发 者 指 南

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

Saved successfully!

Ooh no, something went wrong!