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