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

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



void
CosLifeCycle::NVP::operator>>= (cdrStream &_n) const
{
  _n.marshalString(name,0);
  (const ::CORBA::Any&) value >>= _n;

}

void
CosLifeCycle::NVP::operator<<= (cdrStream &_n)
{
  name = _n.unmarshalString(0);
  (::CORBA::Any&)value <<= _n;

}

::CORBA::Exception::insertExceptionToAny CosLifeCycle::NoFactory::insertToAnyFn = 0;
::CORBA::Exception::insertExceptionToAnyNCP CosLifeCycle::NoFactory::insertToAnyFnNCP = 0;

CosLifeCycle::NoFactory::NoFactory(const CosLifeCycle::NoFactory& _s) : ::CORBA::UserException(_s)
{
  search_key = _s.search_key;

}

CosLifeCycle::NoFactory::NoFactory(const Key _search_key)
{
  pd_insertToAnyFn    = CosLifeCycle::NoFactory::insertToAnyFn;
  pd_insertToAnyFnNCP = CosLifeCycle::NoFactory::insertToAnyFnNCP;
  search_key = _search_key;

}



CosLifeCycle::NoFactory& CosLifeCycle::NoFactory::operator=(const CosLifeCycle::NoFactory& _s)
{
  if (&_s != this) {
    ((::CORBA::UserException*) this)->operator=(_s);
    search_key = _s.search_key;

  }
  return *this;
}

CosLifeCycle::NoFactory::~NoFactory() {}

void CosLifeCycle::NoFactory::_raise() const { throw *this; }

const char* CosLifeCycle::NoFactory::_PD_repoId = "IDL:omg.org/CosLifeCycle/NoFactory:1.0";
const char* CosLifeCycle::NoFactory::_PD_typeId = "Exception/UserException/CosLifeCycle::NoFactory";

CosLifeCycle::NoFactory* CosLifeCycle::NoFactory::_downcast(::CORBA::Exception* _e) {
  return (NoFactory*) _NP_is_a(_e, _PD_typeId);
}

const CosLifeCycle::NoFactory* CosLifeCycle::NoFactory::_downcast(const ::CORBA::Exception* _e) {
  return (const NoFactory*) _NP_is_a(_e, _PD_typeId);
}

::CORBA::Exception* CosLifeCycle::NoFactory::_NP_duplicate() const {
  return new NoFactory(*this);
}

const char* CosLifeCycle::NoFactory::_NP_typeId() const {
  return _PD_typeId;
}

const char* CosLifeCycle::NoFactory::_NP_repoId(int* _size) const {
  *_size = sizeof("IDL:omg.org/CosLifeCycle/NoFactory:1.0");
  return _PD_repoId;
}
 
void CosLifeCycle::NoFactory::_NP_marshal(cdrStream& _s) const {
  *this >>= _s;
}

void
CosLifeCycle::NoFactory::operator>>= (cdrStream& _n) const
{
  (const Key&) search_key >>= _n;

}

void
CosLifeCycle::NoFactory::operator<<= (cdrStream& _n)
{
  (Key&)search_key <<= _n;

}

::CORBA::Exception::insertExceptionToAny CosLifeCycle::NotCopyable::insertToAnyFn = 0;
::CORBA::Exception::insertExceptionToAnyNCP CosLifeCycle::NotCopyable::insertToAnyFnNCP = 0;

CosLifeCycle::NotCopyable::NotCopyable(const CosLifeCycle::NotCopyable& _s) : ::CORBA::UserException(_s)
{
  reason = _s.reason;

}

CosLifeCycle::NotCopyable::NotCopyable(const char* _reason)
{
  pd_insertToAnyFn    = CosLifeCycle::NotCopyable::insertToAnyFn;
  pd_insertToAnyFnNCP = CosLifeCycle::NotCopyable::insertToAnyFnNCP;
  reason = _reason;

}



CosLifeCycle::NotCopyable& CosLifeCycle::NotCopyable::operator=(const CosLifeCycle::NotCopyable& _s)
{
  if (&_s != this) {
    ((::CORBA::UserException*) this)->operator=(_s);
    reason = _s.reason;

  }
  return *this;
}

CosLifeCycle::NotCopyable::~NotCopyable() {}

void CosLifeCycle::NotCopyable::_raise() const { throw *this; }

const char* CosLifeCycle::NotCopyable::_PD_repoId = "IDL:omg.org/CosLifeCycle/NotCopyable:1.0";
const char* CosLifeCycle::NotCopyable::_PD_typeId = "Exception/UserException/CosLifeCycle::NotCopyable";

CosLifeCycle::NotCopyable* CosLifeCycle::NotCopyable::_downcast(::CORBA::Exception* _e) {
  return (NotCopyable*) _NP_is_a(_e, _PD_typeId);
}

const CosLifeCycle::NotCopyable* CosLifeCycle::NotCopyable::_downcast(const ::CORBA::Exception* _e) {
  return (const NotCopyable*) _NP_is_a(_e, _PD_typeId);
}

::CORBA::Exception* CosLifeCycle::NotCopyable::_NP_duplicate() const {
  return new NotCopyable(*this);
}

const char* CosLifeCycle::NotCopyable::_NP_typeId() const {
  return _PD_typeId;
}

const char* CosLifeCycle::NotCopyable::_NP_repoId(int* _size) const {
  *_size = sizeof("IDL:omg.org/CosLifeCycle/NotCopyable:1.0");
  return _PD_repoId;
}
 
void CosLifeCycle::NotCopyable::_NP_marshal(cdrStream& _s) const {
  *this >>= _s;
}

void
CosLifeCycle::NotCopyable::operator>>= (cdrStream& _n) const
{
  _n.marshalString(reason,0);

}

void
CosLifeCycle::NotCopyable::operator<<= (cdrStream& _n)
{
  reason = _n.unmarshalString(0);

}

::CORBA::Exception::insertExceptionToAny CosLifeCycle::NotMovable::insertToAnyFn = 0;
::CORBA::Exception::insertExceptionToAnyNCP CosLifeCycle::NotMovable::insertToAnyFnNCP = 0;

CosLifeCycle::NotMovable::NotMovable(const CosLifeCycle::NotMovable& _s) : ::CORBA::UserException(_s)
{
  reason = _s.reason;

}

