/*
 *  MICO --- a free CORBA implementation
 *  Copyright (C) 1997-98 Kay Roemer & Arno Puder
 *
 *  This file was automatically generated. DO NOT EDIT!
 */

#include <CORBA.h>
#include <mico/throw.h>
#include <mico/template_impl.h>

//--------------------------------------------------------
//  Implementation of stubs
//--------------------------------------------------------


#ifdef HAVE_NAMESPACE
namespace RT_CORBA { const CORBA::Short minPriority = 0; };
#else
const CORBA::Short RT_CORBA::minPriority = 0;
#endif
#ifdef HAVE_NAMESPACE
namespace RT_CORBA { const CORBA::Short maxPriority = 32767; };
#else
const CORBA::Short RT_CORBA::maxPriority = 32767;
#endif

#ifdef HAVE_EXPLICIT_STRUCT_OPS
RT_CORBA::ThreadpoolLane::ThreadpoolLane()
{
}

RT_CORBA::ThreadpoolLane::ThreadpoolLane( const ThreadpoolLane& _s )
{
  lane_priority = ((ThreadpoolLane&)_s).lane_priority;
  static_threads = ((ThreadpoolLane&)_s).static_threads;
  dynamic_threads = ((ThreadpoolLane&)_s).dynamic_threads;
}

RT_CORBA::ThreadpoolLane::~ThreadpoolLane()
{
}

RT_CORBA::ThreadpoolLane&
RT_CORBA::ThreadpoolLane::operator=( const ThreadpoolLane& _s )
{
  lane_priority = ((ThreadpoolLane&)_s).lane_priority;
  static_threads = ((ThreadpoolLane&)_s).static_threads;
  dynamic_threads = ((ThreadpoolLane&)_s).dynamic_threads;
  return *this;
}
#endif


#ifdef HAVE_NAMESPACE
namespace RT_CORBA { const CORBA::ULong PRIORITY_MODEL_POLICY_TYPE = 12; };
#else
const CORBA::ULong RT_CORBA::PRIORITY_MODEL_POLICY_TYPE = 12;
#endif


// Stub interface PriorityModelPolicy
RT_CORBA::PriorityModelPolicy::~PriorityModelPolicy()
{
}

void *RT_CORBA::PriorityModelPolicy::_narrow_helper( const char *_repoid )
{
  if( strcmp( _repoid, "IDL:omg.org/RT_CORBA/PriorityModelPolicy:1.0" ) == 0 )
    return (void *)this;
  {
    void *_p;
    if( (_p = MICO_SCOPE(CORBA,Policy)::_narrow_helper( _repoid )))
      return _p;
  }
  return NULL;
}

RT_CORBA::PriorityModelPolicy_ptr RT_CORBA::PriorityModelPolicy::_narrow( CORBA::Object_ptr _obj )
{
  if( !CORBA::is_nil( _obj ) ) {
    void *_p;
    if( (_p = _obj->_narrow_helper( "IDL:omg.org/RT_CORBA/PriorityModelPolicy:1.0" )))
      return _duplicate( (RT_CORBA::PriorityModelPolicy_ptr) _p );
  }
  return _nil();
}

RT_CORBA::PriorityModelPolicy_ptr
RT_CORBA::PriorityModelPolicy::_narrow( CORBA::AbstractBase_ptr _obj )
{
  return _narrow (_obj->_to_object());
}


#ifdef HAVE_NAMESPACE
namespace RT_CORBA { const CORBA::ULong THREADPOOL_POLICY_TYPE = 13; };
#else
const CORBA::ULong RT_CORBA::THREADPOOL_POLICY_TYPE = 13;
#endif

// Stub interface ThreadpoolPolicy
RT_CORBA::ThreadpoolPolicy::~ThreadpoolPolicy()
{
}

void *RT_CORBA::ThreadpoolPolicy::_narrow_helper( const char *_repoid )
{
  if( strcmp( _repoid, "IDL:omg.org/RT_CORBA/ThreadpoolPolicy:1.0" ) == 0 )
    return (void *)this;
  {
    void *_p;
    if( (_p = MICO_SCOPE(CORBA,Policy)::_narrow_helper( _repoid )))
      return _p;
  }
  return NULL;
}

RT_CORBA::ThreadpoolPolicy_ptr RT_CORBA::ThreadpoolPolicy::_narrow( CORBA::Object_ptr _obj )
{
  if( !CORBA::is_nil( _obj ) ) {
    void *_p;
    if( (_p = _obj->_narrow_helper( "IDL:omg.org/RT_CORBA/ThreadpoolPolicy:1.0" )))
      return _duplicate( (RT_CORBA::ThreadpoolPolicy_ptr) _p );
  }
  return _nil();
}

RT_CORBA::ThreadpoolPolicy_ptr
RT_CORBA::ThreadpoolPolicy::_narrow( CORBA::AbstractBase_ptr _obj )
{
  return _narrow (_obj->_to_object());
}



// Stub interface Current
RT_CORBA::Current::~Current()
{
}

void *RT_CORBA::Current::_narrow_helper( const char *_repoid )
{
  if( strcmp( _repoid, "IDL:omg.org/RT_CORBA/Current:1.0" ) == 0 )
    return (void *)this;
  {
    void *_p;
    if( (_p = MICO_SCOPE(CORBA,Current)::_narrow_helper( _repoid )))
      return _p;
  }
  return NULL;
}

