// -*- C++ -*-
//
// $Id$

// ****  Code generated by the The ACE ORB (TAO) IDL Compiler ****
// TAO and the TAO IDL Compiler have been developed by:
//       Center for Distributed Object Computing
//       Washington University
//       St. Louis, MO
//       USA
//       http://www.cs.wustl.edu/~schmidt/doc-center.html
// and
//       Distributed Object Computing Laboratory
//       University of California at Irvine
//       Irvine, CA
//       USA
//       http://doc.ece.uci.edu/
// and
//       Institute for Software Integrated Systems
//       Vanderbilt University
//       Nashville, TN
//       USA
//       http://www.isis.vanderbilt.edu/
//
// Information about TAO is available at:
//     http://www.cs.wustl.edu/~schmidt/TAO.html

// TAO_IDL - Generated from
// be/be_codegen.cpp:303


#include "RTCosSchedulingC.h"
#include "tao/CDR.h"
#include "tao/Typecode.h"
#include "tao/Any_Impl_T.h"
#include "tao/Any_Dual_Impl_T.h"
#include "ace/OS_NS_string.h"

#if defined (__BORLANDC__)
#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig
#endif /* __BORLANDC__ */

#if !defined (__ACE_INLINE__)
#include "RTCosSchedulingC.inl"
#endif /* !defined __ACE_INLINE__ */

// TAO_IDL - Generated from
// be/be_visitor_arg_traits.cpp:64

// Arg traits specializations.
namespace TAO
{
}


// TAO_IDL - Generated from 
// be/be_visitor_exception/exception_cs.cpp:63

RTCosScheduling::UnknownName::UnknownName (void)
  : CORBA::UserException (
        "IDL:RTCosScheduling/UnknownName:1.0",
        "UnknownName"
      )
{
}

RTCosScheduling::UnknownName::~UnknownName (void)
{
}

RTCosScheduling::UnknownName::UnknownName (const ::RTCosScheduling::UnknownName &_tao_excp)
  : CORBA::UserException (
        _tao_excp._rep_id (),
        _tao_excp._name ()
      )
{
}

RTCosScheduling::UnknownName&
RTCosScheduling::UnknownName::operator= (const ::RTCosScheduling::UnknownName &_tao_excp)
{
  this->ACE_NESTED_CLASS (CORBA, UserException)::operator= (_tao_excp);
  return *this;
}

void RTCosScheduling::UnknownName::_tao_any_destructor (void *_tao_void_pointer)
{
  UnknownName *_tao_tmp_pointer =
    static_cast<UnknownName*> (_tao_void_pointer);
  delete _tao_tmp_pointer;
}

RTCosScheduling::UnknownName *
RTCosScheduling::UnknownName::_downcast (CORBA::Exception *_tao_excp)
{
  if (!ACE_OS::strcmp ("IDL:RTCosScheduling/UnknownName:1.0", _tao_excp->_rep_id ()))
    {
      return dynamic_cast<UnknownName *> (_tao_excp);
    }
  else
    {
      return 0;
    }
}

CORBA::Exception *RTCosScheduling::UnknownName::_alloc (void)
{
  CORBA::Exception *retval = 0;
  ACE_NEW_RETURN (retval, ::RTCosScheduling::UnknownName, 0);
  return retval;
}

CORBA::Exception *
RTCosScheduling::UnknownName::_tao_duplicate (void) const
{
  CORBA::Exception *result;
  ACE_NEW_RETURN (
      result,
      ::RTCosScheduling::UnknownName (*this),
      0
    );
  return result;
}

void RTCosScheduling::UnknownName::_raise (void) const
{
  TAO_RAISE (*this);
}

void RTCosScheduling::UnknownName::_tao_encode (
    TAO_OutputCDR &cdr
    ACE_ENV_ARG_DECL
  ) const
{
  if (cdr << *this)
    {
      return;
    }
  
  ACE_THROW (CORBA::MARSHAL ());
}

void RTCosScheduling::UnknownName::_tao_decode (
    TAO_InputCDR &cdr
    ACE_ENV_ARG_DECL
  )
{
  if (cdr >> *this)
    {
      return;
    }
  
  ACE_THROW (CORBA::MARSHAL ());
}

// TAO extension - the virtual _type method.
CORBA::TypeCode_ptr RTCosScheduling::UnknownName::_type (void) const
{
  return ::RTCosScheduling::_tc_UnknownName;
}