CosLifeCycle::NotMovable::NotMovable(const char* _reason)
{
  pd_insertToAnyFn    = CosLifeCycle::NotMovable::insertToAnyFn;
  pd_insertToAnyFnNCP = CosLifeCycle::NotMovable::insertToAnyFnNCP;
  reason = _reason;

}



CosLifeCycle::NotMovable& CosLifeCycle::NotMovable::operator=(const CosLifeCycle::NotMovable& _s)
{
  if (&_s != this) {
    ((::CORBA::UserException*) this)->operator=(_s);
    reason = _s.reason;

  }
  return *this;
}

CosLifeCycle::NotMovable::~NotMovable() {}

void CosLifeCycle::NotMovable::_raise() const { throw *this; }

const char* CosLifeCycle::NotMovable::_PD_repoId = "IDL:omg.org/CosLifeCycle/NotMovable:1.0";
const char* CosLifeCycle::NotMovable::_PD_typeId = "Exception/UserException/CosLifeCycle::NotMovable";

CosLifeCycle::NotMovable* CosLifeCycle::NotMovable::_downcast(::CORBA::Exception* _e) {
  return (NotMovable*) _NP_is_a(_e, _PD_typeId);
}

const CosLifeCycle::NotMovable* CosLifeCycle::NotMovable::_downcast(const ::CORBA::Exception* _e) {
  return (const NotMovable*) _NP_is_a(_e, _PD_typeId);
}

::CORBA::Exception* CosLifeCycle::NotMovable::_NP_duplicate() const {
  return new NotMovable(*this);
}

const char* CosLifeCycle::NotMovable::_NP_typeId() const {
  return _PD_typeId;
}

const char* CosLifeCycle::NotMovable::_NP_repoId(int* _size) const {
  *_size = sizeof("IDL:omg.org/CosLifeCycle/NotMovable:1.0");
  return _PD_repoId;
}
 
void CosLifeCycle::NotMovable::_NP_marshal(cdrStream& _s) const {
  *this >>= _s;
}

void
CosLifeCycle::NotMovable::operator>>= (cdrStream& _n) const
{
  _n.marshalString(reason,0);

}

void
CosLifeCycle::NotMovable::operator<<= (cdrStream& _n)
{
  reason = _n.unmarshalString(0);

}

::CORBA::Exception::insertExceptionToAny CosLifeCycle::NotRemovable::insertToAnyFn = 0;
::CORBA::Exception::insertExceptionToAnyNCP CosLifeCycle::NotRemovable::insertToAnyFnNCP = 0;

CosLifeCycle::NotRemovable::NotRemovable(const CosLifeCycle::NotRemovable& _s) : ::CORBA::UserException(_s)
{
  reason = _s.reason;

}

CosLifeCycle::NotRemovable::NotRemovable(const char* _reason)
{
  pd_insertToAnyFn    = CosLifeCycle::NotRemovable::insertToAnyFn;
  pd_insertToAnyFnNCP = CosLifeCycle::NotRemovable::insertToAnyFnNCP;
  reason = _reason;

}



CosLifeCycle::NotRemovable& CosLifeCycle::NotRemovable::operator=(const CosLifeCycle::NotRemovable& _s)
{
  if (&_s != this) {
    ((::CORBA::UserException*) this)->operator=(_s);
    reason = _s.reason;

  }
  return *this;
}

CosLifeCycle::NotRemovable::~NotRemovable() {}

void CosLifeCycle::NotRemovable::_raise() const { throw *this; }

const char* CosLifeCycle::NotRemovable::_PD_repoId = "IDL:omg.org/CosLifeCycle/NotRemovable:1.0";
const char* CosLifeCycle::NotRemovable::_PD_typeId = "Exception/UserException/CosLifeCycle::NotRemovable";

CosLifeCycle::NotRemovable* CosLifeCycle::NotRemovable::_downcast(::CORBA::Exception* _e) {
  return (NotRemovable*) _NP_is_a(_e, _PD_typeId);
}

const CosLifeCycle::NotRemovable* CosLifeCycle::NotRemovable::_downcast(const ::CORBA::Exception* _e) {
  return (const NotRemovable*) _NP_is_a(_e, _PD_typeId);
}

::CORBA::Exception* CosLifeCycle::NotRemovable::_NP_duplicate() const {
  return new NotRemovable(*this);
}

const char* CosLifeCycle::NotRemovable::_NP_typeId() const {
  return _PD_typeId;
}

const char* CosLifeCycle::NotRemovable::_NP_repoId(int* _size) const {
  *_size = sizeof("IDL:omg.org/CosLifeCycle/NotRemovable:1.0");
  return _PD_repoId;
}
 
void CosLifeCycle::NotRemovable::_NP_marshal(cdrStream& _s) const {
  *this >>= _s;
}

void
CosLifeCycle::NotRemovable::operator>>= (cdrStream& _n) const
{
  _n.marshalString(reason,0);

}

void
CosLifeCycle::NotRemovable::operator<<= (cdrStream& _n)
{
  reason = _n.unmarshalString(0);

}

::CORBA::Exception::insertExceptionToAny CosLifeCycle::InvalidCriteria::insertToAnyFn = 0;
::CORBA::Exception::insertExceptionToAnyNCP CosLifeCycle::InvalidCriteria::insertToAnyFnNCP = 0;

CosLifeCycle::InvalidCriteria::InvalidCriteria(const CosLifeCycle::InvalidCriteria& _s) : ::CORBA::UserException(_s)
{
  invalid_criteria = _s.invalid_criteria;

}

CosLifeCycle::InvalidCriteria::InvalidCriteria(const Criteria _invalid_criteria)
{
  pd_insertToAnyFn    = CosLifeCycle::InvalidCriteria::insertToAnyFn;
  pd_insertToAnyFnNCP = CosLifeCycle::InvalidCriteria::insertToAnyFnNCP;
  invalid_criteria = _invalid_criteria;

}



CosLifeCycle::InvalidCriteria& CosLifeCycle::InvalidCriteria::operator=(const CosLifeCycle::InvalidCriteria& _s)
{
  if (&_s != this) {
    ((::CORBA::UserException*) this)->operator=(_s);
    invalid_criteria = _s.invalid_criteria;

  }
  return *this;
}

CosLifeCycle::InvalidCriteria::~InvalidCriteria() {}

void CosLifeCycle::InvalidCriteria::_raise() const { throw *this; }

const char* CosLifeCycle::InvalidCriteria::_PD_repoId = "IDL:omg.org/CosLifeCycle/InvalidCriteria:1.0";
const char* CosLifeCycle::InvalidCriteria::_PD_typeId = "Exception/UserException/CosLifeCycle::InvalidCriteria";

