// This file is generated by omniidl2- omniORB_2_8. Do not edit.
#include "omniLifeCycle.hh"
#include <omniORB2/tcDescriptor.h>

static const char* _0RL_library_version = omniORB_2_8;


const CORBA::TypeCode_ptr _tc_omniLifeCycleInfo = CORBA::TypeCode::PR_interface_tc("IDL:omniLifeCycleInfo:1.0", "omniLifeCycleInfo");

static void
_0RL_tcParser_setObjectPtr_omniLifeCycleInfo(tcObjrefDesc *_desc, CORBA::Object_ptr _ptr)
{
  omniLifeCycleInfo_ptr _p = omniLifeCycleInfo::_narrow(_ptr);
  omniLifeCycleInfo_ptr* pp = (omniLifeCycleInfo_ptr*)_desc->opq_objref;
  if (_desc->opq_release && !CORBA::is_nil(*pp)) CORBA::release(*pp);
  *pp = _p;
  CORBA::release(_ptr);
}

static CORBA::Object_ptr
_0RL_tcParser_getObjectPtr_omniLifeCycleInfo(tcObjrefDesc *_desc)
{
  return (CORBA::Object_ptr) *((omniLifeCycleInfo_ptr*)_desc->opq_objref);
}

void _0RL_buildDesc_comniLifeCycleInfo(tcDescriptor& _desc, const _CORBA_ObjRef_Member<omniLifeCycleInfo,omniLifeCycleInfo_Helper>& _data)
{
  _desc.p_objref.opq_objref = (void*) &_data._ptr;
  _desc.p_objref.opq_release = _data.pd_rel;
  _desc.p_objref.setObjectPtr = _0RL_tcParser_setObjectPtr_omniLifeCycleInfo;
  _desc.p_objref.getObjectPtr = _0RL_tcParser_getObjectPtr_omniLifeCycleInfo;
}


void _0RL_delete_omniLifeCycleInfo(void* _data) {
  omniLifeCycleInfo_ptr _0RL_t = (omniLifeCycleInfo_ptr) _data;
  CORBA::release(_0RL_t);
}

void operator<<=(CORBA::Any& _a, omniLifeCycleInfo_ptr _s) {
  tcDescriptor tcd;
  _CORBA_ObjRef_Member<omniLifeCycleInfo,omniLifeCycleInfo_Helper> tmp(_s,0);
  _0RL_buildDesc_comniLifeCycleInfo(tcd, tmp);
  _a.PR_packFrom(_tc_omniLifeCycleInfo, &tcd);
}

CORBA::Boolean operator>>=(const CORBA::Any& _a, omniLifeCycleInfo_ptr& _s) {
  omniLifeCycleInfo_ptr sp = (omniLifeCycleInfo_ptr) _a.PR_getCachedData();
  if (sp == 0) {
    tcDescriptor tcd;
    _CORBA_ObjRef_Member<omniLifeCycleInfo,omniLifeCycleInfo_Helper> tmp;
    _0RL_buildDesc_comniLifeCycleInfo(tcd, tmp);
    if( _a.PR_unpackTo(_tc_omniLifeCycleInfo, &tcd) ) {
      if (!omniORB::omniORB_27_CompatibleAnyExtraction) {
        ((CORBA::Any*)&_a)->PR_setCachedData((void*)tmp._ptr,_0RL_delete_omniLifeCycleInfo);
      }
      _s = tmp._ptr;
      tmp._ptr = omniLifeCycleInfo::_nil(); return 1;
    } else {
      _s = omniLifeCycleInfo::_nil(); return 0;
    }
  }
  else {
    CORBA::TypeCode_var tc = _a.type();
    if (tc->equivalent(_tc_omniLifeCycleInfo)) {
    _s = sp; return 1;
    }
    else {
    _s = omniLifeCycleInfo::_nil(); return 0;
    }
  }
}