// TAO_IDL - Generated from
// be/be_visitor_typecode/typecode_defn.cpp:290

static const CORBA::Long _oc_RTCosScheduling_UnknownName[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  36,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x5254436f), 
  ACE_NTOHL (0x73536368), 
  ACE_NTOHL (0x6564756c), 
  ACE_NTOHL (0x696e672f), 
  ACE_NTOHL (0x556e6b6e), 
  ACE_NTOHL (0x6f776e4e), 
  ACE_NTOHL (0x616d653a), 
  ACE_NTOHL (0x312e3000),  // repository ID = IDL:RTCosScheduling/UnknownName:1.0
    12,
  ACE_NTOHL (0x556e6b6e), 
  ACE_NTOHL (0x6f776e4e), 
  ACE_NTOHL (0x616d6500),  // name = UnknownName
  0, // member count
  };

static CORBA::TypeCode _tc_TAO_tc_RTCosScheduling_UnknownName (
    CORBA::tk_except,
    sizeof (_oc_RTCosScheduling_UnknownName),
    (char *) &_oc_RTCosScheduling_UnknownName,
    0,
    sizeof (RTCosScheduling::UnknownName)
  );

namespace RTCosScheduling
{
  ::CORBA::TypeCode_ptr _tc_UnknownName =
    &_tc_TAO_tc_RTCosScheduling_UnknownName;
}

// TAO_IDL - Generated from
// be/be_visitor_interface/interface_cs.cpp:60

// Traits specializations for RTCosScheduling::ClientScheduler.

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
RTCosScheduling::ClientScheduler_ptr
TAO::Objref_Traits<RTCosScheduling::ClientScheduler>::tao_duplicate (
    RTCosScheduling::ClientScheduler_ptr p
  )
{
  return RTCosScheduling::ClientScheduler::_duplicate (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
void
TAO::Objref_Traits<RTCosScheduling::ClientScheduler>::tao_release (
    RTCosScheduling::ClientScheduler_ptr p
  )
{
  CORBA::release (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
RTCosScheduling::ClientScheduler_ptr
TAO::Objref_Traits<RTCosScheduling::ClientScheduler>::tao_nil (void)
{
  return RTCosScheduling::ClientScheduler::_nil ();
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CORBA::Boolean
TAO::Objref_Traits<RTCosScheduling::ClientScheduler>::tao_marshal (
    RTCosScheduling::ClientScheduler_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return CORBA::Object::marshal (p, cdr);
}

// Function pointer for collocation factory initialization.
TAO::Collocation_Proxy_Broker * 
(*RTCosScheduling__TAO_ClientScheduler_Proxy_Broker_Factory_function_pointer) (
    CORBA::Object_ptr obj
  ) = 0;

RTCosScheduling::ClientScheduler::ClientScheduler (void)
{}

RTCosScheduling::ClientScheduler::~ClientScheduler (void)
{}

void 
RTCosScheduling::ClientScheduler::_tao_any_destructor (void *_tao_void_pointer)
{
  ClientScheduler *_tao_tmp_pointer =
    static_cast<ClientScheduler *> (_tao_void_pointer);
  CORBA::release (_tao_tmp_pointer);
}

RTCosScheduling::ClientScheduler_ptr
RTCosScheduling::ClientScheduler::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (CORBA::is_nil (_tao_objref))
    {
      return ClientScheduler::_nil ();
    }
  
  ClientScheduler_ptr proxy =
    dynamic_cast<ClientScheduler_ptr> (_tao_objref);
  
  return ClientScheduler::_duplicate (proxy);
}

RTCosScheduling::ClientScheduler_ptr
RTCosScheduling::ClientScheduler::_unchecked_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (CORBA::is_nil (_tao_objref))
    {
      return ClientScheduler::_nil ();
    }
  
  ClientScheduler_ptr proxy =
    dynamic_cast<ClientScheduler_ptr> (_tao_objref);
  
  return ClientScheduler::_duplicate (proxy);
}

RTCosScheduling::ClientScheduler_ptr
RTCosScheduling::ClientScheduler::_duplicate (ClientScheduler_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  
  return obj;
}

CORBA::Boolean
RTCosScheduling::ClientScheduler::_is_a (
    const char *value
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:RTCosScheduling/ClientScheduler:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/LocalObject:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/Object:1.0"
        )
     )
    {
      return 1; // success using local knowledge
    }
  else
    {
      return 0;
    }
}

const char* RTCosScheduling::ClientScheduler::_interface_repository_id (void) const
{
  return "IDL:RTCosScheduling/ClientScheduler:1.0";
}

CORBA::Boolean
RTCosScheduling::ClientScheduler::marshal (TAO_OutputCDR &)
{
  return 0;
}

// TAO_IDL - Generated from
// be/be_visitor_typecode/typecode_defn.cpp:290

static const CORBA::Long _oc_RTCosScheduling_ClientScheduler[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  40,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x5254436f), 
  ACE_NTOHL (0x73536368), 
  ACE_NTOHL (0x6564756c), 
  ACE_NTOHL (0x696e672f), 
  ACE_NTOHL (0x436c6965), 
  ACE_NTOHL (0x6e745363), 
  ACE_NTOHL (0x68656475), 
  ACE_NTOHL (0x6c65723a), 
  ACE_NTOHL (0x312e3000),  // repository ID = IDL:RTCosScheduling/ClientScheduler:1.0
    16,
  ACE_NTOHL (0x436c6965), 
  ACE_NTOHL (0x6e745363), 
  ACE_NTOHL (0x68656475), 
  ACE_NTOHL (0x6c657200),  // name = ClientScheduler
  };

