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

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



BatteryAlert_ptr BatteryAlert_Helper::_nil() {
  return ::BatteryAlert::_nil();
}

::CORBA::Boolean BatteryAlert_Helper::is_nil(::BatteryAlert_ptr p) {
  return ::CORBA::is_nil(p);

}

void BatteryAlert_Helper::release(::BatteryAlert_ptr p) {
  ::CORBA::release(p);
}

void BatteryAlert_Helper::marshalObjRef(::BatteryAlert_ptr obj, cdrStream& s) {
  ::BatteryAlert::_marshalObjRef(obj, s);
}

BatteryAlert_ptr BatteryAlert_Helper::unmarshalObjRef(cdrStream& s) {
  return ::BatteryAlert::_unmarshalObjRef(s);
}

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

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

BatteryAlert_ptr
BatteryAlert::_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();
}


BatteryAlert_ptr
BatteryAlert::_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();
}

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

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


_objref_BatteryAlert::~_objref_BatteryAlert() {
  
}


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

void*
_objref_BatteryAlert::_ptrToObjRef(const char* id)
{
  if( id == ::BatteryAlert::_PD_repoId )
    return (::BatteryAlert_ptr) this;
  
  if( id == ::CORBA::Object::_PD_repoId )
    return (::CORBA::Object_ptr) this;

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

  return 0;
}

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

    
  
  ::CORBA::Float arg_0;
};

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

}

void _0RL_cd_b81e731a53e43614_00000000::unmarshalArguments(cdrStream& _n)
{
  (::CORBA::Float&)arg_0 <<= _n;

}

// Local call call-back function.
static void
_0RL_lcfn_b81e731a53e43614_10000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_b81e731a53e43614_00000000* tcd = (_0RL_cd_b81e731a53e43614_00000000*)cd;
  _impl_BatteryAlert* impl = (_impl_BatteryAlert*) svnt->_ptrToInterface(BatteryAlert::_PD_repoId);
  impl->RH_InVoltageAlert(tcd->arg_0);


}

void _objref_BatteryAlert::RH_InVoltageAlert(::CORBA::Float voltage)
{
  _0RL_cd_b81e731a53e43614_00000000 _call_desc(_0RL_lcfn_b81e731a53e43614_10000000, "RH_InVoltageAlert", 18);
  _call_desc.arg_0 = voltage;

  _invoke(_call_desc);



}
_pof_BatteryAlert::~_pof_BatteryAlert() {}


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


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

const _pof_BatteryAlert _the_pof_BatteryAlert;

_impl_BatteryAlert::~_impl_BatteryAlert() {}


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

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

    _0RL_cd_b81e731a53e43614_00000000 _call_desc(_0RL_lcfn_b81e731a53e43614_10000000, "RH_InVoltageAlert", 18, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }


  return 0;
}

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

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

const char*
_impl_BatteryAlert::_mostDerivedRepoId()
{
  return ::BatteryAlert::_PD_repoId;
}

POA_BatteryAlert::~POA_BatteryAlert() {}

