#include "example.hh"
#include <omniORB4/IOP_S.h>
#include <omniORB4/IOP_C.h>
#include <omniORB4/callDescriptor.h>
#include <omniORB4/callHandle.h>
#include <omniORB4/objTracker.h>

OMNI_USING_NAMESPACE(omni)

static const char* _0RL_library_version = omniORB_4_2;

ExampleInterface_ptr ExampleInterface_Helper::_nil() {
  return ::ExampleInterface::_nil();
}

::CORBA::Boolean ExampleInterface_Helper::is_nil(::ExampleInterface_ptr p) {
  return ::CORBA::is_nil(p);

}

void ExampleInterface_Helper::release(::ExampleInterface_ptr p) {
  ::CORBA::release(p);
}

void ExampleInterface_Helper::marshalObjRef(::ExampleInterface_ptr obj, cdrStream& s) {
  ::ExampleInterface::_marshalObjRef(obj, s);
}

ExampleInterface_ptr ExampleInterface_Helper::unmarshalObjRef(cdrStream& s) {
  return ::ExampleInterface::_unmarshalObjRef(s);
}

void ExampleInterface_Helper::duplicate(::ExampleInterface_ptr obj) {
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
}

ExampleInterface_ptr
ExampleInterface::_duplicate(::ExampleInterface_ptr obj)
{
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
  return obj;
}

ExampleInterface_ptr
ExampleInterface::_narrow(::CORBA::Object_ptr obj)
{
  if (!obj || obj->_NP_is_nil() || obj->_NP_is_pseudo()) return _nil();
  _ptr_type e = (_ptr_type) obj->_PR_getobj()->_realNarrow(_PD_repoId);
  return e ? e : _nil();
}

ExampleInterface_ptr
ExampleInterface::_unchecked_narrow(::CORBA::Object_ptr obj)
{
  if (!obj || obj->_NP_is_nil() || obj->_NP_is_pseudo()) return _nil();
  _ptr_type e = (_ptr_type) obj->_PR_getobj()->_uncheckedNarrow(_PD_repoId);
  return e ? e : _nil();
}

ExampleInterface_ptr
ExampleInterface::_nil()
{
#ifdef OMNI_UNLOADABLE_STUBS
  static _objref_ExampleInterface _the_nil_obj;
  return &_the_nil_obj;
#else
  static _objref_ExampleInterface* _the_nil_ptr = 0;
  if (!_the_nil_ptr) {
    omni::nilRefLock().lock();
    if (!_the_nil_ptr) {
      _the_nil_ptr = new _objref_ExampleInterface;
      registerNilCorbaObject(_the_nil_ptr);
    }
    omni::nilRefLock().unlock();
  }
  return _the_nil_ptr;
#endif
}

const char* ExampleInterface::_PD_repoId = "IDL:ExampleInterface:1.0";

_objref_ExampleInterface::~_objref_ExampleInterface() {

}

_objref_ExampleInterface::_objref_ExampleInterface(omniIOR* ior, omniIdentity* id) :
   omniObjRef(::ExampleInterface::_PD_repoId, ior, id, 1)

{
  _PR_setobj(this);
}

void*
_objref_ExampleInterface::_ptrToObjRef(const char* id)
{
  if (id == ::ExampleInterface::_PD_repoId)
    return (::ExampleInterface_ptr) this;

  if (id == ::CORBA::Object::_PD_repoId)
    return (::CORBA::Object_ptr) this;

  if (omni::strMatch(id, ::ExampleInterface::_PD_repoId))
    return (::ExampleInterface_ptr) this;

  if (omni::strMatch(id, ::CORBA::Object::_PD_repoId))
    return (::CORBA::Object_ptr) this;

  return 0;
}

class _0RL_cd_3c91a63531055fbe_00000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_3c91a63531055fbe_00000000(LocalCallFn lcfn, const char* op_, size_t oplen, _CORBA_Boolean upcall=0)
    : omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 0, upcall)
  {

  }

  void marshalArguments(cdrStream&);
  void unmarshalArguments(cdrStream&);

  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);

  static const char* const _user_exns[];

  ::CORBA::String_var arg_0_;
  const char* arg_0;
  ::CORBA::String_var result;
};