static CORBA::TypeCode _tc_TAO_tc_RTCosScheduling_ClientScheduler (
    CORBA::tk_objref,
    sizeof (_oc_RTCosScheduling_ClientScheduler),
    (char *) &_oc_RTCosScheduling_ClientScheduler,
    0,
    sizeof (RTCosScheduling::ClientScheduler)
  );

namespace RTCosScheduling
{
  ::CORBA::TypeCode_ptr _tc_ClientScheduler =
    &_tc_TAO_tc_RTCosScheduling_ClientScheduler;
}

// TAO_IDL - Generated from
// be/be_visitor_interface/interface_cs.cpp:60

// Traits specializations for RTCosScheduling::ServerScheduler.

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
RTCosScheduling::ServerScheduler_ptr
TAO::Objref_Traits<RTCosScheduling::ServerScheduler>::tao_duplicate (
    RTCosScheduling::ServerScheduler_ptr p
  )
{
  return RTCosScheduling::ServerScheduler::_duplicate (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
void
TAO::Objref_Traits<RTCosScheduling::ServerScheduler>::tao_release (
    RTCosScheduling::ServerScheduler_ptr p
  )
{
  CORBA::release (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
RTCosScheduling::ServerScheduler_ptr
TAO::Objref_Traits<RTCosScheduling::ServerScheduler>::tao_nil (void)
{
  return RTCosScheduling::ServerScheduler::_nil ();
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CORBA::Boolean
TAO::Objref_Traits<RTCosScheduling::ServerScheduler>::tao_marshal (
    RTCosScheduling::ServerScheduler_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return CORBA::Object::marshal (p, cdr);
}

// Function pointer for collocation factory initialization.
TAO::Collocation_Proxy_Broker * 
(*RTCosScheduling__TAO_ServerScheduler_Proxy_Broker_Factory_function_pointer) (
    CORBA::Object_ptr obj
  ) = 0;

RTCosScheduling::ServerScheduler::ServerScheduler (void)
{}

RTCosScheduling::ServerScheduler::~ServerScheduler (void)
{}

void 
RTCosScheduling::ServerScheduler::_tao_any_destructor (void *_tao_void_pointer)
{
  ServerScheduler *_tao_tmp_pointer =
    static_cast<ServerScheduler *> (_tao_void_pointer);
  CORBA::release (_tao_tmp_pointer);
}

RTCosScheduling::ServerScheduler_ptr
RTCosScheduling::ServerScheduler::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (CORBA::is_nil (_tao_objref))
    {
      return ServerScheduler::_nil ();
    }
  
  ServerScheduler_ptr proxy =
    dynamic_cast<ServerScheduler_ptr> (_tao_objref);
  
  return ServerScheduler::_duplicate (proxy);
}

RTCosScheduling::ServerScheduler_ptr
RTCosScheduling::ServerScheduler::_unchecked_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (CORBA::is_nil (_tao_objref))
    {
      return ServerScheduler::_nil ();
    }
  
  ServerScheduler_ptr proxy =
    dynamic_cast<ServerScheduler_ptr> (_tao_objref);
  
  return ServerScheduler::_duplicate (proxy);
}

RTCosScheduling::ServerScheduler_ptr
RTCosScheduling::ServerScheduler::_duplicate (ServerScheduler_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  
  return obj;
}

CORBA::Boolean
RTCosScheduling::ServerScheduler::_is_a (
    const char *value
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:RTCosScheduling/ServerScheduler:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/LocalObject:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/Object:1.0"
        )
     )
    {
      return 1; // success using local knowledge
    }
  else
    {
      return 0;
    }
}

const char* RTCosScheduling::ServerScheduler::_interface_repository_id (void) const
{
  return "IDL:RTCosScheduling/ServerScheduler:1.0";
}

CORBA::Boolean
RTCosScheduling::ServerScheduler::marshal (TAO_OutputCDR &)
{
  return 0;
}

// TAO_IDL - Generated from
// be/be_visitor_typecode/typecode_defn.cpp:290

static const CORBA::Long _oc_RTCosScheduling_ServerScheduler[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  40,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x5254436f), 
  ACE_NTOHL (0x73536368), 
  ACE_NTOHL (0x6564756c), 
  ACE_NTOHL (0x696e672f), 
  ACE_NTOHL (0x53657276), 
  ACE_NTOHL (0x65725363), 
  ACE_NTOHL (0x68656475), 
  ACE_NTOHL (0x6c65723a), 
  ACE_NTOHL (0x312e3000),  // repository ID = IDL:RTCosScheduling/ServerScheduler:1.0
    16,
  ACE_NTOHL (0x53657276), 
  ACE_NTOHL (0x65725363), 
  ACE_NTOHL (0x68656475), 
  ACE_NTOHL (0x6c657200),  // name = ServerScheduler
  };