CosLifeCycle::InvalidCriteria* CosLifeCycle::InvalidCriteria::_downcast(::CORBA::Exception* _e) {
  return (InvalidCriteria*) _NP_is_a(_e, _PD_typeId);
}

const CosLifeCycle::InvalidCriteria* CosLifeCycle::InvalidCriteria::_downcast(const ::CORBA::Exception* _e) {
  return (const InvalidCriteria*) _NP_is_a(_e, _PD_typeId);
}

::CORBA::Exception* CosLifeCycle::InvalidCriteria::_NP_duplicate() const {
  return new InvalidCriteria(*this);
}

const char* CosLifeCycle::InvalidCriteria::_NP_typeId() const {
  return _PD_typeId;
}

const char* CosLifeCycle::InvalidCriteria::_NP_repoId(int* _size) const {
  *_size = sizeof("IDL:omg.org/CosLifeCycle/InvalidCriteria:1.0");
  return _PD_repoId;
}
 
void CosLifeCycle::InvalidCriteria::_NP_marshal(cdrStream& _s) const {
  *this >>= _s;
}

void
CosLifeCycle::InvalidCriteria::operator>>= (cdrStream& _n) const
{
  (const Criteria&) invalid_criteria >>= _n;

}

void
CosLifeCycle::InvalidCriteria::operator<<= (cdrStream& _n)
{
  (Criteria&)invalid_criteria <<= _n;

}

::CORBA::Exception::insertExceptionToAny CosLifeCycle::CannotMeetCriteria::insertToAnyFn = 0;
::CORBA::Exception::insertExceptionToAnyNCP CosLifeCycle::CannotMeetCriteria::insertToAnyFnNCP = 0;

CosLifeCycle::CannotMeetCriteria::CannotMeetCriteria(const CosLifeCycle::CannotMeetCriteria& _s) : ::CORBA::UserException(_s)
{
  unmet_criteria = _s.unmet_criteria;

}

CosLifeCycle::CannotMeetCriteria::CannotMeetCriteria(const Criteria _unmet_criteria)
{
  pd_insertToAnyFn    = CosLifeCycle::CannotMeetCriteria::insertToAnyFn;
  pd_insertToAnyFnNCP = CosLifeCycle::CannotMeetCriteria::insertToAnyFnNCP;
  unmet_criteria = _unmet_criteria;

}



CosLifeCycle::CannotMeetCriteria& CosLifeCycle::CannotMeetCriteria::operator=(const CosLifeCycle::CannotMeetCriteria& _s)
{
  if (&_s != this) {
    ((::CORBA::UserException*) this)->operator=(_s);
    unmet_criteria = _s.unmet_criteria;

  }
  return *this;
}

CosLifeCycle::CannotMeetCriteria::~CannotMeetCriteria() {}

void CosLifeCycle::CannotMeetCriteria::_raise() const { throw *this; }

const char* CosLifeCycle::CannotMeetCriteria::_PD_repoId = "IDL:omg.org/CosLifeCycle/CannotMeetCriteria:1.0";
const char* CosLifeCycle::CannotMeetCriteria::_PD_typeId = "Exception/UserException/CosLifeCycle::CannotMeetCriteria";

CosLifeCycle::CannotMeetCriteria* CosLifeCycle::CannotMeetCriteria::_downcast(::CORBA::Exception* _e) {
  return (CannotMeetCriteria*) _NP_is_a(_e, _PD_typeId);
}

const CosLifeCycle::CannotMeetCriteria* CosLifeCycle::CannotMeetCriteria::_downcast(const ::CORBA::Exception* _e) {
  return (const CannotMeetCriteria*) _NP_is_a(_e, _PD_typeId);
}

::CORBA::Exception* CosLifeCycle::CannotMeetCriteria::_NP_duplicate() const {
  return new CannotMeetCriteria(*this);
}

const char* CosLifeCycle::CannotMeetCriteria::_NP_typeId() const {
  return _PD_typeId;
}

const char* CosLifeCycle::CannotMeetCriteria::_NP_repoId(int* _size) const {
  *_size = sizeof("IDL:omg.org/CosLifeCycle/CannotMeetCriteria:1.0");
  return _PD_repoId;
}
 
void CosLifeCycle::CannotMeetCriteria::_NP_marshal(cdrStream& _s) const {
  *this >>= _s;
}

void
CosLifeCycle::CannotMeetCriteria::operator>>= (cdrStream& _n) const
{
  (const Criteria&) unmet_criteria >>= _n;

}

void
CosLifeCycle::CannotMeetCriteria::operator<<= (cdrStream& _n)
{
  (Criteria&)unmet_criteria <<= _n;

}

CosLifeCycle::FactoryFinder_ptr CosLifeCycle::FactoryFinder_Helper::_nil() {
  return ::CosLifeCycle::FactoryFinder::_nil();
}

::CORBA::Boolean CosLifeCycle::FactoryFinder_Helper::is_nil(::CosLifeCycle::FactoryFinder_ptr p) {
  return ::CORBA::is_nil(p);

}

void CosLifeCycle::FactoryFinder_Helper::release(::CosLifeCycle::FactoryFinder_ptr p) {
  ::CORBA::release(p);
}

void CosLifeCycle::FactoryFinder_Helper::marshalObjRef(::CosLifeCycle::FactoryFinder_ptr obj, cdrStream& s) {
  ::CosLifeCycle::FactoryFinder::_marshalObjRef(obj, s);
}

CosLifeCycle::FactoryFinder_ptr CosLifeCycle::FactoryFinder_Helper::unmarshalObjRef(cdrStream& s) {
  return ::CosLifeCycle::FactoryFinder::_unmarshalObjRef(s);
}

void CosLifeCycle::FactoryFinder_Helper::duplicate(::CosLifeCycle::FactoryFinder_ptr obj) {
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
}

CosLifeCycle::FactoryFinder_ptr
CosLifeCycle::FactoryFinder::_duplicate(::CosLifeCycle::FactoryFinder_ptr obj)
{
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
  return obj;
}

CosLifeCycle::FactoryFinder_ptr
CosLifeCycle::FactoryFinder::_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();
}


CosLifeCycle::FactoryFinder_ptr
CosLifeCycle::FactoryFinder::_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();
}

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