void _0RL_cd_3c91a63531055fbe_00000000::marshalArguments(cdrStream& _n)
{
  _n.marshalString(arg_0,0);

}

void _0RL_cd_3c91a63531055fbe_00000000::unmarshalArguments(cdrStream& _n)
{
  arg_0_ = _n.unmarshalString(0);
  arg_0 = arg_0_.in();

}

void _0RL_cd_3c91a63531055fbe_00000000::marshalReturnedValues(cdrStream& _n)
{
  _n.marshalString(result,0);

}

void _0RL_cd_3c91a63531055fbe_00000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = _n.unmarshalString(0);

}

const char* const _0RL_cd_3c91a63531055fbe_00000000::_user_exns[] = {
  0
};

static void
_0RL_lcfn_3c91a63531055fbe_10000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_00000000* tcd = (_0RL_cd_3c91a63531055fbe_00000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->send_message(tcd->arg_0);

}

char* _objref_ExampleInterface::send_message(const char* message)
{
  _0RL_cd_3c91a63531055fbe_00000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_10000000, "send_message", 13);
  _call_desc.arg_0 = message;

  _invoke(_call_desc);
  return _call_desc.result._retn();

}

class _0RL_cd_3c91a63531055fbe_20000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_3c91a63531055fbe_20000000(LocalCallFn lcfn, const char* op_, size_t oplen, _CORBA_Boolean upcall=0)
    : omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 0, upcall)
  {

  }

  void marshalArguments(cdrStream&);
  void unmarshalArguments(cdrStream&);

  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);

  static const char* const _user_exns[];

  ::CORBA::String_var arg_0_;
  const char* arg_0;
  ::CORBA::String_var arg_1_;
  const char* arg_1;
  ::CORBA::String_var result;
};

void _0RL_cd_3c91a63531055fbe_20000000::marshalArguments(cdrStream& _n)
{
  _n.marshalString(arg_0,0);
  _n.marshalString(arg_1,0);

}

void _0RL_cd_3c91a63531055fbe_20000000::unmarshalArguments(cdrStream& _n)
{
  arg_0_ = _n.unmarshalString(0);
  arg_0 = arg_0_.in();
  arg_1_ = _n.unmarshalString(0);
  arg_1 = arg_1_.in();

}

void _0RL_cd_3c91a63531055fbe_20000000::marshalReturnedValues(cdrStream& _n)
{
  _n.marshalString(result,0);

}

void _0RL_cd_3c91a63531055fbe_20000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = _n.unmarshalString(0);

}

const char* const _0RL_cd_3c91a63531055fbe_20000000::_user_exns[] = {
  0
};

static void
_0RL_lcfn_3c91a63531055fbe_30000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_20000000* tcd = (_0RL_cd_3c91a63531055fbe_20000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->newQuestion(tcd->arg_0, tcd->arg_1);

}

char* _objref_ExampleInterface::newQuestion(const char* question, const char* answer)
{
  _0RL_cd_3c91a63531055fbe_20000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_30000000, "newQuestion", 12);
  _call_desc.arg_0 = question;
  _call_desc.arg_1 = answer;

  _invoke(_call_desc);
  return _call_desc.result._retn();

}

class _0RL_cd_3c91a63531055fbe_40000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_3c91a63531055fbe_40000000(LocalCallFn lcfn, const char* op_, size_t oplen, _CORBA_Boolean upcall=0)
    : omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 0, upcall)
  {

  }

  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);

  static const char* const _user_exns[];

  ::CORBA::String_var result;
};

void _0RL_cd_3c91a63531055fbe_40000000::marshalReturnedValues(cdrStream& _n)
{
  _n.marshalString(result,0);

}

void _0RL_cd_3c91a63531055fbe_40000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = _n.unmarshalString(0);

}

const char* const _0RL_cd_3c91a63531055fbe_40000000::_user_exns[] = {
  0
};

static void
_0RL_lcfn_3c91a63531055fbe_50000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_40000000* tcd = (_0RL_cd_3c91a63531055fbe_40000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->getRandomQuestion();

}

