// This file is generated by omniidl (C++ backend)- omniORB_4_1. Do not edit.

#include "RefHardRh2Pro.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_1;



RefHard_ptr RefHard_Helper::_nil() {
  return ::RefHard::_nil();
}

::CORBA::Boolean RefHard_Helper::is_nil(::RefHard_ptr p) {
  return ::CORBA::is_nil(p);

}

void RefHard_Helper::release(::RefHard_ptr p) {
  ::CORBA::release(p);
}

void RefHard_Helper::marshalObjRef(::RefHard_ptr obj, cdrStream& s) {
  ::RefHard::_marshalObjRef(obj, s);
}

RefHard_ptr RefHard_Helper::unmarshalObjRef(cdrStream& s) {
  return ::RefHard::_unmarshalObjRef(s);
}

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

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

RefHard_ptr
RefHard::_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();
}


RefHard_ptr
RefHard::_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();
}

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

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


_objref_RefHard::~_objref_RefHard() {
  
}


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

void*
_objref_RefHard::_ptrToObjRef(const char* id)
{
  if( id == ::RefHard::_PD_repoId )
    return (::RefHard_ptr) this;
  
  if( id == ::CORBA::Object::_PD_repoId )
    return (::CORBA::Object_ptr) this;

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

  return 0;
}

// Proxy call descriptor class. Mangled signature:
//  void
class _0RL_cd_ef295e1645e815fd_00000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_ef295e1645e815fd_00000000(LocalCallFn lcfn,const char* op_,size_t oplen,_CORBA_Boolean upcall=0):
     omniCallDescriptor(lcfn, op_, oplen, 0, 0, 0, upcall)
  {
    
  }
  
  
    
  
  
};

// Local call call-back function.
static void
_0RL_lcfn_ef295e1645e815fd_10000000(omniCallDescriptor*, omniServant* svnt)
{
  
  _impl_RefHard* impl = (_impl_RefHard*) svnt->_ptrToInterface(RefHard::_PD_repoId);
  impl->Stop();


}

void _objref_RefHard::Stop()
{
  _0RL_cd_ef295e1645e815fd_00000000 _call_desc(_0RL_lcfn_ef295e1645e815fd_10000000, "Stop", 5);


  _invoke(_call_desc);



}
// Local call call-back function.
static void
_0RL_lcfn_ef295e1645e815fd_20000000(omniCallDescriptor*, omniServant* svnt)
{
  
  _impl_RefHard* impl = (_impl_RefHard*) svnt->_ptrToInterface(RefHard::_PD_repoId);
  impl->Go();


}

void _objref_RefHard::Go()
{
  _0RL_cd_ef295e1645e815fd_00000000 _call_desc(_0RL_lcfn_ef295e1645e815fd_20000000, "Go", 3);


  _invoke(_call_desc);



}
_pof_RefHard::~_pof_RefHard() {}


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


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

const _pof_RefHard _the_pof_RefHard;

_impl_RefHard::~_impl_RefHard() {}


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

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

    _0RL_cd_ef295e1645e815fd_00000000 _call_desc(_0RL_lcfn_ef295e1645e815fd_10000000, "Stop", 5, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }

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

    _0RL_cd_ef295e1645e815fd_00000000 _call_desc(_0RL_lcfn_ef295e1645e815fd_20000000, "Go", 3, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }


  return 0;
}

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

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

const char*
_impl_RefHard::_mostDerivedRepoId()
{
  return ::RefHard::_PD_repoId;
}

POA_RefHard::~POA_RefHard() {}