const char* CosLifeCycle::FactoryFinder::_PD_repoId = "IDL:omg.org/CosLifeCycle/FactoryFinder:1.0";


CosLifeCycle::_objref_FactoryFinder::~_objref_FactoryFinder() {
  
}


CosLifeCycle::_objref_FactoryFinder::_objref_FactoryFinder(omniIOR* ior, omniIdentity* id) :
   omniObjRef(::CosLifeCycle::FactoryFinder::_PD_repoId, ior, id, 1)
   
   
{
  _PR_setobj(this);
}

void*
CosLifeCycle::_objref_FactoryFinder::_ptrToObjRef(const char* id)
{
  if (id == ::CosLifeCycle::FactoryFinder::_PD_repoId)
    return (::CosLifeCycle::FactoryFinder_ptr) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (::CORBA::Object_ptr) this;

  if (omni::strMatch(id, ::CosLifeCycle::FactoryFinder::_PD_repoId))
    return (::CosLifeCycle::FactoryFinder_ptr) this;
  
  if (omni::strMatch(id, ::CORBA::Object::_PD_repoId))
    return (::CORBA::Object_ptr) this;

  return 0;
}


//
// Code for CosLifeCycle::FactoryFinder::find_factories

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

  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);
  
  void userException(cdrStream&, _OMNI_NS(IOP_C)*, const char*);
  static const char* const _user_exns[];

  CosLifeCycle::Key_var arg_0_;
  const CosLifeCycle::Key* arg_0;
  CosLifeCycle::Factories_var result;
};

void _0RL_cd_25b2b9dd5b4ad98d_00000000::marshalArguments(cdrStream& _n)
{
  (const CosLifeCycle::Key&) *arg_0 >>= _n;

}

void _0RL_cd_25b2b9dd5b4ad98d_00000000::unmarshalArguments(cdrStream& _n)
{
  arg_0_ = new CosLifeCycle::Key;
  (CosLifeCycle::Key&)arg_0_ <<= _n;
  arg_0 = &arg_0_.in();

}

void _0RL_cd_25b2b9dd5b4ad98d_00000000::marshalReturnedValues(cdrStream& _n)
{
  (const CosLifeCycle::Factories&) result >>= _n;

}

void _0RL_cd_25b2b9dd5b4ad98d_00000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = new CosLifeCycle::Factories;
  (CosLifeCycle::Factories&)result <<= _n;

}

const char* const _0RL_cd_25b2b9dd5b4ad98d_00000000::_user_exns[] = {
  CosLifeCycle::NoFactory::_PD_repoId
};

void _0RL_cd_25b2b9dd5b4ad98d_00000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId)
{
  if (omni::strMatch(repoId, CosLifeCycle::NoFactory::_PD_repoId)) {
    CosLifeCycle::NoFactory _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }


  else {
    if (iop_client) iop_client->RequestCompleted(1);
    OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException,
                  (::CORBA::CompletionStatus)s.completion());
  }
}

// Local call call-back function.
static void
_0RL_lcfn_25b2b9dd5b4ad98d_10000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_25b2b9dd5b4ad98d_00000000* tcd = (_0RL_cd_25b2b9dd5b4ad98d_00000000*)cd;
  CosLifeCycle::_impl_FactoryFinder* impl = (CosLifeCycle::_impl_FactoryFinder*) svnt->_ptrToInterface(CosLifeCycle::FactoryFinder::_PD_repoId);
#ifdef OMNI_HAS_Cplusplus_catch_exception_by_base
  tcd->result = impl->find_factories(*tcd->arg_0);
#else
  if (!cd->is_upcall())
    tcd->result = impl->find_factories(*tcd->arg_0);
  else {
    try {
      tcd->result = impl->find_factories(*tcd->arg_0);
    }
    catch(CosLifeCycle::NoFactory& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }


  }
#endif


}

CosLifeCycle::Factories* CosLifeCycle::_objref_FactoryFinder::find_factories(const ::CosLifeCycle::Key& factory_key)
{
  _0RL_cd_25b2b9dd5b4ad98d_00000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_10000000, "find_factories", 15);
  _call_desc.arg_0 = &(::CosLifeCycle::Key&) factory_key;

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


}

CosLifeCycle::_pof_FactoryFinder::~_pof_FactoryFinder() {}


omniObjRef*
CosLifeCycle::_pof_FactoryFinder::newObjRef(omniIOR* ior, omniIdentity* id)
{
  return new ::CosLifeCycle::_objref_FactoryFinder(ior, id);
}


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

const CosLifeCycle::_pof_FactoryFinder _the_pof_CosLifeCycle_mFactoryFinder;

CosLifeCycle::_impl_FactoryFinder::~_impl_FactoryFinder() {}


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

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

    _0RL_cd_25b2b9dd5b4ad98d_00000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_10000000, "find_factories", 15, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }


  return 0;
}

void*
CosLifeCycle::_impl_FactoryFinder::_ptrToInterface(const char* id)
{
  if (id == ::CosLifeCycle::FactoryFinder::_PD_repoId)
    return (::CosLifeCycle::_impl_FactoryFinder*) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (void*) 1;

  if (omni::strMatch(id, ::CosLifeCycle::FactoryFinder::_PD_repoId))
    return (::CosLifeCycle::_impl_FactoryFinder*) this;
  
  if (omni::strMatch(id, ::CORBA::Object::_PD_repoId))
    return (void*) 1;
  return 0;
}

const char*
CosLifeCycle::_impl_FactoryFinder::_mostDerivedRepoId()
{
  return ::CosLifeCycle::FactoryFinder::_PD_repoId;
}

CosLifeCycle::LifeCycleObject_ptr CosLifeCycle::LifeCycleObject_Helper::_nil() {
  return ::CosLifeCycle::LifeCycleObject::_nil();
}

::CORBA::Boolean CosLifeCycle::LifeCycleObject_Helper::is_nil(::CosLifeCycle::LifeCycleObject_ptr p) {
  return ::CORBA::is_nil(p);

}

void CosLifeCycle::LifeCycleObject_Helper::release(::CosLifeCycle::LifeCycleObject_ptr p) {
  ::CORBA::release(p);
}

void CosLifeCycle::LifeCycleObject_Helper::marshalObjRef(::CosLifeCycle::LifeCycleObject_ptr obj, cdrStream& s) {
  ::CosLifeCycle::LifeCycleObject::_marshalObjRef(obj, s);
}