char* _objref_ExampleInterface::getRandomQuestion()
{
  _0RL_cd_3c91a63531055fbe_40000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_50000000, "getRandomQuestion", 18);

  _invoke(_call_desc);
  return _call_desc.result._retn();

}

static void
_0RL_lcfn_3c91a63531055fbe_60000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_20000000* tcd = (_0RL_cd_3c91a63531055fbe_20000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->answerQuestion(tcd->arg_0, tcd->arg_1);

}

char* _objref_ExampleInterface::answerQuestion(const char* question, const char* answer)
{
  _0RL_cd_3c91a63531055fbe_20000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_60000000, "answerQuestion", 15);
  _call_desc.arg_0 = question;
  _call_desc.arg_1 = answer;

  _invoke(_call_desc);
  return _call_desc.result._retn();

}

class _0RL_cd_3c91a63531055fbe_70000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_3c91a63531055fbe_70000000(LocalCallFn lcfn, const char* op_, size_t oplen, _CORBA_Boolean upcall=0)
    : omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 0, upcall)
  {

  }

  void marshalArguments(cdrStream&);
  void unmarshalArguments(cdrStream&);

  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);

  static const char* const _user_exns[];

  ::CORBA::Short arg_0;
  ::CORBA::String_var result;
};

void _0RL_cd_3c91a63531055fbe_70000000::marshalArguments(cdrStream& _n)
{
  arg_0 >>= _n;

}

void _0RL_cd_3c91a63531055fbe_70000000::unmarshalArguments(cdrStream& _n)
{
  (::CORBA::Short&)arg_0 <<= _n;

}

void _0RL_cd_3c91a63531055fbe_70000000::marshalReturnedValues(cdrStream& _n)
{
  _n.marshalString(result,0);

}

void _0RL_cd_3c91a63531055fbe_70000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = _n.unmarshalString(0);

}

const char* const _0RL_cd_3c91a63531055fbe_70000000::_user_exns[] = {
  0
};

static void
_0RL_lcfn_3c91a63531055fbe_80000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_70000000* tcd = (_0RL_cd_3c91a63531055fbe_70000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->removeQuestion(tcd->arg_0);

}

char* _objref_ExampleInterface::removeQuestion(::CORBA::Short index)
{
  _0RL_cd_3c91a63531055fbe_70000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_80000000, "removeQuestion", 15);
  _call_desc.arg_0 = index;

  _invoke(_call_desc);
  return _call_desc.result._retn();

}

static void
_0RL_lcfn_3c91a63531055fbe_90000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_40000000* tcd = (_0RL_cd_3c91a63531055fbe_40000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->displayAllQuestions();

}

char* _objref_ExampleInterface::displayAllQuestions()
{
  _0RL_cd_3c91a63531055fbe_40000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_90000000, "displayAllQuestions", 20);

  _invoke(_call_desc);
  return _call_desc.result._retn();

}

_pof_ExampleInterface::~_pof_ExampleInterface() {}

omniObjRef*
_pof_ExampleInterface::newObjRef(omniIOR* ior, omniIdentity* id)
{
  return new ::_objref_ExampleInterface(ior, id);
}

::CORBA::Boolean
_pof_ExampleInterface::is_a(const char* id) const
{
  if (omni::ptrStrMatch(id, ::ExampleInterface::_PD_repoId))
    return 1;

  return 0;
}

const _pof_ExampleInterface _the_pof_ExampleInterface;

_impl_ExampleInterface::~_impl_ExampleInterface() {}

