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

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



CORBA_InitialReferences_ptr CORBA_InitialReferences_Helper::_nil() {
  return ::CORBA_InitialReferences::_nil();
}

::CORBA::Boolean CORBA_InitialReferences_Helper::is_nil(::CORBA_InitialReferences_ptr p) {
  return ::CORBA::is_nil(p);

}

void CORBA_InitialReferences_Helper::release(::CORBA_InitialReferences_ptr p) {
  ::CORBA::release(p);
}

void CORBA_InitialReferences_Helper::marshalObjRef(::CORBA_InitialReferences_ptr obj, cdrStream& s) {
  ::CORBA_InitialReferences::_marshalObjRef(obj, s);
}

CORBA_InitialReferences_ptr CORBA_InitialReferences_Helper::unmarshalObjRef(cdrStream& s) {
  return ::CORBA_InitialReferences::_unmarshalObjRef(s);
}

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

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

CORBA_InitialReferences_ptr
CORBA_InitialReferences::_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();
}


CORBA_InitialReferences_ptr
CORBA_InitialReferences::_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();
}

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

const char* CORBA_InitialReferences::_PD_repoId = "omg.org/CORBA/InitialReferences:1.0";


_objref_CORBA_InitialReferences::~_objref_CORBA_InitialReferences() {
  
}


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

void*
_objref_CORBA_InitialReferences::_ptrToObjRef(const char* id)
{
  if (id == ::CORBA_InitialReferences::_PD_repoId)
    return (::CORBA_InitialReferences_ptr) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (::CORBA::Object_ptr) this;

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

  return 0;
}


//
// Code for CORBA_InitialReferences::get

// Proxy call descriptor class. Mangled signature:
//  _cCORBA_mObject_i_cstring
class _0RL_cd_96f078e2247ab9da_00000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_96f078e2247ab9da_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::Object_var result;
};

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

}

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

}

void _0RL_cd_96f078e2247ab9da_00000000::marshalReturnedValues(cdrStream& _n)
{
  CORBA::Object::_marshalObjRef(result,_n);

}

void _0RL_cd_96f078e2247ab9da_00000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = CORBA::Object::_unmarshalObjRef(_n);

}

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

// Local call call-back function.
static void
_0RL_lcfn_96f078e2247ab9da_10000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_96f078e2247ab9da_00000000* tcd = (_0RL_cd_96f078e2247ab9da_00000000*)cd;
  _impl_CORBA_InitialReferences* impl = (_impl_CORBA_InitialReferences*) svnt->_ptrToInterface(CORBA_InitialReferences::_PD_repoId);
  tcd->result = impl->get(tcd->arg_0);


}

CORBA::Object_ptr _objref_CORBA_InitialReferences::get(const char* id)
{
  _0RL_cd_96f078e2247ab9da_00000000 _call_desc(_0RL_lcfn_96f078e2247ab9da_10000000, "get", 4);
  _call_desc.arg_0 = id;

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


}


//
// Code for CORBA_InitialReferences::list

// Proxy call descriptor class. Mangled signature:
//  _cCORBA__InitialReferences_mObjIdList
class _0RL_cd_96f078e2247ab9da_20000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_96f078e2247ab9da_20000000(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_InitialReferences::ObjIdList_var result;
};

void _0RL_cd_96f078e2247ab9da_20000000::marshalReturnedValues(cdrStream& _n)
{
  (const CORBA_InitialReferences::ObjIdList&) result >>= _n;

}

void _0RL_cd_96f078e2247ab9da_20000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = new CORBA_InitialReferences::ObjIdList;
  (CORBA_InitialReferences::ObjIdList&)result <<= _n;

}

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

// Local call call-back function.
static void
_0RL_lcfn_96f078e2247ab9da_30000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_96f078e2247ab9da_20000000* tcd = (_0RL_cd_96f078e2247ab9da_20000000*)cd;
  _impl_CORBA_InitialReferences* impl = (_impl_CORBA_InitialReferences*) svnt->_ptrToInterface(CORBA_InitialReferences::_PD_repoId);
  tcd->result = impl->list();


}

CORBA_InitialReferences::ObjIdList* _objref_CORBA_InitialReferences::list()
{
  _0RL_cd_96f078e2247ab9da_20000000 _call_desc(_0RL_lcfn_96f078e2247ab9da_30000000, "list", 5);


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


}

_pof_CORBA_InitialReferences::~_pof_CORBA_InitialReferences() {}


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


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

const _pof_CORBA_InitialReferences _the_pof_CORBA__InitialReferences;

_impl_CORBA_InitialReferences::~_impl_CORBA_InitialReferences() {}


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

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

    _0RL_cd_96f078e2247ab9da_00000000 _call_desc(_0RL_lcfn_96f078e2247ab9da_10000000, "get", 4, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }

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

    _0RL_cd_96f078e2247ab9da_20000000 _call_desc(_0RL_lcfn_96f078e2247ab9da_30000000, "list", 5, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }


  return 0;
}

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

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

const char*
_impl_CORBA_InitialReferences::_mostDerivedRepoId()
{
  return ::CORBA_InitialReferences::_PD_repoId;
}

POA_CORBA_InitialReferences::~POA_CORBA_InitialReferences() {}