CosLifeCycle::LifeCycleObject_ptr CosLifeCycle::LifeCycleObject_Helper::unmarshalObjRef(cdrStream& s) {
  return ::CosLifeCycle::LifeCycleObject::_unmarshalObjRef(s);
}

void CosLifeCycle::LifeCycleObject_Helper::duplicate(::CosLifeCycle::LifeCycleObject_ptr obj) {
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
}

CosLifeCycle::LifeCycleObject_ptr
CosLifeCycle::LifeCycleObject::_duplicate(::CosLifeCycle::LifeCycleObject_ptr obj)
{
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
  return obj;
}

CosLifeCycle::LifeCycleObject_ptr
CosLifeCycle::LifeCycleObject::_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();
}


CosLifeCycle::LifeCycleObject_ptr
CosLifeCycle::LifeCycleObject::_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();
}

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

const char* CosLifeCycle::LifeCycleObject::_PD_repoId = "IDL:omg.org/CosLifeCycle/LifeCycleObject:1.0";


CosLifeCycle::_objref_LifeCycleObject::~_objref_LifeCycleObject() {
  
}


CosLifeCycle::_objref_LifeCycleObject::_objref_LifeCycleObject(omniIOR* ior, omniIdentity* id) :
   omniObjRef(::CosLifeCycle::LifeCycleObject::_PD_repoId, ior, id, 1)
   
   
{
  _PR_setobj(this);
}

void*
CosLifeCycle::_objref_LifeCycleObject::_ptrToObjRef(const char* id)
{
  if (id == ::CosLifeCycle::LifeCycleObject::_PD_repoId)
    return (::CosLifeCycle::LifeCycleObject_ptr) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (::CORBA::Object_ptr) this;

  if (omni::strMatch(id, ::CosLifeCycle::LifeCycleObject::_PD_repoId))
    return (::CosLifeCycle::LifeCycleObject_ptr) this;
  
  if (omni::strMatch(id, ::CORBA::Object::_PD_repoId))
    return (::CORBA::Object_ptr) this;

  return 0;
}


//
// Code for CosLifeCycle::LifeCycleObject::copy

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

  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);
  
  void userException(cdrStream&, _OMNI_NS(IOP_C)*, const char*);
  static const char* const _user_exns[];

  CosLifeCycle::FactoryFinder_var arg_0_;
  CosLifeCycle::FactoryFinder_ptr arg_0;
  CosLifeCycle::Criteria_var arg_1_;
  const CosLifeCycle::Criteria* arg_1;
  CosLifeCycle::LifeCycleObject_var result;
};

void _0RL_cd_25b2b9dd5b4ad98d_20000000::marshalArguments(cdrStream& _n)
{
  CosLifeCycle::FactoryFinder::_marshalObjRef(arg_0,_n);
  (const CosLifeCycle::Criteria&) *arg_1 >>= _n;

}

void _0RL_cd_25b2b9dd5b4ad98d_20000000::unmarshalArguments(cdrStream& _n)
{
  arg_0_ = CosLifeCycle::FactoryFinder::_unmarshalObjRef(_n);
  arg_0 = arg_0_.in();
  arg_1_ = new CosLifeCycle::Criteria;
  (CosLifeCycle::Criteria&)arg_1_ <<= _n;
  arg_1 = &arg_1_.in();

}

void _0RL_cd_25b2b9dd5b4ad98d_20000000::marshalReturnedValues(cdrStream& _n)
{
  CosLifeCycle::LifeCycleObject::_marshalObjRef(result,_n);

}

void _0RL_cd_25b2b9dd5b4ad98d_20000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = CosLifeCycle::LifeCycleObject::_unmarshalObjRef(_n);

}

const char* const _0RL_cd_25b2b9dd5b4ad98d_20000000::_user_exns[] = {
  CosLifeCycle::CannotMeetCriteria::_PD_repoId,
  CosLifeCycle::InvalidCriteria::_PD_repoId,
  CosLifeCycle::NoFactory::_PD_repoId,
  CosLifeCycle::NotCopyable::_PD_repoId
};

void _0RL_cd_25b2b9dd5b4ad98d_20000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId)
{
  if (omni::strMatch(repoId, CosLifeCycle::CannotMeetCriteria::_PD_repoId)) {
    CosLifeCycle::CannotMeetCriteria _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }

  if (omni::strMatch(repoId, CosLifeCycle::InvalidCriteria::_PD_repoId)) {
    CosLifeCycle::InvalidCriteria _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }

  if (omni::strMatch(repoId, CosLifeCycle::NoFactory::_PD_repoId)) {
    CosLifeCycle::NoFactory _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }

  if (omni::strMatch(repoId, CosLifeCycle::NotCopyable::_PD_repoId)) {
    CosLifeCycle::NotCopyable _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }


  else {
    if (iop_client) iop_client->RequestCompleted(1);
    OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException,
                  (::CORBA::CompletionStatus)s.completion());
  }
}

// Local call call-back function.
static void
_0RL_lcfn_25b2b9dd5b4ad98d_30000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_25b2b9dd5b4ad98d_20000000* tcd = (_0RL_cd_25b2b9dd5b4ad98d_20000000*)cd;
  CosLifeCycle::_impl_LifeCycleObject* impl = (CosLifeCycle::_impl_LifeCycleObject*) svnt->_ptrToInterface(CosLifeCycle::LifeCycleObject::_PD_repoId);
#ifdef OMNI_HAS_Cplusplus_catch_exception_by_base
  tcd->result = impl->copy(tcd->arg_0, *tcd->arg_1);
#else
  if (!cd->is_upcall())
    tcd->result = impl->copy(tcd->arg_0, *tcd->arg_1);
  else {
    try {
      tcd->result = impl->copy(tcd->arg_0, *tcd->arg_1);
    }
    catch(CosLifeCycle::NoFactory& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }

    catch(CosLifeCycle::NotCopyable& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }

    catch(CosLifeCycle::InvalidCriteria& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }

    catch(CosLifeCycle::CannotMeetCriteria& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }


  }
#endif


}

CosLifeCycle::LifeCycleObject_ptr CosLifeCycle::_objref_LifeCycleObject::copy(::CosLifeCycle::FactoryFinder_ptr there, const ::CosLifeCycle::Criteria& the_criteria)
{
  _0RL_cd_25b2b9dd5b4ad98d_20000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_30000000, "copy", 5);
  _call_desc.arg_0 = there;
  _call_desc.arg_1 = &(::CosLifeCycle::Criteria&) the_criteria;

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


}


