#ifndef __front_hh__
#define __front_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

typedef CORBA::Float Price;
struct Place {
  CORBA::Char row;
  CORBA::ULong seat;
  
  size_t NP_alignedSize(size_t initialoffset) const;
  void operator>>= (NetBufferedStream &) const;
  void operator<<= (NetBufferedStream &);
  void operator>>= (MemBufferedStream &) const;
  void operator<<= (MemBufferedStream &);
};

typedef _CORBA_ConstrType_Fix_Var<Place> Place_var;

#ifndef __FrontOffice__
#define __FrontOffice__
class   FrontOffice;
typedef FrontOffice* FrontOffice_ptr;
typedef FrontOffice_ptr FrontOfficeRef;

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

#endif
#define FrontOffice_IntfRepoID "IDL:FrontOffice:1.0"

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

  virtual char* name() = 0;
  virtual CORBA::ULong numberOfSeats() = 0;
  virtual Price  getPrice(const Place & chosenPlace) = 0;
  virtual CORBA::Boolean  bookSingleSeat(const Place & chosenPlace, const char*  creditCard) = 0;
  static FrontOffice_ptr _duplicate(FrontOffice_ptr);
  static FrontOffice_ptr _narrow(CORBA::Object_ptr);
  static FrontOffice_ptr _nil();

  static inline size_t NP_alignedSize(FrontOffice_ptr obj,size_t initialoffset) {
    return CORBA::AlignedObjRef(obj,FrontOffice_IntfRepoID,20,initialoffset);
  }

  static inline void marshalObjRef(FrontOffice_ptr obj,NetBufferedStream &s) {
    CORBA::MarshalObjRef(obj,FrontOffice_IntfRepoID,20,s);
  }

  static inline FrontOffice_ptr unmarshalObjRef(NetBufferedStream &s) {
    CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(FrontOffice_IntfRepoID,s);
    FrontOffice_ptr _result = FrontOffice::_narrow(_obj);
    CORBA::release(_obj);
    return _result;
  }

  static inline void marshalObjRef(FrontOffice_ptr obj,MemBufferedStream &s) {
    CORBA::MarshalObjRef(obj,FrontOffice_IntfRepoID,20,s);
  }

  static inline FrontOffice_ptr unmarshalObjRef(MemBufferedStream &s) {
    CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(FrontOffice_IntfRepoID,s);
    FrontOffice_ptr _result = FrontOffice::_narrow(_obj);
    CORBA::release(_obj);
    return _result;
  }

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

protected:

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

private:

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

class _sk_FrontOffice :  public virtual FrontOffice {
public:

  _sk_FrontOffice() {}
  _sk_FrontOffice(const omniORB::objectKey& k);
  virtual ~_sk_FrontOffice() {}
  FrontOffice_ptr _this() { return FrontOffice::_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* name() = 0;
  virtual CORBA::ULong numberOfSeats() = 0;
  virtual Price  getPrice(const Place & chosenPlace) = 0;
  virtual CORBA::Boolean  bookSingleSeat(const Place & chosenPlace, const char*  creditCard) = 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 FrontOffice::_widenFromTheMostDerivedIntf(repoId,is_cxx_type_id);
  }
private:
  _sk_FrontOffice (const _sk_FrontOffice&);
  _sk_FrontOffice &operator=(const _sk_FrontOffice&);
};

class _proxy_FrontOffice :  public virtual FrontOffice {
public:

  _proxy_FrontOffice (Rope *r,CORBA::Octet *key,size_t keysize,IOP::TaggedProfileList *profiles,CORBA::Boolean release) :
    omniObject(FrontOffice_IntfRepoID,r,key,keysize,profiles,release) {
      omni::objectIsReady(this);
  }
  virtual ~_proxy_FrontOffice() {}
  virtual char* name();
  virtual CORBA::ULong numberOfSeats();
  virtual Price  getPrice(const Place & chosenPlace);
  virtual CORBA::Boolean  bookSingleSeat(const Place & chosenPlace, const char*  creditCard);

protected:

  _proxy_FrontOffice () {}

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

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

class _nil_FrontOffice : public virtual FrontOffice {
public:
  _nil_FrontOffice() : omniObject(omniObject::nilObjectManager()) { this->PR_setobj(0); }
  virtual ~_nil_FrontOffice() {}
  char* name() {
    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
  }

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

  Price  getPrice(const Place & chosenPlace){
    throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
#ifdef NEED_DUMMY_RETURN
    // never reach here! Dummy return to keep some compilers happy.
    Price _0RL_result = 0;
    return _0RL_result;
#endif
  }

  CORBA::Boolean  bookSingleSeat(const Place & chosenPlace, const char*  creditCard){
    throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
#ifdef NEED_DUMMY_RETURN
    // never reach here! Dummy return to keep some compilers happy.
    CORBA::Boolean _0RL_result = 0;
    return _0RL_result;
#endif
  }

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

class FrontOffice_proxyObjectFactory : public proxyObjectFactory {
public:
  FrontOffice_proxyObjectFactory () {}
  virtual ~FrontOffice_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 FrontOffice_ptr _nil() {
    if (!__nil_FrontOffice) {
      __nil_FrontOffice = new _nil_FrontOffice;
    }
    return __nil_FrontOffice;
  }
private:
  static FrontOffice_ptr __nil_FrontOffice;
};


#undef _LC_attr

#endif // __front_hh__