::CORBA::Boolean
_impl_ExampleInterface::_dispatch(omniCallHandle& _handle)
{
  const char* op = _handle.operation_name();

  if (omni::strMatch(op, "send_message")) {

    _0RL_cd_3c91a63531055fbe_00000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_10000000, "send_message", 13, 1);

    _handle.upcall(this,_call_desc);
    return 1;
  }

  if (omni::strMatch(op, "newQuestion")) {

    _0RL_cd_3c91a63531055fbe_20000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_30000000, "newQuestion", 12, 1);

    _handle.upcall(this,_call_desc);
    return 1;
  }

  if (omni::strMatch(op, "getRandomQuestion")) {

    _0RL_cd_3c91a63531055fbe_40000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_50000000, "getRandomQuestion", 18, 1);

    _handle.upcall(this,_call_desc);
    return 1;
  }

  if (omni::strMatch(op, "answerQuestion")) {

    _0RL_cd_3c91a63531055fbe_20000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_60000000, "answerQuestion", 15, 1);

    _handle.upcall(this,_call_desc);
    return 1;
  }

  if (omni::strMatch(op, "removeQuestion")) {

    _0RL_cd_3c91a63531055fbe_70000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_80000000, "removeQuestion", 15, 1);

    _handle.upcall(this,_call_desc);
    return 1;
  }

  if (omni::strMatch(op, "displayAllQuestions")) {

    _0RL_cd_3c91a63531055fbe_40000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_90000000, "displayAllQuestions", 20, 1);

    _handle.upcall(this,_call_desc);
    return 1;
  }

  return 0;
}

void*
_impl_ExampleInterface::_ptrToInterface(const char* id)
{
  if (id == ::ExampleInterface::_PD_repoId)
    return (::_impl_ExampleInterface*) this;

  if (id == ::CORBA::Object::_PD_repoId)
    return (void*) 1;

  if (omni::strMatch(id, ::ExampleInterface::_PD_repoId))
    return (::_impl_ExampleInterface*) this;

  if (omni::strMatch(id, ::CORBA::Object::_PD_repoId))
    return (void*) 1;
  return 0;
}

const char*
_impl_ExampleInterface::_mostDerivedRepoId()
{
  return ::ExampleInterface::_PD_repoId;
}

POA_ExampleInterface::~POA_ExampleInterface() {}
// This file is generated by omniidl (C++ backend)- omniORB_4_2. Do not edit.

#include "example.hh"
#include <omniORB4/IOP_S.h>
#include <omniORB4/IOP_C.h>
#include <omniORB4/callDescriptor.h>
#include <omniORB4/callHandle.h>
#include <omniORB4/objTracker.h>


OMNI_USING_NAMESPACE(omni)

static const char* _0RL_library_version = omniORB_4_2;



ExampleInterface_ptr ExampleInterface_Helper::_nil() {
  return ::ExampleInterface::_nil();
}

::CORBA::Boolean ExampleInterface_Helper::is_nil(::ExampleInterface_ptr p) {
  return ::CORBA::is_nil(p);

}

void ExampleInterface_Helper::release(::ExampleInterface_ptr p) {
  ::CORBA::release(p);
}

void ExampleInterface_Helper::marshalObjRef(::ExampleInterface_ptr obj, cdrStream& s) {
  ::ExampleInterface::_marshalObjRef(obj, s);
}

ExampleInterface_ptr ExampleInterface_Helper::unmarshalObjRef(cdrStream& s) {
  return ::ExampleInterface::_unmarshalObjRef(s);
}

void ExampleInterface_Helper::duplicate(::ExampleInterface_ptr obj) {
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
}

ExampleInterface_ptr
ExampleInterface::_duplicate(::ExampleInterface_ptr obj)
{
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
  return obj;
}

ExampleInterface_ptr
ExampleInterface::_narrow(::CORBA::Object_ptr obj)
{
  if (!obj || obj->_NP_is_nil() || obj->_NP_is_pseudo()) return _nil();
  _ptr_type e = (_ptr_type) obj->_PR_getobj()->_realNarrow(_PD_repoId);
  return e ? e : _nil();
}


ExampleInterface_ptr
ExampleInterface::_unchecked_narrow(::CORBA::Object_ptr obj)
{
  if (!obj || obj->_NP_is_nil() || obj->_NP_is_pseudo()) return _nil();
  _ptr_type e = (_ptr_type) obj->_PR_getobj()->_uncheckedNarrow(_PD_repoId);
  return e ? e : _nil();
}

