コードサンプル11-8に,IDLコンパイラ(IDLサンプル11-1)が二つのクライアントファイルexample_c.hhとexample_c.ccをどのように生成するかを示します。この二つのファイルはクライアントが使用するexampleクラスを提供します。規則でIDLコンパイラが生成するファイルには必ず.ccまたは.hhという拡張子が付けられ,ユーザが自分で作成したファイルと区別できるようになっています。ファイルに別の拡張子を付けたければファイル生成の規則を変えることもできます。規則を変える方法については,マニュアル「Borland Enterprise Server VisiBroker プログラマーズリファレンス」の「idl2cpp」の記述を参照してください。
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);
};