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

#include "messaging.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)

OMNI_MAYBE_UNUSED static const char* _0RL_library_version = omniORB_4_3;



Messaging::ReplyHandler_ptr Messaging::ReplyHandler_Helper::_nil() {
  return ::Messaging::ReplyHandler::_nil();
}

::CORBA::Boolean Messaging::ReplyHandler_Helper::is_nil(::Messaging::ReplyHandler_ptr p) {
  return ::CORBA::is_nil(p);

}

void Messaging::ReplyHandler_Helper::release(::Messaging::ReplyHandler_ptr p) {
  ::CORBA::release(p);
}

void Messaging::ReplyHandler_Helper::marshalObjRef(::Messaging::ReplyHandler_ptr obj, cdrStream& s) {
  ::Messaging::ReplyHandler::_marshalObjRef(obj, s);
}

Messaging::ReplyHandler_ptr Messaging::ReplyHandler_Helper::unmarshalObjRef(cdrStream& s) {
  return ::Messaging::ReplyHandler::_unmarshalObjRef(s);
}

void Messaging::ReplyHandler_Helper::duplicate(::Messaging::ReplyHandler_ptr obj) {
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
}

Messaging::ReplyHandler_ptr
Messaging::ReplyHandler::_duplicate(::Messaging::ReplyHandler_ptr obj)
{
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
  return obj;
}

Messaging::ReplyHandler_ptr
Messaging::ReplyHandler::_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();
}


Messaging::ReplyHandler_ptr
Messaging::ReplyHandler::_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();
}

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

const char* Messaging::ReplyHandler::_PD_repoId = "IDL:omg.org/Messaging/ReplyHandler:1.0";


Messaging::_objref_ReplyHandler::~_objref_ReplyHandler() {
  
}


Messaging::_objref_ReplyHandler::_objref_ReplyHandler(omniIOR* ior, omniIdentity* id) :
   omniObjRef(::Messaging::ReplyHandler::_PD_repoId, ior, id, 1)
   
   
{
  _PR_setobj(this);
}

void*
Messaging::_objref_ReplyHandler::_ptrToObjRef(const char* id)
{
  if (id == ::Messaging::ReplyHandler::_PD_repoId)
    return (::Messaging::ReplyHandler_ptr) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (::CORBA::Object_ptr) this;

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

  return 0;
}

Messaging::_pof_ReplyHandler::~_pof_ReplyHandler() {}


omniObjRef*
Messaging::_pof_ReplyHandler::newObjRef(omniIOR* ior, omniIdentity* id)
{
  return new ::Messaging::_objref_ReplyHandler(ior, id);
}


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

const Messaging::_pof_ReplyHandler _the_pof_Messaging_mReplyHandler;

Messaging::_impl_ReplyHandler::~_impl_ReplyHandler() {}


::CORBA::Boolean
Messaging::_impl_ReplyHandler::_dispatch(omniCallHandle& _handle)
{
  

  
  return 0;
}