ExampleInterface_ptr
ExampleInterface::_nil()
{
#ifdef OMNI_UNLOADABLE_STUBS
  static _objref_ExampleInterface _the_nil_obj;
  return &_the_nil_obj;
#else
  static _objref_ExampleInterface* _the_nil_ptr = 0;
  if (!_the_nil_ptr) {
    omni::nilRefLock().lock();
    if (!_the_nil_ptr) {
      _the_nil_ptr = new _objref_ExampleInterface;
      registerNilCorbaObject(_the_nil_ptr);
    }
    omni::nilRefLock().unlock();
  }
  return _the_nil_ptr;
#endif
}

const char* ExampleInterface::_PD_repoId = "IDL:ExampleInterface:1.0";


_objref_ExampleInterface::~_objref_ExampleInterface() {
  
}


_objref_ExampleInterface::_objref_ExampleInterface(omniIOR* ior, omniIdentity* id) :
   omniObjRef(::ExampleInterface::_PD_repoId, ior, id, 1)
   
   
{
  _PR_setobj(this);
}

void*
_objref_ExampleInterface::_ptrToObjRef(const char* id)
{
  if (id == ::ExampleInterface::_PD_repoId)
    return (::ExampleInterface_ptr) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (::CORBA::Object_ptr) this;

  if (omni::strMatch(id, ::ExampleInterface::_PD_repoId))
    return (::ExampleInterface_ptr) this;
  
  if (omni::strMatch(id, ::CORBA::Object::_PD_repoId))
    return (::CORBA::Object_ptr) this;

  return 0;
}


//
// Code for ExampleInterface::send_message

// Proxy call descriptor class. Mangled signature:
//  _cstring_i_cstring
class _0RL_cd_3c91a63531055fbe_00000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_3c91a63531055fbe_00000000(LocalCallFn lcfn, const char* op_, size_t oplen, _CORBA_Boolean upcall=0)
    : omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 0, upcall)
  {
    
  }
  
  void marshalArguments(cdrStream&);
  void unmarshalArguments(cdrStream&);

  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);
  
  
  static const char* const _user_exns[];

  ::CORBA::String_var arg_0_;
  const char* arg_0;
  ::CORBA::String_var result;
};

void _0RL_cd_3c91a63531055fbe_00000000::marshalArguments(cdrStream& _n)
{
  _n.marshalString(arg_0,0);

}

void _0RL_cd_3c91a63531055fbe_00000000::unmarshalArguments(cdrStream& _n)
{
  arg_0_ = _n.unmarshalString(0);
  arg_0 = arg_0_.in();

}

void _0RL_cd_3c91a63531055fbe_00000000::marshalReturnedValues(cdrStream& _n)
{
  _n.marshalString(result,0);

}

void _0RL_cd_3c91a63531055fbe_00000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = _n.unmarshalString(0);

}

const char* const _0RL_cd_3c91a63531055fbe_00000000::_user_exns[] = {
  0
};

// Local call call-back function.
static void
_0RL_lcfn_3c91a63531055fbe_10000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_00000000* tcd = (_0RL_cd_3c91a63531055fbe_00000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->send_message(tcd->arg_0);


}

char* _objref_ExampleInterface::send_message(const char* message)
{
  _0RL_cd_3c91a63531055fbe_00000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_10000000, "send_message", 13);
  _call_desc.arg_0 = message;

  _invoke(_call_desc);
  return _call_desc.result._retn();


}


//
// Code for ExampleInterface::newQuestion

// Proxy call descriptor class. Mangled signature:
//  _cstring_i_cstring_i_cstring
class _0RL_cd_3c91a63531055fbe_20000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_3c91a63531055fbe_20000000(LocalCallFn lcfn, const char* op_, size_t oplen, _CORBA_Boolean upcall=0)
    : omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 0, upcall)
  {
    
  }
  
  void marshalArguments(cdrStream&);
  void unmarshalArguments(cdrStream&);

  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);
  
  
  static const char* const _user_exns[];

  ::CORBA::String_var arg_0_;
  const char* arg_0;
  ::CORBA::String_var arg_1_;
  const char* arg_1;
  ::CORBA::String_var result;
};

void _0RL_cd_3c91a63531055fbe_20000000::marshalArguments(cdrStream& _n)
{
  _n.marshalString(arg_0,0);
  _n.marshalString(arg_1,0);

}

