[omniORB] IDL question]

Shen Chun shen.chun@ericsson.com
Wed, 28 Feb 2001 01:26:16 -0600


This is a multi-part message in MIME format.
--------------3D92F7EF03E16CD09A46443C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



-------- Original Message --------
Subject: IDL question


Hi, there:
	I am writing a IDL/C++ program to generate some simple
Corba traffic. Please check the attached IDL file, server file
and omniorb generated header file. 
        In the eg3_impl.cc: 
	class Echo_i : public _impl_Echo,
                       public PortableServer::RefCountServantBase
I will get the omniorb compiling error:

eg3_impl.cc: In function `int main (int, char **)':
eg3_impl.cc:171: no matching function for call to `Echo_i::_this ()'
eg3_impl.cc:174: no matching function for call to `Echo_i_cloned::_this
()'
	The problem is "Echo_i::_this ()" is inside POA_echo_demo
	Please give me some advice: how to implement the class Echo_i.

BR/shen chun
--------------3D92F7EF03E16CD09A46443C
Content-Type: text/plain; charset=us-ascii;
 name="echo.idl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="echo.idl"

//#ifndef __ECHO_IDL__
//#define __ECHO_IDL__

#pragma prefix "ericsson.com"
module Echo_demo {

interface Echo {
// echo of simple types
  short echoShort(in short basic_short);
  long  echoLong(in long basic_long);
  unsigned short echoUShort(in unsigned short basic_UShort);
  unsigned long  echoULong(in unsigned long basic_ULong);
  float echoFloat(in float basic_Float);
  double echoDouble(in double basic_Double);
  boolean echoBoolean(in boolean basic_boolean);
  char echoChar(in char basic_Char);
  octet echoOctet(in octet basic_Octet);
  string echoString(in string mesg);
// user defined types
//  enum Color { red, green, blue, black, mauve, orange};
// Color echoEnum(in Color col);
// Exception echo example  
  exception ex1{
	string msg;
  };
  void echo_ex1() raises(ex1);
  
  exception ex2{
  };
  
  void echo_ex2() raises(ex2);

  exception ex3{
	char  identifier;
	short basic_short;
	long  basic_long;
  };
  void echo_ex3() raises(ex3);

// !! not supported by omniORB at the moment
//  wchar echoWchar(in wchar basic_wchar);
//  wstring echoWstring(in wstring mesg);

};

interface Echo_cloned {
// echo of simple types
  short echoShort(in short basic_short);
  long  echoLong(in long basic_long);
  unsigned short echoUShort(in unsigned short basic_UShort);
  unsigned long  echoULong(in unsigned long basic_ULong);
  float echoFloat(in float basic_Float);
  double echoDouble(in double basic_Double);
  boolean echoBoolean(in boolean basic_boolean);
  char echoChar(in char basic_Char);
  octet echoOctet(in octet basic_Octet);
  string echoString(in string mesg);

// user defined types
//  enum Color { red, green, blue, black, mauve, orange};
//  Color echoEnum(in Color col);

// Exception echo example  
  exception ex1{
	string msg;
  };
  void echo_ex1() raises(ex1);
 
  exception ex2{
  };
  
  void echo_ex2() raises(ex2);

  exception ex3{
	char  identifier;
	short basic_short;
	long  basic_long;
  };
  void echo_ex3() raises(ex3);

// !! not supported by omniORB at the moment
//  wchar echoWchar(in wchar basic_wchar);
//  wstring echoWstring(in wstring mesg);

};
};

//#endif
 


--------------3D92F7EF03E16CD09A46443C
Content-Type: text/plain; charset=us-ascii;
 name="eg3_impl.cc"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="eg3_impl.cc"

// eg2_impl.cc - This is the source code of example 2 used in Chapter 2
//               "The Basics" of the omniORB user guide.
//		 We extend the echo of all(?) the basic types in order to
//		 check out the transfer syntax of all of them
//
//               This is the object implementation.
// 
// Usage: eg2_impl
//
//        On startup, the object reference is printed to cerr as a
//        stringified IOR. This string should be used as the argument to 
//        eg2_clt.
//

#include <time.h>
#include <iostream.h>
#include <echo.hh>
using namespace Echo_demo;
//using namespace POA_Echo_demo;

static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref, const char* contextid, const char* contextkind, const char* objectid, const char* objectkind);

// all the basic types (supported)
//class Echo_i : public POA_Echo,
  class Echo_i : public _impl_Echo,
	         public PortableServer::RefCountServantBase
{
public:
  inline Echo_i() {}
  virtual ~Echo_i() {}

  virtual CORBA::Short echoShort(CORBA::Short basic_short);
  virtual CORBA::Long  echoLong(CORBA::Long basic_long);
  virtual CORBA::UShort echoUShort(CORBA::UShort basic_unsignedshort);
  virtual CORBA::ULong echoULong(CORBA::ULong basic_unsignedlong);
  virtual CORBA::Float echoFloat(CORBA::Float basic_long);
  virtual CORBA::Double echoDouble(CORBA::Double basic_double);
  virtual CORBA::Boolean echoBoolean(CORBA::Boolean basic_boolean);  
  virtual CORBA::Char echoChar(CORBA::Char basic_char);
  virtual CORBA::Octet echoOctet(CORBA::Octet basic_octet);
		  char* echoString(const char* mesg);
  		  void echo_ex1() throw(Echo::ex1);
  	          void echo_ex2() throw(Echo::ex2);
		  void echo_ex3() throw(Echo::ex3);
};

  CORBA::Short Echo_i::echoShort(CORBA::Short basic_short) {
	return basic_short; 
}
  CORBA::Long  Echo_i::echoLong(CORBA::Long basic_long){
	return basic_long;
}
  CORBA::UShort Echo_i::echoUShort(CORBA::UShort basic_unsignedshort){
	return basic_unsignedshort;
}
  CORBA::ULong Echo_i::echoULong(CORBA::ULong basic_unsignedlong){
	return basic_unsignedlong;
}
  CORBA::Float Echo_i::echoFloat(CORBA::Float basic_float){ 
	return basic_float;
}
  CORBA::Double Echo_i::echoDouble(CORBA::Double basic_double) {
	return basic_double;
}
  CORBA::Char Echo_i::echoChar(CORBA::Char basic_char){
	return basic_char;
}
  CORBA::Boolean Echo_i::echoBoolean(CORBA::Boolean basic_boolean){
	return basic_boolean;
}
  char* Echo_i::echoString(const char* mesg){
	 return CORBA::string_dup(mesg);
}

  CORBA::Octet Echo_i::echoOctet(CORBA::Octet basic_Octet) {
	return basic_Octet;
}

         void  Echo_i::echo_ex1() throw (Echo::ex1) {
               throw Echo::ex1("String excetpion for ex1");	
}
	 void  Echo_i::echo_ex2() throw (Echo::ex2) {
	       throw Echo::ex2();
} 
	 void  Echo_i::echo_ex3() throw (Echo::ex3) {
	       throw Echo::ex3('a',34,6552);
}

// This is cloned from the first with the different interface name in IDL
//class Echo_i_cloned : public POA_Echo_cloned,
  class Echo_i_cloned : public _impl_Echo_cloned, 
	 	        public PortableServer::RefCountServantBase
{
public:
  inline Echo_i_cloned() {}
  virtual ~Echo_i_cloned() {}

  virtual CORBA::Short echoShort(CORBA::Short basic_short);
  virtual CORBA::Long  echoLong(CORBA::Long basic_long);
  virtual CORBA::UShort echoUShort(CORBA::UShort basic_unsignedshort);
  virtual CORBA::ULong echoULong(CORBA::ULong basic_unsignedlong);
  virtual CORBA::Float echoFloat(CORBA::Float basic_long);
  virtual CORBA::Double echoDouble(CORBA::Double basic_double);
  virtual CORBA::Boolean echoBoolean(CORBA::Boolean basic_boolean);  
  virtual CORBA::Char echoChar(CORBA::Char basic_char);
  virtual CORBA::Octet echoOctet(CORBA::Octet basic_octet);
		  char* echoString(const char* mesg);
  		  void echo_ex1() throw(Echo_cloned::ex1);
  	          void echo_ex2() throw(Echo_cloned::ex2);
		  void echo_ex3() throw(Echo_cloned::ex3);
};

 CORBA::Short Echo_i_cloned::echoShort(CORBA::Short basic_short) {
	return basic_short; 
}
  CORBA::Long  Echo_i_cloned::echoLong(CORBA::Long basic_long){
	return basic_long;
}
  CORBA::UShort Echo_i_cloned::echoUShort(CORBA::UShort basic_unsignedshort){
	return basic_unsignedshort;
}
  CORBA::ULong Echo_i_cloned::echoULong(CORBA::ULong basic_unsignedlong){
	return basic_unsignedlong;
}
  CORBA::Float Echo_i_cloned::echoFloat(CORBA::Float basic_float){ 
	return basic_float;
}
  CORBA::Double Echo_i_cloned::echoDouble(CORBA::Double basic_double) {
	return basic_double;
}
  CORBA::Char Echo_i_cloned::echoChar(CORBA::Char basic_char){
	return basic_char;
}
  CORBA::Boolean Echo_i_cloned::echoBoolean(CORBA::Boolean basic_boolean){
	return basic_boolean;
}
  char* Echo_i_cloned::echoString(const char* mesg){
	 return CORBA::string_dup(mesg);
}

  CORBA::Octet Echo_i_cloned::echoOctet(CORBA::Octet basic_Octet) {
	return basic_Octet;
}

         void  Echo_i_cloned::echo_ex1() throw (Echo_cloned::ex1) {
               throw Echo_cloned::ex1("String excetpion for ex1");	
}
	 void  Echo_i_cloned::echo_ex2() throw (Echo_cloned::ex2) {
	       throw Echo_cloned::ex2();
} 
	 void  Echo_i_cloned::echo_ex3() throw (Echo_cloned::ex3) {
	       throw Echo_cloned::ex3('a',34,6552);
}
//////////////////////////////////////////////////////////////////////////

int main(int argc, char** argv) {
  try {
    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3");

    CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
   
    Echo_i* myecho = new Echo_i();
    Echo_i_cloned* myechocloned = new Echo_i_cloned();
 
    PortableServer::ObjectId_var myechoid = poa->activate_object(myecho);
    PortableServer::ObjectId_var myechoidcloned = poa->activate_object(myechocloned);

    // Obtain a reference to the object, and register it in  
    // the naming service
    obj = myecho->_this();
    if(!bindObjectToName(orb, obj,"test1","my_context","Echo","Object"))
    	return 1;
    obj = myechocloned->_this();
    if(!bindObjectToName(orb, obj,"test2","my_context","Echo_cloned","Object"))
    	return 1;

    myecho->_remove_ref();
    myechocloned->_remove_ref();
    
    PortableServer::POAManager_var pman = poa->the_POAManager();
    pman->activate();

    orb->run();
    orb->destroy();
  }
  catch(CORBA::SystemException&) {
    cerr << "Caught CORBA::SystemException." << endl;
  }
  catch(CORBA::Exception&) {
    cerr << "Caught CORBA::Exception." << endl;
  }
  catch(omniORB::fatalException& fe) {
    cerr << "Caught omniORB::fatalException:" << endl;
    cerr << "  file: " << fe.file() << endl;
    cerr << "  line: " << fe.line() << endl;
    cerr << "  mesg: " << fe.errmsg() << endl;
  }
  catch(...) {
    cerr << "Caught unknown exception." << endl;
  }

  return 0;
}
/////////////////////////////////////////////////////////////////////////////////

static CORBA::Boolean
bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref, const char* contextid, const char* contextkind, const char* objectid, const char* objectkind)
{
  CosNaming::NamingContext_var rootContext;

  try {
    // Obtain a reference to the root context of the Name service:
    CORBA::Object_var obj;
    obj = orb->resolve_initial_references("NameService");

    // Narrow the reference returned.
    rootContext = CosNaming::NamingContext::_narrow(obj);
    if( CORBA::is_nil(rootContext) ) {
      cerr << "Failed to narrow the root naming context." << endl;
      return 0;
    }
  }
  catch(CORBA::ORB::InvalidName& ex) {
    // This should not happen!
    cerr << "Service required is invalid [does not exist]." << endl;
    return 0;
  }


  try {
    // Bind a context called "test" to the root context:
    CosNaming::Name contextName;
    contextName.length(1);
    contextName[0].id=CORBA::string_dup(contextid);
    contextName[0].kind=CORBA::string_dup(contextkind);
 
    //contextName[0].id   = (const char*) "test";       // string copied
    //contextName[0].kind = (const char*) "my_context"; // string copied
    // Note on kind: The kind field is used to indicate the type
    // of the object. This is to avoid conventions such as that used
    // by files (name.type -- e.g. test.ps = postscript etc.)

    CosNaming::NamingContext_var testContext;
    try {
      // Bind the context to root.
      testContext = rootContext->bind_new_context(contextName);
    }
    catch(CosNaming::NamingContext::AlreadyBound& ex) {
      // If the context already exists, this exception will be raised.
      // In this case, just resolve the name and assign testContext
      // to the object returned:
      CORBA::Object_var obj;
      obj = rootContext->resolve(contextName);
      testContext = CosNaming::NamingContext::_narrow(obj);
      if( CORBA::is_nil(testContext) ) {
        cerr << "Failed to narrow naming context." << endl;
        return 0;
      }
    }


    // Bind objref with name Echo to the testContext:
    CosNaming::Name objectName;
    objectName.length(1);
    objectName[0].id=CORBA::string_dup(objectid);
    objectName[0].kind=CORBA::string_dup(objectkind);
    //objectName[0].id   = (const char*) "Echo";   // string copied
    //objectName[0].kind = (const char*) "Object"; // string copied

    try {
      testContext->bind(objectName, objref);
    }
    catch(CosNaming::NamingContext::AlreadyBound& ex) {
      testContext->rebind(objectName, objref);
    }
    // Note: Using rebind() will overwrite any Object previously bound
    //       to /test/Echo with obj.
    //       Alternatively, bind() can be used, which will raise a
    //       CosNaming::NamingContext::AlreadyBound exception if the name
    //       supplied is already bound to an object.

    // Amendment: When using OrbixNames, it is necessary to first try bind
    // and then rebind, as rebind on it's own will throw a NotFoundexception if
    // the Name has not already been bound. [This is incorrect behaviour -
    // it should just bind].
  }
  catch(CORBA::COMM_FAILURE& ex) {
    cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
         << "naming service." << endl;
    return 0;
  }
  catch(CORBA::SystemException&) {
    cerr << "Caught a CORBA::SystemException while using the naming service."
	 << endl;
    return 0;
  }

  return 1;
}



--------------3D92F7EF03E16CD09A46443C
Content-Type: text/plain; charset=us-ascii;
 name="echo.hh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="echo.hh"

// This file is generated by omniidl (C++ backend)- omniORB_3_0. Do not edit.
#ifndef __echo_hh__
#define __echo_hh__

#ifndef USE_omniORB_logStream
#define USE_omniORB_logStream
#endif

#ifndef __CORBA_H_EXTERNAL_GUARD__
#include <omniORB3/CORBA.h>
#endif

#ifndef  USE_core_stub_in_nt_dll
# define USE_core_stub_in_nt_dll_NOT_DEFINED_echo
#endif
#ifndef  USE_dyn_stub_in_nt_dll
# define USE_dyn_stub_in_nt_dll_NOT_DEFINED_echo
#endif

#ifdef USE_stub_in_nt_dll
#ifndef USE_core_stub_in_nt_dll
#define USE_core_stub_in_nt_dll
#endif
#ifndef USE_dyn_stub_in_nt_dll
#define USE_dyn_stub_in_nt_dll
#endif
#endif

#ifdef _core_attr
# error "A local CPP macro _core_attr has already been defined."
#else
# ifdef  USE_core_stub_in_nt_dll
#  define _core_attr _OMNIORB_NTDLL_IMPORT
# else
#  define _core_attr
# endif
#endif

#ifdef _dyn_attr
# error "A local CPP macro _dyn_attr has already been defined."
#else
# ifdef  USE_dyn_stub_in_nt_dll
#  define _dyn_attr _OMNIORB_NTDLL_IMPORT
# else
#  define _dyn_attr
# endif
#endif

_CORBA_MODULE Echo_demo

_CORBA_MODULE_BEG

#ifndef __Echo__demo_mEcho__
#define __Echo__demo_mEcho__

  class Echo;
  class _objref_Echo;
  class _impl_Echo;
  
  typedef _objref_Echo* Echo_ptr;
  typedef Echo_ptr EchoRef;

  class Echo_Helper {
  public:
    typedef Echo_ptr _ptr_type;

    static _ptr_type _nil();
    static _CORBA_Boolean is_nil(_ptr_type);
    static void release(_ptr_type);
    static void duplicate(_ptr_type);
    static size_t NP_alignedSize(_ptr_type, size_t);
    static void marshalObjRef(_ptr_type, NetBufferedStream&);
    static _ptr_type unmarshalObjRef(NetBufferedStream&);
    static void marshalObjRef(_ptr_type, MemBufferedStream&);
    static _ptr_type unmarshalObjRef(MemBufferedStream&);
  };

  typedef _CORBA_ObjRef_Var<_objref_Echo, Echo_Helper> Echo_var;
  typedef _CORBA_ObjRef_OUT_arg<_objref_Echo,Echo_Helper > Echo_out;

#endif

  class Echo {
  public:
    // Declarations for this interface type.
    typedef Echo_ptr _ptr_type;
    typedef Echo_var _var_type;

    static _ptr_type _duplicate(_ptr_type);
    static _ptr_type _narrow(CORBA::Object_ptr);
    static _ptr_type _nil();

    static inline size_t _alignedSize(_ptr_type, size_t);
    static inline void _marshalObjRef(_ptr_type, NetBufferedStream&);
    static inline void _marshalObjRef(_ptr_type, MemBufferedStream&);

    static inline _ptr_type _unmarshalObjRef(NetBufferedStream& s) {
      CORBA::Object_ptr obj = CORBA::UnMarshalObjRef(_PD_repoId, s);
      _ptr_type result = _narrow(obj);
      CORBA::release(obj);
      return result;
    }

    static inline _ptr_type _unmarshalObjRef(MemBufferedStream& s) {
      CORBA::Object_ptr obj = CORBA::UnMarshalObjRef(_PD_repoId, s);
      _ptr_type result = _narrow(obj);
      CORBA::release(obj);
      return result;
    }

    static _core_attr const char* _PD_repoId;

    // Other IDL defined within this scope.
    class ex1 : public CORBA::UserException {
    public:

      CORBA::String_member msg;

      inline ex1() {
        pd_insertToAnyFn    = insertToAnyFn;
        pd_insertToAnyFnNCP = insertToAnyFnNCP;
      }
      ex1(const ex1&);
      ex1(const char* i_msg);
      ex1& operator=(const ex1&);
      virtual ~ex1();
      virtual void _raise();
      static ex1* _downcast(CORBA::Exception*);
      static const ex1* _downcast(const CORBA::Exception*);
      static inline ex1* _narrow(CORBA::Exception* _e) {
        return _downcast(_e);
      }

      size_t _NP_alignedSize(size_t) const;

      void operator>>=(NetBufferedStream&) const ;
      void operator>>=(MemBufferedStream&) const ;
      void operator<<=(NetBufferedStream&) ;
      void operator<<=(MemBufferedStream&) ;

      static _core_attr insertExceptionToAny    insertToAnyFn;
      static _core_attr insertExceptionToAnyNCP insertToAnyFnNCP;

      virtual CORBA::Exception* _NP_duplicate() const;

      static _core_attr const char* _PD_repoId;

    private:
      virtual const char* _NP_typeId() const;
      virtual const char* _NP_repoId(int*) const;
      virtual void _NP_marshal(NetBufferedStream&) const;
      virtual void _NP_marshal(MemBufferedStream&) const;
    };

    static _dyn_attr const CORBA::TypeCode_ptr _tc_ex1;

    class ex2 : public CORBA::UserException {
    public:

      inline ex2() {
        pd_insertToAnyFn    = insertToAnyFn;
        pd_insertToAnyFnNCP = insertToAnyFnNCP;
      }
      ex2(const ex2&);
      
      ex2& operator=(const ex2&);
      virtual ~ex2();
      virtual void _raise();
      static ex2* _downcast(CORBA::Exception*);
      static const ex2* _downcast(const CORBA::Exception*);
      static inline ex2* _narrow(CORBA::Exception* _e) {
        return _downcast(_e);
      }

      inline void operator>>=(NetBufferedStream&) const { }
      inline void operator>>=(MemBufferedStream&) const { }
      inline void operator<<=(NetBufferedStream&) { }
      inline void operator<<=(MemBufferedStream&) { }

      static _core_attr insertExceptionToAny    insertToAnyFn;
      static _core_attr insertExceptionToAnyNCP insertToAnyFnNCP;

      virtual CORBA::Exception* _NP_duplicate() const;

      static _core_attr const char* _PD_repoId;

    private:
      virtual const char* _NP_typeId() const;
      virtual const char* _NP_repoId(int*) const;
      virtual void _NP_marshal(NetBufferedStream&) const;
      virtual void _NP_marshal(MemBufferedStream&) const;
    };

    static _dyn_attr const CORBA::TypeCode_ptr _tc_ex2;

    class ex3 : public CORBA::UserException {
    public:

      CORBA::Char identifier;

      CORBA::Short basic_short;

      CORBA::Long basic_long;

      inline ex3() {
        pd_insertToAnyFn    = insertToAnyFn;
        pd_insertToAnyFnNCP = insertToAnyFnNCP;
      }
      ex3(const ex3&);
      ex3(CORBA::Char i_identifier, CORBA::Short i_basic_short, CORBA::Long i_basic_long);
      ex3& operator=(const ex3&);
      virtual ~ex3();
      virtual void _raise();
      static ex3* _downcast(CORBA::Exception*);
      static const ex3* _downcast(const CORBA::Exception*);
      static inline ex3* _narrow(CORBA::Exception* _e) {
        return _downcast(_e);
      }

      size_t _NP_alignedSize(size_t) const;

      void operator>>=(NetBufferedStream&) const ;
      void operator>>=(MemBufferedStream&) const ;
      void operator<<=(NetBufferedStream&) ;
      void operator<<=(MemBufferedStream&) ;

      static _core_attr insertExceptionToAny    insertToAnyFn;
      static _core_attr insertExceptionToAnyNCP insertToAnyFnNCP;

      virtual CORBA::Exception* _NP_duplicate() const;

      static _core_attr const char* _PD_repoId;

    private:
      virtual const char* _NP_typeId() const;
      virtual const char* _NP_repoId(int*) const;
      virtual void _NP_marshal(NetBufferedStream&) const;
      virtual void _NP_marshal(MemBufferedStream&) const;
    };

    static _dyn_attr const CORBA::TypeCode_ptr _tc_ex3;

  };

  class _objref_Echo :
    public virtual CORBA::Object, public virtual omniObjRef
  {
  public:
    CORBA::Short echoShort(CORBA::Short basic_short);
    CORBA::Long echoLong(CORBA::Long basic_long);
    CORBA::UShort echoUShort(CORBA::UShort basic_UShort);
    CORBA::ULong echoULong(CORBA::ULong basic_ULong);
    CORBA::Float echoFloat(CORBA::Float basic_Float);
    CORBA::Double echoDouble(CORBA::Double basic_Double);
    CORBA::Boolean echoBoolean(CORBA::Boolean basic_boolean);
    CORBA::Char echoChar(CORBA::Char basic_Char);
    CORBA::Octet echoOctet(CORBA::Octet basic_Octet);
    char* echoString(const char* mesg);
    void echo_ex1();
    void echo_ex2();
    void echo_ex3();
    
    inline _objref_Echo() { _PR_setobj(0); }  // nil
    _objref_Echo(const char*, IOP::TaggedProfileList*, omniIdentity*, omniLocalIdentity*);

  protected:
    virtual ~_objref_Echo();

  private:
    virtual void* _ptrToObjRef(const char*);

    _objref_Echo(const _objref_Echo&);
    _objref_Echo& operator = (const _objref_Echo&);
    // not implemented
  };

  class _pof_Echo : public proxyObjectFactory {
  public:
    inline _pof_Echo() : proxyObjectFactory(Echo::_PD_repoId) {}
    virtual ~_pof_Echo();

    virtual omniObjRef* newObjRef(const char*, IOP::TaggedProfileList*,
                                  omniIdentity*, omniLocalIdentity*);
    virtual _CORBA_Boolean is_a(const char*) const;
  };

  class _impl_Echo :
    public virtual omniServant
  {
  public:
    virtual ~_impl_Echo();

    virtual CORBA::Short echoShort(CORBA::Short basic_short) = 0;
    virtual CORBA::Long echoLong(CORBA::Long basic_long) = 0;
    virtual CORBA::UShort echoUShort(CORBA::UShort basic_UShort) = 0;
    virtual CORBA::ULong echoULong(CORBA::ULong basic_ULong) = 0;
    virtual CORBA::Float echoFloat(CORBA::Float basic_Float) = 0;
    virtual CORBA::Double echoDouble(CORBA::Double basic_Double) = 0;
    virtual CORBA::Boolean echoBoolean(CORBA::Boolean basic_boolean) = 0;
    virtual CORBA::Char echoChar(CORBA::Char basic_Char) = 0;
    virtual CORBA::Octet echoOctet(CORBA::Octet basic_Octet) = 0;
    virtual char* echoString(const char* mesg) = 0;
    virtual void echo_ex1() = 0;
    virtual void echo_ex2() = 0;
    virtual void echo_ex3() = 0;
    
  public:  // Really protected, workaround for xlC
    virtual _CORBA_Boolean _dispatch(GIOP_S&);

  private:
    virtual void* _ptrToInterface(const char*);
    virtual const char* _mostDerivedRepoId();
  };

  _CORBA_MODULE_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_Echo;

#ifndef __Echo__demo_mEcho__cloned__
#define __Echo__demo_mEcho__cloned__

  class Echo_cloned;
  class _objref_Echo_cloned;
  class _impl_Echo_cloned;
  
  typedef _objref_Echo_cloned* Echo_cloned_ptr;
  typedef Echo_cloned_ptr Echo_clonedRef;

  class Echo_cloned_Helper {
  public:
    typedef Echo_cloned_ptr _ptr_type;

    static _ptr_type _nil();
    static _CORBA_Boolean is_nil(_ptr_type);
    static void release(_ptr_type);
    static void duplicate(_ptr_type);
    static size_t NP_alignedSize(_ptr_type, size_t);
    static void marshalObjRef(_ptr_type, NetBufferedStream&);
    static _ptr_type unmarshalObjRef(NetBufferedStream&);
    static void marshalObjRef(_ptr_type, MemBufferedStream&);
    static _ptr_type unmarshalObjRef(MemBufferedStream&);
  };

  typedef _CORBA_ObjRef_Var<_objref_Echo_cloned, Echo_cloned_Helper> Echo_cloned_var;
  typedef _CORBA_ObjRef_OUT_arg<_objref_Echo_cloned,Echo_cloned_Helper > Echo_cloned_out;

#endif

  class Echo_cloned {
  public:
    // Declarations for this interface type.
    typedef Echo_cloned_ptr _ptr_type;
    typedef Echo_cloned_var _var_type;

    static _ptr_type _duplicate(_ptr_type);
    static _ptr_type _narrow(CORBA::Object_ptr);
    static _ptr_type _nil();

    static inline size_t _alignedSize(_ptr_type, size_t);
    static inline void _marshalObjRef(_ptr_type, NetBufferedStream&);
    static inline void _marshalObjRef(_ptr_type, MemBufferedStream&);

    static inline _ptr_type _unmarshalObjRef(NetBufferedStream& s) {
      CORBA::Object_ptr obj = CORBA::UnMarshalObjRef(_PD_repoId, s);
      _ptr_type result = _narrow(obj);
      CORBA::release(obj);
      return result;
    }

    static inline _ptr_type _unmarshalObjRef(MemBufferedStream& s) {
      CORBA::Object_ptr obj = CORBA::UnMarshalObjRef(_PD_repoId, s);
      _ptr_type result = _narrow(obj);
      CORBA::release(obj);
      return result;
    }

    static _core_attr const char* _PD_repoId;

    // Other IDL defined within this scope.
    class ex1 : public CORBA::UserException {
    public:

      CORBA::String_member msg;

      inline ex1() {
        pd_insertToAnyFn    = insertToAnyFn;
        pd_insertToAnyFnNCP = insertToAnyFnNCP;
      }
      ex1(const ex1&);
      ex1(const char* i_msg);
      ex1& operator=(const ex1&);
      virtual ~ex1();
      virtual void _raise();
      static ex1* _downcast(CORBA::Exception*);
      static const ex1* _downcast(const CORBA::Exception*);
      static inline ex1* _narrow(CORBA::Exception* _e) {
        return _downcast(_e);
      }

      size_t _NP_alignedSize(size_t) const;

      void operator>>=(NetBufferedStream&) const ;
      void operator>>=(MemBufferedStream&) const ;
      void operator<<=(NetBufferedStream&) ;
      void operator<<=(MemBufferedStream&) ;

      static _core_attr insertExceptionToAny    insertToAnyFn;
      static _core_attr insertExceptionToAnyNCP insertToAnyFnNCP;

      virtual CORBA::Exception* _NP_duplicate() const;

      static _core_attr const char* _PD_repoId;

    private:
      virtual const char* _NP_typeId() const;
      virtual const char* _NP_repoId(int*) const;
      virtual void _NP_marshal(NetBufferedStream&) const;
      virtual void _NP_marshal(MemBufferedStream&) const;
    };

    static _dyn_attr const CORBA::TypeCode_ptr _tc_ex1;

    class ex2 : public CORBA::UserException {
    public:

      inline ex2() {
        pd_insertToAnyFn    = insertToAnyFn;
        pd_insertToAnyFnNCP = insertToAnyFnNCP;
      }
      ex2(const ex2&);
      
      ex2& operator=(const ex2&);
      virtual ~ex2();
      virtual void _raise();
      static ex2* _downcast(CORBA::Exception*);
      static const ex2* _downcast(const CORBA::Exception*);
      static inline ex2* _narrow(CORBA::Exception* _e) {
        return _downcast(_e);
      }

      inline void operator>>=(NetBufferedStream&) const { }
      inline void operator>>=(MemBufferedStream&) const { }
      inline void operator<<=(NetBufferedStream&) { }
      inline void operator<<=(MemBufferedStream&) { }

      static _core_attr insertExceptionToAny    insertToAnyFn;
      static _core_attr insertExceptionToAnyNCP insertToAnyFnNCP;

      virtual CORBA::Exception* _NP_duplicate() const;

      static _core_attr const char* _PD_repoId;

    private:
      virtual const char* _NP_typeId() const;
      virtual const char* _NP_repoId(int*) const;
      virtual void _NP_marshal(NetBufferedStream&) const;
      virtual void _NP_marshal(MemBufferedStream&) const;
    };

    static _dyn_attr const CORBA::TypeCode_ptr _tc_ex2;

    class ex3 : public CORBA::UserException {
    public:

      CORBA::Char identifier;

      CORBA::Short basic_short;

      CORBA::Long basic_long;

      inline ex3() {
        pd_insertToAnyFn    = insertToAnyFn;
        pd_insertToAnyFnNCP = insertToAnyFnNCP;
      }
      ex3(const ex3&);
      ex3(CORBA::Char i_identifier, CORBA::Short i_basic_short, CORBA::Long i_basic_long);
      ex3& operator=(const ex3&);
      virtual ~ex3();
      virtual void _raise();
      static ex3* _downcast(CORBA::Exception*);
      static const ex3* _downcast(const CORBA::Exception*);
      static inline ex3* _narrow(CORBA::Exception* _e) {
        return _downcast(_e);
      }

      size_t _NP_alignedSize(size_t) const;

      void operator>>=(NetBufferedStream&) const ;
      void operator>>=(MemBufferedStream&) const ;
      void operator<<=(NetBufferedStream&) ;
      void operator<<=(MemBufferedStream&) ;

      static _core_attr insertExceptionToAny    insertToAnyFn;
      static _core_attr insertExceptionToAnyNCP insertToAnyFnNCP;

      virtual CORBA::Exception* _NP_duplicate() const;

      static _core_attr const char* _PD_repoId;

    private:
      virtual const char* _NP_typeId() const;
      virtual const char* _NP_repoId(int*) const;
      virtual void _NP_marshal(NetBufferedStream&) const;
      virtual void _NP_marshal(MemBufferedStream&) const;
    };

    static _dyn_attr const CORBA::TypeCode_ptr _tc_ex3;

  };

  class _objref_Echo_cloned :
    public virtual CORBA::Object, public virtual omniObjRef
  {
  public:
    CORBA::Short echoShort(CORBA::Short basic_short);
    CORBA::Long echoLong(CORBA::Long basic_long);
    CORBA::UShort echoUShort(CORBA::UShort basic_UShort);
    CORBA::ULong echoULong(CORBA::ULong basic_ULong);
    CORBA::Float echoFloat(CORBA::Float basic_Float);
    CORBA::Double echoDouble(CORBA::Double basic_Double);
    CORBA::Boolean echoBoolean(CORBA::Boolean basic_boolean);
    CORBA::Char echoChar(CORBA::Char basic_Char);
    CORBA::Octet echoOctet(CORBA::Octet basic_Octet);
    char* echoString(const char* mesg);
    void echo_ex1();
    void echo_ex2();
    void echo_ex3();
    
    inline _objref_Echo_cloned() { _PR_setobj(0); }  // nil
    _objref_Echo_cloned(const char*, IOP::TaggedProfileList*, omniIdentity*, omniLocalIdentity*);

  protected:
    virtual ~_objref_Echo_cloned();

  private:
    virtual void* _ptrToObjRef(const char*);

    _objref_Echo_cloned(const _objref_Echo_cloned&);
    _objref_Echo_cloned& operator = (const _objref_Echo_cloned&);
    // not implemented
  };

  class _pof_Echo_cloned : public proxyObjectFactory {
  public:
    inline _pof_Echo_cloned() : proxyObjectFactory(Echo_cloned::_PD_repoId) {}
    virtual ~_pof_Echo_cloned();

    virtual omniObjRef* newObjRef(const char*, IOP::TaggedProfileList*,
                                  omniIdentity*, omniLocalIdentity*);
    virtual _CORBA_Boolean is_a(const char*) const;
  };

  class _impl_Echo_cloned :
    public virtual omniServant
  {
  public:
    virtual ~_impl_Echo_cloned();

    virtual CORBA::Short echoShort(CORBA::Short basic_short) = 0;
    virtual CORBA::Long echoLong(CORBA::Long basic_long) = 0;
    virtual CORBA::UShort echoUShort(CORBA::UShort basic_UShort) = 0;
    virtual CORBA::ULong echoULong(CORBA::ULong basic_ULong) = 0;
    virtual CORBA::Float echoFloat(CORBA::Float basic_Float) = 0;
    virtual CORBA::Double echoDouble(CORBA::Double basic_Double) = 0;
    virtual CORBA::Boolean echoBoolean(CORBA::Boolean basic_boolean) = 0;
    virtual CORBA::Char echoChar(CORBA::Char basic_Char) = 0;
    virtual CORBA::Octet echoOctet(CORBA::Octet basic_Octet) = 0;
    virtual char* echoString(const char* mesg) = 0;
    virtual void echo_ex1() = 0;
    virtual void echo_ex2() = 0;
    virtual void echo_ex3() = 0;
    
  public:  // Really protected, workaround for xlC
    virtual _CORBA_Boolean _dispatch(GIOP_S&);

  private:
    virtual void* _ptrToInterface(const char*);
    virtual const char* _mostDerivedRepoId();
  };

  _CORBA_MODULE_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_Echo_cloned;

_CORBA_MODULE_END

_CORBA_MODULE POA_Echo_demo
_CORBA_MODULE_BEG

  class Echo :
    public virtual Echo_demo::_impl_Echo,
    public virtual PortableServer::ServantBase
  {
  public:
    virtual ~Echo();

    inline Echo_demo::Echo_ptr _this() {
      return (Echo_demo::Echo_ptr) _do_this(Echo_demo::Echo::_PD_repoId);
    }
  };

  class Echo_cloned :
    public virtual Echo_demo::_impl_Echo_cloned,
    public virtual PortableServer::ServantBase
  {
  public:
    virtual ~Echo_cloned();

    inline Echo_demo::Echo_cloned_ptr _this() {
      return (Echo_demo::Echo_cloned_ptr) _do_this(Echo_demo::Echo_cloned::_PD_repoId);
    }
  };

_CORBA_MODULE_END

#undef _core_attr
#undef _dyn_attr

void operator<<=(CORBA::Any& _a, const Echo_demo::Echo::ex1& _s);
void operator<<=(CORBA::Any& _a, const Echo_demo::Echo::ex1* _sp);
CORBA::Boolean operator>>=(const CORBA::Any& _a, const Echo_demo::Echo::ex1*& _sp);

void operator<<=(CORBA::Any& _a, const Echo_demo::Echo::ex2& _s);
void operator<<=(CORBA::Any& _a, const Echo_demo::Echo::ex2* _sp);
CORBA::Boolean operator>>=(const CORBA::Any& _a, const Echo_demo::Echo::ex2*& _sp);

void operator<<=(CORBA::Any& _a, const Echo_demo::Echo::ex3& _s);
void operator<<=(CORBA::Any& _a, const Echo_demo::Echo::ex3* _sp);
CORBA::Boolean operator>>=(const CORBA::Any& _a, const Echo_demo::Echo::ex3*& _sp);

void operator<<=(CORBA::Any& _a, Echo_demo::Echo_ptr _s);
void operator<<=(CORBA::Any& _a, Echo_demo::Echo_ptr* _s);
CORBA::Boolean operator>>=(const CORBA::Any& _a, Echo_demo::Echo_ptr& _s);

void operator<<=(CORBA::Any& _a, const Echo_demo::Echo_cloned::ex1& _s);
void operator<<=(CORBA::Any& _a, const Echo_demo::Echo_cloned::ex1* _sp);
CORBA::Boolean operator>>=(const CORBA::Any& _a, const Echo_demo::Echo_cloned::ex1*& _sp);

void operator<<=(CORBA::Any& _a, const Echo_demo::Echo_cloned::ex2& _s);
void operator<<=(CORBA::Any& _a, const Echo_demo::Echo_cloned::ex2* _sp);
CORBA::Boolean operator>>=(const CORBA::Any& _a, const Echo_demo::Echo_cloned::ex2*& _sp);

void operator<<=(CORBA::Any& _a, const Echo_demo::Echo_cloned::ex3& _s);
void operator<<=(CORBA::Any& _a, const Echo_demo::Echo_cloned::ex3* _sp);
CORBA::Boolean operator>>=(const CORBA::Any& _a, const Echo_demo::Echo_cloned::ex3*& _sp);

void operator<<=(CORBA::Any& _a, Echo_demo::Echo_cloned_ptr _s);
void operator<<=(CORBA::Any& _a, Echo_demo::Echo_cloned_ptr* _s);
CORBA::Boolean operator>>=(const CORBA::Any& _a, Echo_demo::Echo_cloned_ptr& _s);

inline size_t
Echo_demo::Echo::_alignedSize(Echo_demo::Echo_ptr obj, size_t offset) {
  return CORBA::AlignedObjRef(obj, _PD_repoId, 36, offset);
}

inline void
Echo_demo::Echo::_marshalObjRef(Echo_demo::Echo_ptr obj, NetBufferedStream& s) {
  CORBA::MarshalObjRef(obj, _PD_repoId, 36, s);
}

inline void
Echo_demo::Echo::_marshalObjRef(Echo_demo::Echo_ptr obj, MemBufferedStream& s) {
  CORBA::MarshalObjRef(obj, _PD_repoId, 36, s);
}

inline size_t
Echo_demo::Echo_cloned::_alignedSize(Echo_demo::Echo_cloned_ptr obj, size_t offset) {
  return CORBA::AlignedObjRef(obj, _PD_repoId, 43, offset);
}

inline void
Echo_demo::Echo_cloned::_marshalObjRef(Echo_demo::Echo_cloned_ptr obj, NetBufferedStream& s) {
  CORBA::MarshalObjRef(obj, _PD_repoId, 43, s);
}

inline void
Echo_demo::Echo_cloned::_marshalObjRef(Echo_demo::Echo_cloned_ptr obj, MemBufferedStream& s) {
  CORBA::MarshalObjRef(obj, _PD_repoId, 43, s);
}

#ifdef   USE_core_stub_in_nt_dll_NOT_DEFINED_echo
# undef  USE_core_stub_in_nt_dll
# undef  USE_core_stub_in_nt_dll_NOT_DEFINED_echo
#endif
#ifdef   USE_dyn_stub_in_nt_dll_NOT_DEFINED_echo
# undef  USE_dyn_stub_in_nt_dll
# undef  USE_dyn_stub_in_nt_dll_NOT_DEFINED_echo
#endif

#endif  // __echo_hh__



--------------3D92F7EF03E16CD09A46443C--