RT_CORBA::Current_ptr RT_CORBA::Current::_narrow( CORBA::Object_ptr _obj )
{
  if( !CORBA::is_nil( _obj ) ) {
    void *_p;
    if( (_p = _obj->_narrow_helper( "IDL:omg.org/RT_CORBA/Current:1.0" )))
      return _duplicate( (RT_CORBA::Current_ptr) _p );
  }
  return _nil();
}

RT_CORBA::Current_ptr
RT_CORBA::Current::_narrow( CORBA::AbstractBase_ptr _obj )
{
  return _narrow (_obj->_to_object());
}


#if 0
// Stub interface Mutex
RT_CORBA::Mutex::~Mutex()
{
}

void *RT_CORBA::Mutex::_narrow_helper( const char *_repoid )
{
  if( strcmp( _repoid, "IDL:omg.org/RT_CORBA/Mutex:1.0" ) == 0 )
    return (void *)this;
  return NULL;
}

RT_CORBA::Mutex_ptr RT_CORBA::Mutex::_narrow( CORBA::Object_ptr _obj )
{
  if( !CORBA::is_nil( _obj ) ) {
    void *_p;
    if( (_p = _obj->_narrow_helper( "IDL:omg.org/RT_CORBA/Mutex:1.0" )))
      return _duplicate( (RT_CORBA::Mutex_ptr) _p );
  }
  return _nil();
}

RT_CORBA::Mutex_ptr
RT_CORBA::Mutex::_narrow( CORBA::AbstractBase_ptr _obj )
{
  return _narrow (_obj->_to_object());
}

#endif

#ifdef HAVE_EXPLICIT_STRUCT_OPS
RT_CORBA::RTORB::InvalidThreadpool::InvalidThreadpool()
{
}

RT_CORBA::RTORB::InvalidThreadpool::InvalidThreadpool( const InvalidThreadpool& _s )
{
}

RT_CORBA::RTORB::InvalidThreadpool::~InvalidThreadpool()
{
}

RT_CORBA::RTORB::InvalidThreadpool&
RT_CORBA::RTORB::InvalidThreadpool::operator=( const InvalidThreadpool& _s )
{
  return *this;
}
#endif

void RT_CORBA::RTORB::InvalidThreadpool::_throwit() const
{
  #ifdef HAVE_EXCEPTIONS
  #ifdef HAVE_STD_EH
  throw *this;
  #else
  throw InvalidThreadpool_var( (RT_CORBA::RTORB::InvalidThreadpool*)_clone() );
  #endif
  #else
  CORBA::Exception::_throw_failed( _clone() );
  #endif
}

const char *RT_CORBA::RTORB::InvalidThreadpool::_repoid() const
{
  return "IDL:omg.org/RT_CORBA/RTORB/InvalidThreadpool:1.0";
}

void RT_CORBA::RTORB::InvalidThreadpool::_encode( CORBA::DataEncoder &_en ) const
{
  assert(0);
}

void RT_CORBA::RTORB::InvalidThreadpool::_encode_any( CORBA::Any &_a ) const
{
  // use --any to make this work!
  assert(0);
}

CORBA::Exception *RT_CORBA::RTORB::InvalidThreadpool::_clone() const
{
  return new InvalidThreadpool( *this );
}

RT_CORBA::RTORB::InvalidThreadpool *RT_CORBA::RTORB::InvalidThreadpool::EXCEPTION_DOWNCAST( CORBA::Exception *_ex )
{
  if( _ex && !strcmp( _ex->_repoid(), "IDL:omg.org/RT_CORBA/RTORB/InvalidThreadpool:1.0" ) )
    return (InvalidThreadpool *) _ex;
  return NULL;
}

const RT_CORBA::RTORB::InvalidThreadpool *RT_CORBA::RTORB::InvalidThreadpool::EXCEPTION_DOWNCAST( const CORBA::Exception *_ex )
{
  if( _ex && !strcmp( _ex->_repoid(), "IDL:omg.org/RT_CORBA/RTORB/InvalidThreadpool:1.0" ) )
    return (InvalidThreadpool *) _ex;
  return NULL;
}


// Stub interface RTORB
RT_CORBA::RTORB::~RTORB()
{
}

void *RT_CORBA::RTORB::_narrow_helper( const char *_repoid )
{
  if( strcmp( _repoid, "IDL:omg.org/RT_CORBA/RTORB:1.0" ) == 0 )
    return (void *)this;
  return NULL;
}

RT_CORBA::RTORB_ptr RT_CORBA::RTORB::_narrow( CORBA::Object_ptr _obj )
{
  if( !CORBA::is_nil( _obj ) ) {
    void *_p;
    if( (_p = _obj->_narrow_helper( "IDL:omg.org/RT_CORBA/RTORB:1.0" )))
      return _duplicate( (RT_CORBA::RTORB_ptr) _p );
  }
  return _nil();
}

RT_CORBA::RTORB_ptr
RT_CORBA::RTORB::_narrow( CORBA::AbstractBase_ptr _obj )
{
  return _narrow (_obj->_to_object());
}


struct __tc_init_RT_CORBA {
  __tc_init_RT_CORBA()
  {
  }
};

static __tc_init_RT_CORBA __init_RT_CORBA;