void _0RL_cd_3c91a63531055fbe_20000000::unmarshalArguments(cdrStream& _n)
{
  arg_0_ = _n.unmarshalString(0);
  arg_0 = arg_0_.in();
  arg_1_ = _n.unmarshalString(0);
  arg_1 = arg_1_.in();

}

void _0RL_cd_3c91a63531055fbe_20000000::marshalReturnedValues(cdrStream& _n)
{
  _n.marshalString(result,0);

}

void _0RL_cd_3c91a63531055fbe_20000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = _n.unmarshalString(0);

}

const char* const _0RL_cd_3c91a63531055fbe_20000000::_user_exns[] = {
  0
};

// Local call call-back function.
static void
_0RL_lcfn_3c91a63531055fbe_30000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_20000000* tcd = (_0RL_cd_3c91a63531055fbe_20000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->newQuestion(tcd->arg_0, tcd->arg_1);


}

char* _objref_ExampleInterface::newQuestion(const char* question, const char* answer)
{
  _0RL_cd_3c91a63531055fbe_20000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_30000000, "newQuestion", 12);
  _call_desc.arg_0 = question;
  _call_desc.arg_1 = answer;

  _invoke(_call_desc);
  return _call_desc.result._retn();


}


//
// Code for ExampleInterface::getRandomQuestion

// Proxy call descriptor class. Mangled signature:
//  _cstring
class _0RL_cd_3c91a63531055fbe_40000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_3c91a63531055fbe_40000000(LocalCallFn lcfn, const char* op_, size_t oplen, _CORBA_Boolean upcall=0)
    : omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 0, upcall)
  {
    
  }
  
  
  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);
  
  
  static const char* const _user_exns[];

  ::CORBA::String_var result;
};

void _0RL_cd_3c91a63531055fbe_40000000::marshalReturnedValues(cdrStream& _n)
{
  _n.marshalString(result,0);

}

void _0RL_cd_3c91a63531055fbe_40000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = _n.unmarshalString(0);

}

const char* const _0RL_cd_3c91a63531055fbe_40000000::_user_exns[] = {
  0
};

// Local call call-back function.
static void
_0RL_lcfn_3c91a63531055fbe_50000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_40000000* tcd = (_0RL_cd_3c91a63531055fbe_40000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->getRandomQuestion();


}

char* _objref_ExampleInterface::getRandomQuestion()
{
  _0RL_cd_3c91a63531055fbe_40000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_50000000, "getRandomQuestion", 18);


  _invoke(_call_desc);
  return _call_desc.result._retn();


}


//
// Code for ExampleInterface::answerQuestion

// Local call call-back function.
static void
_0RL_lcfn_3c91a63531055fbe_60000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_20000000* tcd = (_0RL_cd_3c91a63531055fbe_20000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->answerQuestion(tcd->arg_0, tcd->arg_1);


}

char* _objref_ExampleInterface::answerQuestion(const char* question, const char* answer)
{
  _0RL_cd_3c91a63531055fbe_20000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_60000000, "answerQuestion", 15);
  _call_desc.arg_0 = question;
  _call_desc.arg_1 = answer;

  _invoke(_call_desc);
  return _call_desc.result._retn();


}


//
// Code for ExampleInterface::removeQuestion

// Proxy call descriptor class. Mangled signature:
//  _cstring_i_cshort
class _0RL_cd_3c91a63531055fbe_70000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_3c91a63531055fbe_70000000(LocalCallFn lcfn, const char* op_, size_t oplen, _CORBA_Boolean upcall=0)
    : omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 0, upcall)
  {
    
  }
  
  void marshalArguments(cdrStream&);
  void unmarshalArguments(cdrStream&);

  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);
  
  
  static const char* const _user_exns[];

  ::CORBA::Short arg_0;
  ::CORBA::String_var result;
};

void _0RL_cd_3c91a63531055fbe_70000000::marshalArguments(cdrStream& _n)
{
  arg_0 >>= _n;

}

void _0RL_cd_3c91a63531055fbe_70000000::unmarshalArguments(cdrStream& _n)
{
  (::CORBA::Short&)arg_0 <<= _n;

}