//
// Code for CosLifeCycle::LifeCycleObject::move

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

    
  void userException(cdrStream&, _OMNI_NS(IOP_C)*, const char*);
  static const char* const _user_exns[];

  CosLifeCycle::FactoryFinder_var arg_0_;
  CosLifeCycle::FactoryFinder_ptr arg_0;
  CosLifeCycle::Criteria_var arg_1_;
  const CosLifeCycle::Criteria* arg_1;
};

void _0RL_cd_25b2b9dd5b4ad98d_40000000::marshalArguments(cdrStream& _n)
{
  CosLifeCycle::FactoryFinder::_marshalObjRef(arg_0,_n);
  (const CosLifeCycle::Criteria&) *arg_1 >>= _n;

}

void _0RL_cd_25b2b9dd5b4ad98d_40000000::unmarshalArguments(cdrStream& _n)
{
  arg_0_ = CosLifeCycle::FactoryFinder::_unmarshalObjRef(_n);
  arg_0 = arg_0_.in();
  arg_1_ = new CosLifeCycle::Criteria;
  (CosLifeCycle::Criteria&)arg_1_ <<= _n;
  arg_1 = &arg_1_.in();

}

const char* const _0RL_cd_25b2b9dd5b4ad98d_40000000::_user_exns[] = {
  CosLifeCycle::CannotMeetCriteria::_PD_repoId,
  CosLifeCycle::InvalidCriteria::_PD_repoId,
  CosLifeCycle::NoFactory::_PD_repoId,
  CosLifeCycle::NotMovable::_PD_repoId
};

void _0RL_cd_25b2b9dd5b4ad98d_40000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId)
{
  if (omni::strMatch(repoId, CosLifeCycle::CannotMeetCriteria::_PD_repoId)) {
    CosLifeCycle::CannotMeetCriteria _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }

  if (omni::strMatch(repoId, CosLifeCycle::InvalidCriteria::_PD_repoId)) {
    CosLifeCycle::InvalidCriteria _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }

  if (omni::strMatch(repoId, CosLifeCycle::NoFactory::_PD_repoId)) {
    CosLifeCycle::NoFactory _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }

  if (omni::strMatch(repoId, CosLifeCycle::NotMovable::_PD_repoId)) {
    CosLifeCycle::NotMovable _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }


  else {
    if (iop_client) iop_client->RequestCompleted(1);
    OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException,
                  (::CORBA::CompletionStatus)s.completion());
  }
}

// Local call call-back function.
static void
_0RL_lcfn_25b2b9dd5b4ad98d_50000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_25b2b9dd5b4ad98d_40000000* tcd = (_0RL_cd_25b2b9dd5b4ad98d_40000000*)cd;
  CosLifeCycle::_impl_LifeCycleObject* impl = (CosLifeCycle::_impl_LifeCycleObject*) svnt->_ptrToInterface(CosLifeCycle::LifeCycleObject::_PD_repoId);
#ifdef OMNI_HAS_Cplusplus_catch_exception_by_base
  impl->move(tcd->arg_0, *tcd->arg_1);
#else
  if (!cd->is_upcall())
    impl->move(tcd->arg_0, *tcd->arg_1);
  else {
    try {
      impl->move(tcd->arg_0, *tcd->arg_1);
    }
    catch(CosLifeCycle::NoFactory& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }

    catch(CosLifeCycle::NotMovable& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }

    catch(CosLifeCycle::InvalidCriteria& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }

    catch(CosLifeCycle::CannotMeetCriteria& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }


  }
#endif


}

void CosLifeCycle::_objref_LifeCycleObject::move(::CosLifeCycle::FactoryFinder_ptr there, const ::CosLifeCycle::Criteria& the_criteria)
{
  _0RL_cd_25b2b9dd5b4ad98d_40000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_50000000, "move", 5);
  _call_desc.arg_0 = there;
  _call_desc.arg_1 = &(::CosLifeCycle::Criteria&) the_criteria;

  _invoke(_call_desc);



}


//
// Code for CosLifeCycle::LifeCycleObject::remove

// Proxy call descriptor class. Mangled signature:
//  void_e_cCosLifeCycle_mNotRemovable
class _0RL_cd_25b2b9dd5b4ad98d_60000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_25b2b9dd5b4ad98d_60000000(LocalCallFn lcfn, const char* op_, size_t oplen, _CORBA_Boolean upcall=0)
    : omniCallDescriptor(lcfn, op_, oplen, 0, _user_exns, 1, upcall)
  {
    
  }
  
  
    
  void userException(cdrStream&, _OMNI_NS(IOP_C)*, const char*);
  static const char* const _user_exns[];

  
};

const char* const _0RL_cd_25b2b9dd5b4ad98d_60000000::_user_exns[] = {
  CosLifeCycle::NotRemovable::_PD_repoId
};

void _0RL_cd_25b2b9dd5b4ad98d_60000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId)
{
  if (omni::strMatch(repoId, CosLifeCycle::NotRemovable::_PD_repoId)) {
    CosLifeCycle::NotRemovable _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }


  else {
    if (iop_client) iop_client->RequestCompleted(1);
    OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException,
                  (::CORBA::CompletionStatus)s.completion());
  }
}

// Local call call-back function.
static void
_0RL_lcfn_25b2b9dd5b4ad98d_70000000(omniCallDescriptor* _OMNIORB_EX_ONLY_CD(cd), omniServant* svnt)
{
  
  CosLifeCycle::_impl_LifeCycleObject* impl = (CosLifeCycle::_impl_LifeCycleObject*) svnt->_ptrToInterface(CosLifeCycle::LifeCycleObject::_PD_repoId);
#ifdef OMNI_HAS_Cplusplus_catch_exception_by_base
  impl->remove();
#else
  if (!cd->is_upcall())
    impl->remove();
  else {
    try {
      impl->remove();
    }
    catch(CosLifeCycle::NotRemovable& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }


  }
#endif


}

void CosLifeCycle::_objref_LifeCycleObject::remove()
{
  _0RL_cd_25b2b9dd5b4ad98d_60000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_70000000, "remove", 7);


  _invoke(_call_desc);



}

CosLifeCycle::_pof_LifeCycleObject::~_pof_LifeCycleObject() {}


