#ifndef __omniLifeCycle_hh__
#define __omniLifeCycle_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 _LC_attr
# error "A local CPP macro _LC_attr has already been defined."
#else
# ifdef  USE_stub_in_nt_dll
#  define _LC_attr _OMNIORB_NTDLL_IMPORT
# else
#  define _LC_attr
# endif
#endif

#ifndef __omniLifeCycleInfo__
#define __omniLifeCycleInfo__
class   omniLifeCycleInfo;
typedef omniLifeCycleInfo* omniLifeCycleInfo_ptr;
typedef omniLifeCycleInfo_ptr omniLifeCycleInfoRef;

class omniLifeCycleInfo_Helper {
  public:
  static omniLifeCycleInfo_ptr _nil();
  static CORBA::Boolean is_nil(omniLifeCycleInfo_ptr p);
  static void release(omniLifeCycleInfo_ptr p);
  static void duplicate(omniLifeCycleInfo_ptr p);
  static size_t NP_alignedSize(omniLifeCycleInfo_ptr obj,size_t initialoffset);
  static void marshalObjRef(omniLifeCycleInfo_ptr obj,NetBufferedStream &s);
  static omniLifeCycleInfo_ptr unmarshalObjRef(NetBufferedStream &s);
  static void marshalObjRef(omniLifeCycleInfo_ptr obj,MemBufferedStream &s);
  static omniLifeCycleInfo_ptr unmarshalObjRef(MemBufferedStream &s);
};
typedef _CORBA_ObjRef_Var<omniLifeCycleInfo,omniLifeCycleInfo_Helper> omniLifeCycleInfo_var;

#endif
#define omniLifeCycleInfo_IntfRepoID "IDL:omniLifeCycleInfo:1.0"

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

  virtual void reportMove(CORBA::Object_ptr  obj) = 0;
  virtual void reportRemove() = 0;
  virtual CORBA::Object_ptr homeObject() = 0;
  static omniLifeCycleInfo_ptr _duplicate(omniLifeCycleInfo_ptr);
  static omniLifeCycleInfo_ptr _narrow(CORBA::Object_ptr);
  static omniLifeCycleInfo_ptr _nil();

  static inline size_t NP_alignedSize(omniLifeCycleInfo_ptr obj,size_t initialoffset) {
    return CORBA::AlignedObjRef(obj,omniLifeCycleInfo_IntfRepoID,26,initialoffset);
  }

  static inline void marshalObjRef(omniLifeCycleInfo_ptr obj,NetBufferedStream &s) {
    CORBA::MarshalObjRef(obj,omniLifeCycleInfo_IntfRepoID,26,s);
  }

  static inline omniLifeCycleInfo_ptr unmarshalObjRef(NetBufferedStream &s) {
    CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(omniLifeCycleInfo_IntfRepoID,s);
    omniLifeCycleInfo_ptr _result = omniLifeCycleInfo::_narrow(_obj);
    CORBA::release(_obj);
    return _result;
  }

  static inline void marshalObjRef(omniLifeCycleInfo_ptr obj,MemBufferedStream &s) {
    CORBA::MarshalObjRef(obj,omniLifeCycleInfo_IntfRepoID,26,s);
  }

  static inline omniLifeCycleInfo_ptr unmarshalObjRef(MemBufferedStream &s) {
    CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(omniLifeCycleInfo_IntfRepoID,s);
    omniLifeCycleInfo_ptr _result = omniLifeCycleInfo::_narrow(_obj);
    CORBA::release(_obj);
    return _result;
  }

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

protected:

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

private:

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

class _sk_omniLifeCycleInfo :  public virtual omniLifeCycleInfo {
public:

  _sk_omniLifeCycleInfo() {}
  _sk_omniLifeCycleInfo(const omniORB::objectKey& k);
  virtual ~_sk_omniLifeCycleInfo() {}
  omniLifeCycleInfo_ptr _this() { return omniLifeCycleInfo::_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 void reportMove(CORBA::Object_ptr  obj) = 0;
  virtual void reportRemove() = 0;
  virtual CORBA::Object_ptr homeObject() = 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 omniLifeCycleInfo::_widenFromTheMostDerivedIntf(repoId,is_cxx_type_id);
  }
private:
  _sk_omniLifeCycleInfo (const _sk_omniLifeCycleInfo&);
  _sk_omniLifeCycleInfo &operator=(const _sk_omniLifeCycleInfo&);
};

class _proxy_omniLifeCycleInfo :  public virtual omniLifeCycleInfo {
public:

  _proxy_omniLifeCycleInfo (Rope *r,CORBA::Octet *key,size_t keysize,IOP::TaggedProfileList *profiles,CORBA::Boolean release) :
    omniObject(omniLifeCycleInfo_IntfRepoID,r,key,keysize,profiles,release) {
      omni::objectIsReady(this);
  }
  virtual ~_proxy_omniLifeCycleInfo() {}
  virtual void reportMove(CORBA::Object_ptr  obj);
  virtual void reportRemove();
  virtual CORBA::Object_ptr homeObject();

protected:

  _proxy_omniLifeCycleInfo () {}

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

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

class _nil_omniLifeCycleInfo : public virtual omniLifeCycleInfo {
public:
  _nil_omniLifeCycleInfo() : omniObject(omniObject::nilObjectManager()) { this->PR_setobj(0); }
  virtual ~_nil_omniLifeCycleInfo() {}
  void reportMove(CORBA::Object_ptr  obj){
    throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
#ifdef NEED_DUMMY_RETURN
    // never reach here! Dummy return to keep some compilers happy.
    return;
#endif
  }

  void reportRemove(){
    throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
#ifdef NEED_DUMMY_RETURN
    // never reach here! Dummy return to keep some compilers happy.
    return;
#endif
  }

  CORBA::Object_ptr homeObject() {
    throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
#ifdef NEED_DUMMY_RETURN
    // never reach here! Dummy return to keep some compilers happy.
    CORBA::Object_ptr _0RL_result = 0;
    return _0RL_result;
#endif
  }

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

class omniLifeCycleInfo_proxyObjectFactory : public proxyObjectFactory {
public:
  omniLifeCycleInfo_proxyObjectFactory () {}
  virtual ~omniLifeCycleInfo_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 omniLifeCycleInfo_ptr _nil() {
    if (!__nil_omniLifeCycleInfo) {
      __nil_omniLifeCycleInfo = new _nil_omniLifeCycleInfo;
    }
    return __nil_omniLifeCycleInfo;
  }
private:
  static omniLifeCycleInfo_ptr __nil_omniLifeCycleInfo;
};

_CORBA_GLOBAL_VAR const CORBA::TypeCode_ptr _tc_omniLifeCycleInfo;


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


#undef _LC_attr

#endif // __omniLifeCycle_hh__