void*
Messaging::_impl_ReplyHandler::_ptrToInterface(const char* id)
{
  if (id == ::Messaging::ReplyHandler::_PD_repoId)
    return (::Messaging::_impl_ReplyHandler*) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (void*) 1;

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

const char*
Messaging::_impl_ReplyHandler::_mostDerivedRepoId()
{
  return ::Messaging::ReplyHandler::_PD_repoId;
}

// valuetype Poller

void
Messaging::Poller_Helper::add_ref(::Messaging::Poller* _v)
{
  if (_v) _v->_add_ref();
}

void
Messaging::Poller_Helper::remove_ref(::Messaging::Poller* _v)
{
  if (_v) _v->_remove_ref();
}

Messaging::Poller*
Messaging::Poller::_downcast(::CORBA::ValueBase* _b)
{
  return _b ? (Messaging::Poller*)_b->_ptrToValue(_PD_repoId) : 0;
}

const char* Messaging::Poller::_PD_repoId = "IDL:omg.org/Messaging/Poller:1.0";

const char*
Messaging::Poller::_NP_repositoryId() const
{
  return _PD_repoId;
}

const char*
Messaging::Poller::_NP_repositoryId(::CORBA::ULong& hash) const
{
  hash = 2430887538U;
  return _PD_repoId;
}

::CORBA::Boolean
Messaging::Poller::_NP_custom() const
{
  return 0;
}

void*
Messaging::Poller::_ptrToValue(const char* _id)
{
  if (_id == ::Messaging::Poller::_PD_repoId)
    return (::Messaging::Poller*) this;
  
  if (_id == ::CORBA::Pollable::_PD_repoId)
    return (::CORBA::Pollable*) this;



  if (_id == ::CORBA::ValueBase::_PD_repoId)
    return (::CORBA::ValueBase*) this;
  
  if (omni::strMatch(_id, ::Messaging::Poller::_PD_repoId))
    return (::Messaging::Poller*) this;
  
  if (omni::strMatch(_id, ::CORBA::Pollable::_PD_repoId))
    return (::CORBA::Pollable*) this;



  if (omni::strMatch(_id, ::CORBA::ValueBase::_PD_repoId))
    return (::CORBA::ValueBase*) this;

  return 0;
}

void
Messaging::Poller::_NP_marshal(Messaging::Poller* _v, cdrStream& _0s)
{
  omniValueType::marshal(_v, Messaging::Poller::_PD_repoId, _0s);
}

void
Messaging::Poller_Helper::marshal(::Messaging::Poller* _v, cdrStream& _0s)
{
  Messaging::Poller::_NP_marshal(_v,_0s);
}

Messaging::Poller*
Messaging::Poller::_NP_unmarshal(cdrStream& _0s)
{
  ::CORBA::ValueBase* _b = omniValueType::unmarshal(Messaging::Poller::_PD_repoId,
						    2430887538U, 0, _0s);
  Messaging::Poller* _d = Messaging::Poller::_downcast(_b);
  if (_b && !_d) {
    _b = omniValueType::handleIncompatibleValue(
           Messaging::Poller::_PD_repoId,
           2430887538U, _b, (::CORBA::CompletionStatus)_0s.completion());
    _d = Messaging::Poller::_downcast(_b);
  }
  return _d;
}

Messaging::Poller*
Messaging::Poller_Helper::unmarshal(cdrStream& _0s)
{
  return Messaging::Poller::_NP_unmarshal(_0s);
}

void
Messaging::Poller::_PR_marshal_state(cdrStream& _0s) const
{
  
}

void
Messaging::Poller::_PR_unmarshal_state(cdrStream& _0s)
{
  
}

#ifdef OMNI_HAVE_COVARIANT_RETURNS
Messaging::Poller*
#else
::CORBA::ValueBase*
#endif
Messaging::Poller::_copy_value()
{
  ::CORBA::ValueBase* _b;
  _b = _omni_ValueFactoryManager::create_for_unmarshal(_PD_repoId, 2430887538U);
  Messaging::Poller* _v = Messaging::Poller::_downcast(_b);
  if (!_v) {
    ::CORBA::remove_ref(_b);
    OMNIORB_THROW(BAD_PARAM, BAD_PARAM_ValueFactoryFailure,
		  ::CORBA::COMPLETED_NO);
  }
  _v->_PR_copy_state(this);
  return _v;
}

void
Messaging::Poller::_PR_copy_state(Messaging::Poller* _v)
{
  
}


Messaging::Poller::Poller()  {}
Messaging::Poller::~Poller() {}

const _omni_ValueIds*
Messaging::Poller::_NP_truncatableIds() const
{
  return 0;
}

// valuetype ExceptionHolder

void
Messaging::ExceptionHolder_Helper::add_ref(::Messaging::ExceptionHolder* _v)
{
  if (_v) _v->_add_ref();
}

void
Messaging::ExceptionHolder_Helper::remove_ref(::Messaging::ExceptionHolder* _v)
{
  if (_v) _v->_remove_ref();
}

Messaging::ExceptionHolder*
Messaging::ExceptionHolder::_downcast(::CORBA::ValueBase* _b)
{
  return _b ? (Messaging::ExceptionHolder*)_b->_ptrToValue(_PD_repoId) : 0;
}

const char* Messaging::ExceptionHolder::_PD_repoId = "IDL:omg.org/Messaging/ExceptionHolder:1.0";

const char*
Messaging::ExceptionHolder::_NP_repositoryId() const
{
  return _PD_repoId;
}

const char*
Messaging::ExceptionHolder::_NP_repositoryId(::CORBA::ULong& hash) const
{
  hash = 152285916U;
  return _PD_repoId;
}

::CORBA::Boolean
Messaging::ExceptionHolder::_NP_custom() const
{
  return 0;
}

void*
Messaging::ExceptionHolder::_ptrToValue(const char* _id)
{
  if (_id == ::Messaging::ExceptionHolder::_PD_repoId)
    return (::Messaging::ExceptionHolder*) this;
  
  

  if (_id == ::CORBA::ValueBase::_PD_repoId)
    return (::CORBA::ValueBase*) this;
  
  if (omni::strMatch(_id, ::Messaging::ExceptionHolder::_PD_repoId))
    return (::Messaging::ExceptionHolder*) this;
  
  

  if (omni::strMatch(_id, ::CORBA::ValueBase::_PD_repoId))
    return (::CORBA::ValueBase*) this;

  return 0;
}

void
Messaging::ExceptionHolder::_NP_marshal(Messaging::ExceptionHolder* _v, cdrStream& _0s)
{
  omniValueType::marshal(_v, Messaging::ExceptionHolder::_PD_repoId, _0s);
}

void
Messaging::ExceptionHolder_Helper::marshal(::Messaging::ExceptionHolder* _v, cdrStream& _0s)
{
  Messaging::ExceptionHolder::_NP_marshal(_v,_0s);
}

Messaging::ExceptionHolder*
Messaging::ExceptionHolder::_NP_unmarshal(cdrStream& _0s)
{
  ::CORBA::ValueBase* _b = omniValueType::unmarshal(Messaging::ExceptionHolder::_PD_repoId,
						    152285916U, 0, _0s);
  Messaging::ExceptionHolder* _d = Messaging::ExceptionHolder::_downcast(_b);
  if (_b && !_d) {
    _b = omniValueType::handleIncompatibleValue(
           Messaging::ExceptionHolder::_PD_repoId,
           152285916U, _b, (::CORBA::CompletionStatus)_0s.completion());
    _d = Messaging::ExceptionHolder::_downcast(_b);
  }
  return _d;
}

Messaging::ExceptionHolder*
Messaging::ExceptionHolder_Helper::unmarshal(cdrStream& _0s)
{
  return Messaging::ExceptionHolder::_NP_unmarshal(_0s);
}

void
Messaging::ExceptionHolder::_PR_marshal_state(cdrStream& _0s) const
{
  
}

void
Messaging::ExceptionHolder::_PR_unmarshal_state(cdrStream& _0s)
{
  
}

#ifdef OMNI_HAVE_COVARIANT_RETURNS
Messaging::ExceptionHolder*
#else
::CORBA::ValueBase*
#endif
Messaging::ExceptionHolder::_copy_value()
{
  ::CORBA::ValueBase* _b;
  _b = _omni_ValueFactoryManager::create_for_unmarshal(_PD_repoId, 152285916U);
  Messaging::ExceptionHolder* _v = Messaging::ExceptionHolder::_downcast(_b);
  if (!_v) {
    ::CORBA::remove_ref(_b);
    OMNIORB_THROW(BAD_PARAM, BAD_PARAM_ValueFactoryFailure,
		  ::CORBA::COMPLETED_NO);
  }
  _v->_PR_copy_state(this);
  return _v;
}

void
Messaging::ExceptionHolder::_PR_copy_state(Messaging::ExceptionHolder* _v)
{
  
}


Messaging::ExceptionHolder::ExceptionHolder()  {}
Messaging::ExceptionHolder::~ExceptionHolder() {}

OBV_Messaging::ExceptionHolder::ExceptionHolder() {}
OBV_Messaging::ExceptionHolder::~ExceptionHolder() {}

const _omni_ValueIds*
Messaging::ExceptionHolder::_NP_truncatableIds() const
{
  return 0;
}

POA_Messaging::ReplyHandler::~ReplyHandler() {}