omniObjRef*
CosLifeCycle::_pof_LifeCycleObject::newObjRef(omniIOR* ior, omniIdentity* id)
{
  return new ::CosLifeCycle::_objref_LifeCycleObject(ior, id);
}


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

const CosLifeCycle::_pof_LifeCycleObject _the_pof_CosLifeCycle_mLifeCycleObject;

CosLifeCycle::_impl_LifeCycleObject::~_impl_LifeCycleObject() {}


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

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

    _0RL_cd_25b2b9dd5b4ad98d_20000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_30000000, "copy", 5, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }

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

    _0RL_cd_25b2b9dd5b4ad98d_40000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_50000000, "move", 5, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }

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

    _0RL_cd_25b2b9dd5b4ad98d_60000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_70000000, "remove", 7, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }


  return 0;
}

void*
CosLifeCycle::_impl_LifeCycleObject::_ptrToInterface(const char* id)
{
  if (id == ::CosLifeCycle::LifeCycleObject::_PD_repoId)
    return (::CosLifeCycle::_impl_LifeCycleObject*) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (void*) 1;

  if (omni::strMatch(id, ::CosLifeCycle::LifeCycleObject::_PD_repoId))
    return (::CosLifeCycle::_impl_LifeCycleObject*) this;
  
  if (omni::strMatch(id, ::CORBA::Object::_PD_repoId))
    return (void*) 1;
  return 0;
}

const char*
CosLifeCycle::_impl_LifeCycleObject::_mostDerivedRepoId()
{
  return ::CosLifeCycle::LifeCycleObject::_PD_repoId;
}

CosLifeCycle::GenericFactory_ptr CosLifeCycle::GenericFactory_Helper::_nil() {
  return ::CosLifeCycle::GenericFactory::_nil();
}

::CORBA::Boolean CosLifeCycle::GenericFactory_Helper::is_nil(::CosLifeCycle::GenericFactory_ptr p) {
  return ::CORBA::is_nil(p);

}

void CosLifeCycle::GenericFactory_Helper::release(::CosLifeCycle::GenericFactory_ptr p) {
  ::CORBA::release(p);
}

void CosLifeCycle::GenericFactory_Helper::marshalObjRef(::CosLifeCycle::GenericFactory_ptr obj, cdrStream& s) {
  ::CosLifeCycle::GenericFactory::_marshalObjRef(obj, s);
}

CosLifeCycle::GenericFactory_ptr CosLifeCycle::GenericFactory_Helper::unmarshalObjRef(cdrStream& s) {
  return ::CosLifeCycle::GenericFactory::_unmarshalObjRef(s);
}

void CosLifeCycle::GenericFactory_Helper::duplicate(::CosLifeCycle::GenericFactory_ptr obj) {
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
}

CosLifeCycle::GenericFactory_ptr
CosLifeCycle::GenericFactory::_duplicate(::CosLifeCycle::GenericFactory_ptr obj)
{
  if (obj && !obj->_NP_is_nil())  omni::duplicateObjRef(obj);
  return obj;
}

CosLifeCycle::GenericFactory_ptr
CosLifeCycle::GenericFactory::_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();
}


CosLifeCycle::GenericFactory_ptr
CosLifeCycle::GenericFactory::_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();
}

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

const char* CosLifeCycle::GenericFactory::_PD_repoId = "IDL:omg.org/CosLifeCycle/GenericFactory:1.0";


CosLifeCycle::_objref_GenericFactory::~_objref_GenericFactory() {
  
}


CosLifeCycle::_objref_GenericFactory::_objref_GenericFactory(omniIOR* ior, omniIdentity* id) :
   omniObjRef(::CosLifeCycle::GenericFactory::_PD_repoId, ior, id, 1)
   
   
{
  _PR_setobj(this);
}

void*
CosLifeCycle::_objref_GenericFactory::_ptrToObjRef(const char* id)
{
  if (id == ::CosLifeCycle::GenericFactory::_PD_repoId)
    return (::CosLifeCycle::GenericFactory_ptr) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (::CORBA::Object_ptr) this;

  if (omni::strMatch(id, ::CosLifeCycle::GenericFactory::_PD_repoId))
    return (::CosLifeCycle::GenericFactory_ptr) this;
  
  if (omni::strMatch(id, ::CORBA::Object::_PD_repoId))
    return (::CORBA::Object_ptr) this;

  return 0;
}


//
// Code for CosLifeCycle::GenericFactory::supports

// Proxy call descriptor class. Mangled signature:
//  _cboolean_i_cCosNaming_mName
class _0RL_cd_25b2b9dd5b4ad98d_80000000
  : public omniCallDescriptor
{
public:
  inline _0RL_cd_25b2b9dd5b4ad98d_80000000(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[];

  CosLifeCycle::Key_var arg_0_;
  const CosLifeCycle::Key* arg_0;
  ::CORBA::Boolean result;
};

void _0RL_cd_25b2b9dd5b4ad98d_80000000::marshalArguments(cdrStream& _n)
{
  (const CosLifeCycle::Key&) *arg_0 >>= _n;

}

void _0RL_cd_25b2b9dd5b4ad98d_80000000::unmarshalArguments(cdrStream& _n)
{
  arg_0_ = new CosLifeCycle::Key;
  (CosLifeCycle::Key&)arg_0_ <<= _n;
  arg_0 = &arg_0_.in();

}

void _0RL_cd_25b2b9dd5b4ad98d_80000000::marshalReturnedValues(cdrStream& _n)
{
  _n.marshalBoolean(result);

}

void _0RL_cd_25b2b9dd5b4ad98d_80000000::unmarshalReturnedValues(cdrStream& _n)
{
  result = _n.unmarshalBoolean();

}

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

// Local call call-back function.
static void
_0RL_lcfn_25b2b9dd5b4ad98d_90000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_25b2b9dd5b4ad98d_80000000* tcd = (_0RL_cd_25b2b9dd5b4ad98d_80000000*)cd;
  CosLifeCycle::_impl_GenericFactory* impl = (CosLifeCycle::_impl_GenericFactory*) svnt->_ptrToInterface(CosLifeCycle::GenericFactory::_PD_repoId);
  tcd->result = impl->supports(*tcd->arg_0);


}

::CORBA::Boolean CosLifeCycle::_objref_GenericFactory::supports(const ::CosLifeCycle::Key& k)
{
  _0RL_cd_25b2b9dd5b4ad98d_80000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_90000000, "supports", 9);
  _call_desc.arg_0 = &(::CosLifeCycle::Key&) k;

  _invoke(_call_desc);
  return _call_desc.result;


}