static CORBA::TypeCode _tc_TAO_tc_RTCosScheduling_ServerScheduler (
    CORBA::tk_objref,
    sizeof (_oc_RTCosScheduling_ServerScheduler),
    (char *) &_oc_RTCosScheduling_ServerScheduler,
    0,
    sizeof (RTCosScheduling::ServerScheduler)
  );

namespace RTCosScheduling
{
  ::CORBA::TypeCode_ptr _tc_ServerScheduler =
    &_tc_TAO_tc_RTCosScheduling_ServerScheduler;
}

// TAO_IDL - Generated from 
// be/be_visitor_exception/any_op_cs.cpp:50

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Dual_Impl_T<RTCosScheduling::UnknownName>::demarshal_value (
    TAO_InputCDR & cdr
  )
{
  CORBA::String_var id;
  
  if ((cdr >> id.out ()) == 0)
    {
      return 0;
    }
  
  ACE_TRY_NEW_ENV
    {
      this->value_->_tao_decode (cdr ACE_ENV_ARG_PARAMETER);
      ACE_TRY_CHECK;
    }
  ACE_CATCHANY
    {
      return 0;
    }
  ACE_ENDTRY;
  
  return 1;
}

// Copying insertion.
void operator<<= (
    CORBA::Any &_tao_any,
    const RTCosScheduling::UnknownName &_tao_elem
  )
{
  TAO::Any_Dual_Impl_T<RTCosScheduling::UnknownName>::insert_copy (
      _tao_any,
      RTCosScheduling::UnknownName::_tao_any_destructor,
      RTCosScheduling::_tc_UnknownName,
      _tao_elem
    );
}

// Non-copying insertion.
void operator<<= (
    CORBA::Any &_tao_any,
    RTCosScheduling::UnknownName *_tao_elem
  )
{
  TAO::Any_Dual_Impl_T<RTCosScheduling::UnknownName>::insert (
      _tao_any,
      RTCosScheduling::UnknownName::_tao_any_destructor,
      RTCosScheduling::_tc_UnknownName,
      _tao_elem
    );
}

// Extraction to non-const pointer (deprecated).
CORBA::Boolean operator>>= (
    const CORBA::Any &_tao_any,
    RTCosScheduling::UnknownName *&_tao_elem
  )
{
  return _tao_any >>= const_cast<
      const RTCosScheduling::UnknownName *&> (
      _tao_elem
    );
}

