#ifndef __account_hh__
#define __account_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 __Account__
#define __Account__
class   Account;
typedef Account* Account_ptr;
typedef Account_ptr AccountRef;

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

#endif
#define Account_IntfRepoID "IDL:Account:1.0"

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

  virtual void deposit(CORBA::ULong  amount) = 0;
  virtual void withdraw(CORBA::ULong  amount) = 0;
  virtual CORBA::Long  balance() = 0;
  static Account_ptr _duplicate(Account_ptr);
  static Account_ptr _narrow(CORBA::Object_ptr);
  static Account_ptr _nil();

  static inline size_t NP_alignedSize(Account_ptr obj,size_t initialoffset) {
    return CORBA::AlignedObjRef(obj,Account_IntfRepoID,16,initialoffset);
  }

  static inline void marshalObjRef(Account_ptr obj,NetBufferedStream &s) {
    CORBA::MarshalObjRef(obj,Account_IntfRepoID,16,s);
  }

  static inline Account_ptr unmarshalObjRef(NetBufferedStream &s) {
    CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(Account_IntfRepoID,s);
    Account_ptr _result = Account::_narrow(_obj);
    CORBA::release(_obj);
    return _result;
  }

  static inline void marshalObjRef(Account_ptr obj,MemBufferedStream &s) {
    CORBA::MarshalObjRef(obj,Account_IntfRepoID,16,s);
  }

  static inline Account_ptr unmarshalObjRef(MemBufferedStream &s) {
    CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(Account_IntfRepoID,s);
    Account_ptr _result = Account::_narrow(_obj);
    CORBA::release(_obj);
    return _result;
  }

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

protected:

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

private:

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

class _sk_Account :  public virtual Account {
public:

  _sk_Account() {}
  _sk_Account(const omniORB::objectKey& k);
  virtual ~_sk_Account() {}
  Account_ptr _this() { return Account::_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 deposit(CORBA::ULong  amount) = 0;
  virtual void withdraw(CORBA::ULong  amount) = 0;
  virtual CORBA::Long  balance() = 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 Account::_widenFromTheMostDerivedIntf(repoId,is_cxx_type_id);
  }
private:
  _sk_Account (const _sk_Account&);
  _sk_Account &operator=(const _sk_Account&);
};

class _proxy_Account :  public virtual Account {
public:

  _proxy_Account (Rope *r,CORBA::Octet *key,size_t keysize,IOP::TaggedProfileList *profiles,CORBA::Boolean release) :
    omniObject(Account_IntfRepoID,r,key,keysize,profiles,release) {
      omni::objectIsReady(this);
  }
  virtual ~_proxy_Account() {}
  virtual void deposit(CORBA::ULong  amount);
  virtual void withdraw(CORBA::ULong  amount);
  virtual CORBA::Long  balance();

protected:

  _proxy_Account () {}

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

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

class _nil_Account : public virtual Account {
public:
  _nil_Account() : omniObject(omniObject::nilObjectManager()) { this->PR_setobj(0); }
  virtual ~_nil_Account() {}
  void deposit(CORBA::ULong  amount){
    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 withdraw(CORBA::ULong  amount){
    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::Long  balance(){
    throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
#ifdef NEED_DUMMY_RETURN
    // never reach here! Dummy return to keep some compilers happy.
    CORBA::Long _0RL_result = 0;
    return _0RL_result;
#endif
  }

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

class Account_proxyObjectFactory : public proxyObjectFactory {
public:
  Account_proxyObjectFactory () {}
  virtual ~Account_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 Account_ptr _nil() {
    if (!__nil_Account) {
      __nil_Account = new _nil_Account;
    }
    return __nil_Account;
  }
private:
  static Account_ptr __nil_Account;
};

#ifndef __SavingsAccount__
#define __SavingsAccount__
class   SavingsAccount;
typedef SavingsAccount* SavingsAccount_ptr;
typedef SavingsAccount_ptr SavingsAccountRef;

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

#endif
#define SavingsAccount_IntfRepoID "IDL:SavingsAccount:1.0"

class SavingsAccount :  public virtual Account {
public:

  virtual void creditInterest() = 0;
  static SavingsAccount_ptr _duplicate(SavingsAccount_ptr);
  static SavingsAccount_ptr _narrow(CORBA::Object_ptr);
  static SavingsAccount_ptr _nil();

  static inline size_t NP_alignedSize(SavingsAccount_ptr obj,size_t initialoffset) {
    return CORBA::AlignedObjRef(obj,SavingsAccount_IntfRepoID,23,initialoffset);
  }

  static inline void marshalObjRef(SavingsAccount_ptr obj,NetBufferedStream &s) {
    CORBA::MarshalObjRef(obj,SavingsAccount_IntfRepoID,23,s);
  }

  static inline SavingsAccount_ptr unmarshalObjRef(NetBufferedStream &s) {
    CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(SavingsAccount_IntfRepoID,s);
    SavingsAccount_ptr _result = SavingsAccount::_narrow(_obj);
    CORBA::release(_obj);
    return _result;
  }

  static inline void marshalObjRef(SavingsAccount_ptr obj,MemBufferedStream &s) {
    CORBA::MarshalObjRef(obj,SavingsAccount_IntfRepoID,23,s);
  }

  static inline SavingsAccount_ptr unmarshalObjRef(MemBufferedStream &s) {
    CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(SavingsAccount_IntfRepoID,s);
    SavingsAccount_ptr _result = SavingsAccount::_narrow(_obj);
    CORBA::release(_obj);
    return _result;
  }

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

protected:

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

private:

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

class _sk_SavingsAccount :  public virtual _sk_Account, public virtual SavingsAccount {
public:

  _sk_SavingsAccount() {}
  _sk_SavingsAccount(const omniORB::objectKey& k);
  virtual ~_sk_SavingsAccount() {}
  SavingsAccount_ptr _this() { return SavingsAccount::_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 creditInterest() = 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 SavingsAccount::_widenFromTheMostDerivedIntf(repoId,is_cxx_type_id);
  }
private:
  _sk_SavingsAccount (const _sk_SavingsAccount&);
  _sk_SavingsAccount &operator=(const _sk_SavingsAccount&);
};

class _proxy_SavingsAccount :  public virtual _proxy_Account, public virtual SavingsAccount {
public:

  _proxy_SavingsAccount (Rope *r,CORBA::Octet *key,size_t keysize,IOP::TaggedProfileList *profiles,CORBA::Boolean release) :
    omniObject(SavingsAccount_IntfRepoID,r,key,keysize,profiles,release) {
      omni::objectIsReady(this);
  }
  virtual ~_proxy_SavingsAccount() {}
  virtual void creditInterest();

protected:

  _proxy_SavingsAccount () {}

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

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

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

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

class SavingsAccount_proxyObjectFactory : public proxyObjectFactory {
public:
  SavingsAccount_proxyObjectFactory () {}
  virtual ~SavingsAccount_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 SavingsAccount_ptr _nil() {
    if (!__nil_SavingsAccount) {
      __nil_SavingsAccount = new _nil_SavingsAccount;
    }
    return __nil_SavingsAccount;
  }
private:
  static SavingsAccount_ptr __nil_SavingsAccount;
};


#undef _LC_attr

#endif // __account_hh__
