Borland(R) Enterprise Server VisiBroker(R) デベロッパーズガイド

[目次][索引][前へ][次へ]

11.4 サーバ用に生成されたコードの考察(C++)

コードサンプル11-11に,IDLコンパイラがexample_s.hhとexample_s.ccという二つのサーバファイルを生成する方法を示します。この二つのファイルはPOA_exampleクラスを提供します。POA_exampleクラスは,インプリメンテーションクラスを派生するためにサーバが使用します。POA_exampleクラスは,PortableServer_ServantBaseクラスから派生します。

IDLコンパイラが生成したファイルの内容は変更しないでください。

コードサンプル11-11 example_s.hh生成ファイルのクラス例
 
class POA_example : public virtual PortableServer_ServantBase {
   protected:
      POA_example(){}
      virtual ~POA_example(){}
public:
   static const CORBA::TypeInfo _skel_info;
   virtual const CORBA::TypeInfo *_type_info() const;
   example_ptr _this();
   virtual void *_safe_narrow(const CORBA::TypeInfo& ) const;
   static POA_example * _narrow(
         PortableServer_ServantBase *_obj);
   // The following operations need to be implemented
   virtual CORBA::Long op1(
         CORBA::Char _x, CORBA::Short_out _y) = 0;
   // Skeleton Operations implemented automatically
   static void _op1(void *_obj, CORBA::MarshalInBuffer &_istrm,
   const char *_oper, VISReplyHandler& handler);
};
 
<この節の構成>
11.4.1 IDLコンパイラが生成するメソッド(スケルトン)
11.4.2 IDLコンパイラが生成するクラステンプレート