// Extraction to const pointer.
CORBA::Boolean operator>>= (
    const CORBA::Any &_tao_any,
    const RTCosScheduling::UnknownName *&_tao_elem
  )
{
  return
    TAO::Any_Dual_Impl_T<RTCosScheduling::UnknownName>::extract (
        _tao_any,
        RTCosScheduling::UnknownName::_tao_any_destructor,
        RTCosScheduling::_tc_UnknownName,
        _tao_elem
      );
}

// TAO_IDL - Generated from
// be/be_visitor_interface/any_op_cs.cpp:50

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Impl_T<RTCosScheduling::ClientScheduler>::to_object (
    CORBA::Object_ptr &_tao_elem
  ) const
{
  _tao_elem = CORBA::Object::_duplicate (this->value_);
  return 1;
}

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Impl_T<RTCosScheduling::ClientScheduler>::marshal_value (TAO_OutputCDR &)
{
  return 0;
}

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Impl_T<RTCosScheduling::ClientScheduler>::demarshal_value (TAO_InputCDR &)
{
  return 0;
}

// Copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    RTCosScheduling::ClientScheduler_ptr _tao_elem
  )
{
  RTCosScheduling::ClientScheduler_ptr _tao_objptr =
    RTCosScheduling::ClientScheduler::_duplicate (_tao_elem);
  _tao_any <<= &_tao_objptr;
}

// Non-copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    RTCosScheduling::ClientScheduler_ptr *_tao_elem
  )
{
  TAO::Any_Impl_T<RTCosScheduling::ClientScheduler>::insert (
      _tao_any,
      RTCosScheduling::ClientScheduler::_tao_any_destructor,
      RTCosScheduling::_tc_ClientScheduler,
      *_tao_elem
    );
}

CORBA::Boolean
operator>>= (
    const CORBA::Any &_tao_any,
    RTCosScheduling::ClientScheduler_ptr &_tao_elem
  )
{
  return
    TAO::Any_Impl_T<RTCosScheduling::ClientScheduler>::extract (
        _tao_any,
        RTCosScheduling::ClientScheduler::_tao_any_destructor,
        RTCosScheduling::_tc_ClientScheduler,
        _tao_elem
      );
}

// TAO_IDL - Generated from
// be/be_visitor_interface/any_op_cs.cpp:50

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Impl_T<RTCosScheduling::ServerScheduler>::to_object (
    CORBA::Object_ptr &_tao_elem
  ) const
{
  _tao_elem = CORBA::Object::_duplicate (this->value_);
  return 1;
}

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Impl_T<RTCosScheduling::ServerScheduler>::marshal_value (TAO_OutputCDR &)
{
  return 0;
}

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Impl_T<RTCosScheduling::ServerScheduler>::demarshal_value (TAO_InputCDR &)
{
  return 0;
}

// Copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    RTCosScheduling::ServerScheduler_ptr _tao_elem
  )
{
  RTCosScheduling::ServerScheduler_ptr _tao_objptr =
    RTCosScheduling::ServerScheduler::_duplicate (_tao_elem);
  _tao_any <<= &_tao_objptr;
}

// Non-copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    RTCosScheduling::ServerScheduler_ptr *_tao_elem
  )
{
  TAO::Any_Impl_T<RTCosScheduling::ServerScheduler>::insert (
      _tao_any,
      RTCosScheduling::ServerScheduler::_tao_any_destructor,
      RTCosScheduling::_tc_ServerScheduler,
      *_tao_elem
    );
}

CORBA::Boolean
operator>>= (
    const CORBA::Any &_tao_any,
    RTCosScheduling::ServerScheduler_ptr &_tao_elem
  )
{
  return
    TAO::Any_Impl_T<RTCosScheduling::ServerScheduler>::extract (
        _tao_any,
        RTCosScheduling::ServerScheduler::_tao_any_destructor,
        RTCosScheduling::_tc_ServerScheduler,
        _tao_elem
      );
}

// TAO_IDL - Generated from
// be/be_visitor_exception/cdr_op_cs.cpp:60

CORBA::Boolean operator<< (
    TAO_OutputCDR &strm,
    const RTCosScheduling::UnknownName &_tao_aggregate
  )
{
  // First marshal the repository ID.
  if (strm << _tao_aggregate._rep_id ())
    {
      return 1;
    }
  else
    {
      return 0;
    }
}

CORBA::Boolean operator>> (
    TAO_InputCDR &,
    RTCosScheduling::UnknownName&
  )
{
  return 1;
}