void _0RL_cd_3c91a63531055fbe_70000000::marshalReturnedValues(cdrStream& _n)
{
  _n.marshalString(result,0);

}

void _0RL_cd_3c91a63531055fbe_70000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = _n.unmarshalString(0);

}

const char* const _0RL_cd_3c91a63531055fbe_70000000::_user_exns[] = {
  0
};

// Local call call-back function.
static void
_0RL_lcfn_3c91a63531055fbe_80000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_70000000* tcd = (_0RL_cd_3c91a63531055fbe_70000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->removeQuestion(tcd->arg_0);


}

char* _objref_ExampleInterface::removeQuestion(::CORBA::Short index)
{
  _0RL_cd_3c91a63531055fbe_70000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_80000000, "removeQuestion", 15);
  _call_desc.arg_0 = index;

  _invoke(_call_desc);
  return _call_desc.result._retn();


}


//
// Code for ExampleInterface::displayAllQuestions

// Local call call-back function.
static void
_0RL_lcfn_3c91a63531055fbe_90000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_3c91a63531055fbe_40000000* tcd = (_0RL_cd_3c91a63531055fbe_40000000*)cd;
  _impl_ExampleInterface* impl = (_impl_ExampleInterface*) svnt->_ptrToInterface(ExampleInterface::_PD_repoId);
  tcd->result = impl->displayAllQuestions();


}

char* _objref_ExampleInterface::displayAllQuestions()
{
  _0RL_cd_3c91a63531055fbe_40000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_90000000, "displayAllQuestions", 20);


  _invoke(_call_desc);
  return _call_desc.result._retn();


}

_pof_ExampleInterface::~_pof_ExampleInterface() {}


omniObjRef*
_pof_ExampleInterface::newObjRef(omniIOR* ior, omniIdentity* id)
{
  return new ::_objref_ExampleInterface(ior, id);
}


::CORBA::Boolean
_pof_ExampleInterface::is_a(const char* id) const
{
  if (omni::ptrStrMatch(id, ::ExampleInterface::_PD_repoId))
    return 1;
  
  return 0;
}

const _pof_ExampleInterface _the_pof_ExampleInterface;

_impl_ExampleInterface::~_impl_ExampleInterface() {}


::CORBA::Boolean
_impl_ExampleInterface::_dispatch(omniCallHandle& _handle)
{
  const char* op = _handle.operation_name();

  if (omni::strMatch(op, "send_message")) {

    _0RL_cd_3c91a63531055fbe_00000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_10000000, "send_message", 13, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }

  if (omni::strMatch(op, "newQuestion")) {

    _0RL_cd_3c91a63531055fbe_20000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_30000000, "newQuestion", 12, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }

  if (omni::strMatch(op, "getRandomQuestion")) {

    _0RL_cd_3c91a63531055fbe_40000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_50000000, "getRandomQuestion", 18, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }

  if (omni::strMatch(op, "answerQuestion")) {

    _0RL_cd_3c91a63531055fbe_20000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_60000000, "answerQuestion", 15, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }

  if (omni::strMatch(op, "removeQuestion")) {

    _0RL_cd_3c91a63531055fbe_70000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_80000000, "removeQuestion", 15, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }

  if (omni::strMatch(op, "displayAllQuestions")) {

    _0RL_cd_3c91a63531055fbe_40000000 _call_desc(_0RL_lcfn_3c91a63531055fbe_90000000, "displayAllQuestions", 20, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }


  return 0;
}

void*
_impl_ExampleInterface::_ptrToInterface(const char* id)
{
  if (id == ::ExampleInterface::_PD_repoId)
    return (::_impl_ExampleInterface*) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (void*) 1;

  if (omni::strMatch(id, ::ExampleInterface::_PD_repoId))
    return (::_impl_ExampleInterface*) this;
  
  if (omni::strMatch(id, ::CORBA::Object::_PD_repoId))
    return (void*) 1;
  return 0;
}

const char*
_impl_ExampleInterface::_mostDerivedRepoId()
{
  return ::ExampleInterface::_PD_repoId;
}

POA_ExampleInterface::~POA_ExampleInterface() {}

