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

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



PlaySound_ptr PlaySound_Helper::_nil() {
  return ::PlaySound::_nil();
}

::CORBA::Boolean PlaySound_Helper::is_nil(::PlaySound_ptr p) {
  return ::CORBA::is_nil(p);

}

void PlaySound_Helper::release(::PlaySound_ptr p) {
  ::CORBA::release(p);
}

void PlaySound_Helper::marshalObjRef(::PlaySound_ptr obj, cdrStream& s) {
  ::PlaySound::_marshalObjRef(obj, s);
}

PlaySound_ptr PlaySound_Helper::unmarshalObjRef(cdrStream& s) {
  return ::PlaySound::_unmarshalObjRef(s);
}

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

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

PlaySound_ptr
PlaySound::_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();
}


PlaySound_ptr
PlaySound::_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();
}

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

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


_objref_PlaySound::~_objref_PlaySound() {
  
}


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

void*
_objref_PlaySound::_ptrToObjRef(const char* id)
{
  if( id == ::PlaySound::_PD_repoId )
    return (::PlaySound_ptr) this;
  
  if( id == ::CORBA::Object::_PD_repoId )
    return (::CORBA::Object_ptr) this;

  if( omni::strMatch(id, ::PlaySound::_PD_repoId) )
    return (::PlaySound_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_db39dd5fe040408b_00000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_db39dd5fe040408b_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_db39dd5fe040408b_10000000(omniCallDescriptor*, omniServant* svnt)
{
  
  _impl_PlaySound* impl = (_impl_PlaySound*) svnt->_ptrToInterface(PlaySound::_PD_repoId);
  impl->play();


}

void _objref_PlaySound::play()
{
  _0RL_cd_db39dd5fe040408b_00000000 _call_desc(_0RL_lcfn_db39dd5fe040408b_10000000, "play", 5);


  _invoke(_call_desc);



}
_pof_PlaySound::~_pof_PlaySound() {}


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


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

const _pof_PlaySound _the_pof_PlaySound;

_impl_PlaySound::~_impl_PlaySound() {}


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

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

    _0RL_cd_db39dd5fe040408b_00000000 _call_desc(_0RL_lcfn_db39dd5fe040408b_10000000, "play", 5, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }


  return 0;
}

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

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

const char*
_impl_PlaySound::_mostDerivedRepoId()
{
  return ::PlaySound::_PD_repoId;
}

POA_PlaySound::~POA_PlaySound() {}