//
// Code for CosLifeCycle::GenericFactory::create_object

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

  void unmarshalReturnedValues(cdrStream&);
  void marshalReturnedValues(cdrStream&);
  
  void userException(cdrStream&, _OMNI_NS(IOP_C)*, const char*);
  static const char* const _user_exns[];

  CosLifeCycle::Key_var arg_0_;
  const CosLifeCycle::Key* arg_0;
  CosLifeCycle::Criteria_var arg_1_;
  const CosLifeCycle::Criteria* arg_1;
  CORBA::Object_var result;
};

void _0RL_cd_25b2b9dd5b4ad98d_a0000000::marshalArguments(cdrStream& _n)
{
  (const CosLifeCycle::Key&) *arg_0 >>= _n;
  (const CosLifeCycle::Criteria&) *arg_1 >>= _n;

}

void _0RL_cd_25b2b9dd5b4ad98d_a0000000::unmarshalArguments(cdrStream& _n)
{
  arg_0_ = new CosLifeCycle::Key;
  (CosLifeCycle::Key&)arg_0_ <<= _n;
  arg_0 = &arg_0_.in();
  arg_1_ = new CosLifeCycle::Criteria;
  (CosLifeCycle::Criteria&)arg_1_ <<= _n;
  arg_1 = &arg_1_.in();

}

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

}

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

}

const char* const _0RL_cd_25b2b9dd5b4ad98d_a0000000::_user_exns[] = {
  CosLifeCycle::CannotMeetCriteria::_PD_repoId,
  CosLifeCycle::InvalidCriteria::_PD_repoId,
  CosLifeCycle::NoFactory::_PD_repoId
};

void _0RL_cd_25b2b9dd5b4ad98d_a0000000::userException(cdrStream& s, _OMNI_NS(IOP_C)* iop_client, const char* repoId)
{
  if (omni::strMatch(repoId, CosLifeCycle::CannotMeetCriteria::_PD_repoId)) {
    CosLifeCycle::CannotMeetCriteria _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }

  if (omni::strMatch(repoId, CosLifeCycle::InvalidCriteria::_PD_repoId)) {
    CosLifeCycle::InvalidCriteria _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }

  if (omni::strMatch(repoId, CosLifeCycle::NoFactory::_PD_repoId)) {
    CosLifeCycle::NoFactory _ex;
    _ex <<= s;
    if (iop_client) iop_client->RequestCompleted();
    throw _ex;
  }


  else {
    if (iop_client) iop_client->RequestCompleted(1);
    OMNIORB_THROW(UNKNOWN,UNKNOWN_UserException,
                  (::CORBA::CompletionStatus)s.completion());
  }
}

// Local call call-back function.
static void
_0RL_lcfn_25b2b9dd5b4ad98d_b0000000(omniCallDescriptor* cd, omniServant* svnt)
{
  _0RL_cd_25b2b9dd5b4ad98d_a0000000* tcd = (_0RL_cd_25b2b9dd5b4ad98d_a0000000*)cd;
  CosLifeCycle::_impl_GenericFactory* impl = (CosLifeCycle::_impl_GenericFactory*) svnt->_ptrToInterface(CosLifeCycle::GenericFactory::_PD_repoId);
#ifdef OMNI_HAS_Cplusplus_catch_exception_by_base
  tcd->result = impl->create_object(*tcd->arg_0, *tcd->arg_1);
#else
  if (!cd->is_upcall())
    tcd->result = impl->create_object(*tcd->arg_0, *tcd->arg_1);
  else {
    try {
      tcd->result = impl->create_object(*tcd->arg_0, *tcd->arg_1);
    }
    catch(CosLifeCycle::NoFactory& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }

    catch(CosLifeCycle::InvalidCriteria& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }

    catch(CosLifeCycle::CannotMeetCriteria& ex) {
      throw omniORB::StubUserException(ex._NP_duplicate());
    }


  }
#endif


}

CORBA::Object_ptr CosLifeCycle::_objref_GenericFactory::create_object(const ::CosLifeCycle::Key& k, const ::CosLifeCycle::Criteria& the_criteria)
{
  _0RL_cd_25b2b9dd5b4ad98d_a0000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_b0000000, "create_object", 14);
  _call_desc.arg_0 = &(::CosLifeCycle::Key&) k;
  _call_desc.arg_1 = &(::CosLifeCycle::Criteria&) the_criteria;

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


}

CosLifeCycle::_pof_GenericFactory::~_pof_GenericFactory() {}


omniObjRef*
CosLifeCycle::_pof_GenericFactory::newObjRef(omniIOR* ior, omniIdentity* id)
{
  return new ::CosLifeCycle::_objref_GenericFactory(ior, id);
}


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

const CosLifeCycle::_pof_GenericFactory _the_pof_CosLifeCycle_mGenericFactory;

CosLifeCycle::_impl_GenericFactory::~_impl_GenericFactory() {}


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

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

    _0RL_cd_25b2b9dd5b4ad98d_80000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_90000000, "supports", 9, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }

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

    _0RL_cd_25b2b9dd5b4ad98d_a0000000 _call_desc(_0RL_lcfn_25b2b9dd5b4ad98d_b0000000, "create_object", 14, 1);
    
    _handle.upcall(this,_call_desc);
    return 1;
  }


  return 0;
}

void*
CosLifeCycle::_impl_GenericFactory::_ptrToInterface(const char* id)
{
  if (id == ::CosLifeCycle::GenericFactory::_PD_repoId)
    return (::CosLifeCycle::_impl_GenericFactory*) this;
  
  if (id == ::CORBA::Object::_PD_repoId)
    return (void*) 1;

  if (omni::strMatch(id, ::CosLifeCycle::GenericFactory::_PD_repoId))
    return (::CosLifeCycle::_impl_GenericFactory*) this;
  
  if (omni::strMatch(id, ::CORBA::Object::_PD_repoId))
    return (void*) 1;
  return 0;
}

const char*
CosLifeCycle::_impl_GenericFactory::_mostDerivedRepoId()
{
  return ::CosLifeCycle::GenericFactory::_PD_repoId;
}

POA_CosLifeCycle::FactoryFinder::~FactoryFinder() {}

POA_CosLifeCycle::LifeCycleObject::~LifeCycleObject() {}

POA_CosLifeCycle::GenericFactory::~GenericFactory() {}

