// This file is generated by omniidl2- omniORB_2_8. Do not edit.
#ifndef __echo_hh__
#define __echo_hh__

#ifndef USE_omniORB_logStream
#define USE_omniORB_logStream
#endif

#ifndef __CORBA_H_EXTERNAL_GUARD__
#define __CORBA_H_EXTERNAL_GUARD__
#include <omniORB2/CORBA.h>
#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

#ifndef __Echo__
#define __Echo__
class   Echo;
typedef Echo* Echo_ptr;
typedef Echo_ptr EchoRef;

class Echo_Helper {
  public:
  static Echo_ptr _nil();
  static CORBA::Boolean is_nil(Echo_ptr p);
  static void release(Echo_ptr p);
  static void duplicate(Echo_ptr p);
  static size_t NP_alignedSize(Echo_ptr obj,size_t initialoffset);
  static void marshalObjRef(Echo_ptr obj,NetBufferedStream &s);
  static Echo_ptr unmarshalObjRef(NetBufferedStream &s);
  static void marshalObjRef(Echo_ptr obj,MemBufferedStream &s);
  static Echo_ptr unmarshalObjRef(MemBufferedStream &s);
};
typedef _CORBA_ObjRef_Var<Echo,Echo_Helper> Echo_var;
typedef _CORBA_ObjRef_OUT_arg<Echo,Echo_Helper > Echo_out;

#endif
#define Echo_IntfRepoID "IDL:Echo:1.0"

class Echo : public virtual omniObject, public virtual CORBA::Object {
public:

  virtual char*  echoString(const char*  mesg) = 0;
  typedef Echo_var _var_type;
  typedef Echo_ptr _ptr_type;
  static Echo_ptr _duplicate(Echo_ptr);
  static Echo_ptr _narrow(CORBA::Object_ptr);
  static Echo_ptr _nil();

  static inline size_t NP_alignedSize(Echo_ptr obj,size_t initialoffset) {
    return CORBA::AlignedObjRef(obj,Echo_IntfRepoID,13,initialoffset);
  }

  static inline void marshalObjRef(Echo_ptr obj,NetBufferedStream &s) {
    CORBA::MarshalObjRef(obj,Echo_IntfRepoID,13,s);
  }

  static inline Echo_ptr unmarshalObjRef(NetBufferedStream &s) {
    CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(Echo_IntfRepoID,s);
    Echo_ptr _result = Echo::_narrow(_obj);
    CORBA::release(_obj);
    return _result;
  }

  static inline void marshalObjRef(Echo_ptr obj,MemBufferedStream &s) {
    CORBA::MarshalObjRef(obj,Echo_IntfRepoID,13,s);
  }

  static inline Echo_ptr unmarshalObjRef(MemBufferedStream &s) {
    CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(Echo_IntfRepoID,s);
    Echo_ptr _result = Echo::_narrow(_obj);
    CORBA::release(_obj);
    return _result;
  }

  static CORBA::Boolean _0RL_is_a(const char *base_repoId);

protected:

  Echo() {
    if (!is_proxy())
      omniObject::PR_IRRepositoryId(Echo_IntfRepoID);
    this->PR_setobj(this);
  }
  virtual ~Echo();
  virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type_id=0);

private:

  Echo(const Echo&);
  Echo &operator=(const Echo&);
};

class _sk_Echo :  public virtual Echo {
public:

  _sk_Echo() {}
  _sk_Echo(const omniORB::objectKey& k);
  virtual ~_sk_Echo();
  Echo_ptr _this() { return Echo::_duplicate(this); }
  void _obj_is_ready(CORBA::BOA_ptr boa) { boa->obj_is_ready(this); }
  CORBA::BOA_ptr _boa() { return CORBA::BOA::getBOA(); }
  void _dispose() { _boa()->dispose(this); }
  omniORB::objectKey _key();
  virtual char*  echoString(const char*  mesg) = 0;
  virtual CORBA::Boolean dispatch(GIOP_S &s,const char *op,CORBA::Boolean response);

protected:
  virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type_id) {
    return Echo::_widenFromTheMostDerivedIntf(repoId,is_cxx_type_id);
  }
private:
  _sk_Echo (const _sk_Echo&);
  _sk_Echo &operator=(const _sk_Echo&);
};

class _proxy_Echo :  public virtual Echo {
public:

  _proxy_Echo (Rope *r,CORBA::Octet *key,size_t keysize,IOP::TaggedProfileList *profiles,CORBA::Boolean release) :
    omniObject(Echo_IntfRepoID,r,key,keysize,profiles,release) {
      omni::objectIsReady(this);
  }
  virtual ~_proxy_Echo();
  virtual char*  echoString(const char*  mesg);

protected:

  _proxy_Echo () {}

  virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type) {
    return Echo::_widenFromTheMostDerivedIntf(repoId,is_cxx_type);
  }
private:

  _proxy_Echo (const _proxy_Echo&);
  _proxy_Echo &operator=(const _proxy_Echo&);
};

class _nil_Echo : public virtual Echo {
public:
  _nil_Echo() : omniObject(omniObject::nilObjectManager()) { this->PR_setobj(0); }
  virtual ~_nil_Echo();
  char*  echoString(const char*  mesg){
    throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
#ifdef NEED_DUMMY_RETURN
    // never reach here! Dummy return to keep some compilers happy.
    char* _0RL_result = 0;
    return _0RL_result;
#endif
  }

protected:
  virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type_id) {
    return Echo::_widenFromTheMostDerivedIntf(repoId,is_cxx_type_id);
  }
};

class Echo_proxyObjectFactory : public CORBA::proxyObjectFactory {
public:
  Echo_proxyObjectFactory () {}
  virtual ~Echo_proxyObjectFactory ();
  virtual const char *irRepoId() const;
  virtual CORBA::Object_ptr newProxyObject(Rope *r,CORBA::Octet *key,size_t keysize,IOP::TaggedProfileList *profiles,CORBA::Boolean release);
  virtual CORBA::Boolean is_a(const char *base_repoId) const;
  static Echo_ptr _nil() {
    if (!__nil_Echo) {
      __nil_Echo = new _nil_Echo;
    }
    return __nil_Echo;
  }
private:
  static Echo_ptr __nil_Echo;
};

_CORBA_GLOBAL_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_Echo;

template <class T,CORBA::Boolean release>
class _tie_Echo : public virtual _sk_Echo
{
public:
  _tie_Echo (T* o) : pd_obj(o), pd_release(release) {}
  _tie_Echo (T* o, const omniORB::objectKey& k) : _sk_Echo(k), pd_obj(o), pd_release(release) {}
  ~_tie_Echo() { if (pd_release) delete pd_obj; }
  char*  echoString(const char*  mesg) {  return pd_obj->echoString(mesg); }
private:
  T* pd_obj;
  CORBA::Boolean pd_release;
  _tie_Echo();
};


#undef _core_attr
#undef _dyn_attr


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

#endif // __echo_hh__
