// -*- C++ -*-
//
// EDF_SchedulingC.cpp,v 1.3 2005/01/28 15:36:14 jtc Exp

// ****  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:302


#include "EDF_SchedulingC.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 "EDF_SchedulingC.i"
#endif /* !defined INLINE */

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

// Arg traits specializations.
namespace TAO
{
};

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

static const CORBA::Long _oc_EDF_Scheduling_SchedulingParameter[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  43,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x4544465f), 
  ACE_NTOHL (0x53636865), 
  ACE_NTOHL (0x64756c69), 
  ACE_NTOHL (0x6e672f53), 
  ACE_NTOHL (0x63686564), 
  ACE_NTOHL (0x756c696e), 
  ACE_NTOHL (0x67506172), 
  ACE_NTOHL (0x616d6574), 
  ACE_NTOHL (0x65723a31), 
  ACE_NTOHL (0x2e300000),  // repository ID = IDL:EDF_Scheduling/SchedulingParameter:1.0
    20,
  ACE_NTOHL (0x53636865), 
  ACE_NTOHL (0x64756c69), 
  ACE_NTOHL (0x6e675061), 
  ACE_NTOHL (0x72616d65), 
  ACE_NTOHL (0x74657200),  // name = SchedulingParameter
  4, // member count
    9,
  ACE_NTOHL (0x64656164), 
  ACE_NTOHL (0x6c696e65), 
  ACE_NTOHL (0x0),  // name = deadline
    CORBA::tk_alias, // typecode kind for typedefs
  56, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    31,
    ACE_NTOHL (0x49444c3a), 
    ACE_NTOHL (0x6f6d672e), 
    ACE_NTOHL (0x6f72672f), 
    ACE_NTOHL (0x54696d65), 
    ACE_NTOHL (0x42617365), 
    ACE_NTOHL (0x2f54696d), 
    ACE_NTOHL (0x65543a31), 
    ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/TimeBase/TimeT:1.0
        6,
    ACE_NTOHL (0x54696d65), 
    ACE_NTOHL (0x54000000),  // name = TimeT
        CORBA::tk_ulonglong,


  11,
  ACE_NTOHL (0x696d706f), 
  ACE_NTOHL (0x7274616e), 
  ACE_NTOHL (0x63650000),  // name = importance
    CORBA::tk_long,

  7,
  ACE_NTOHL (0x70657269), 
  ACE_NTOHL (0x6f640000),  // name = period
    CORBA::tk_alias, // typecode kind for typedefs
  56, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    31,
    ACE_NTOHL (0x49444c3a), 
    ACE_NTOHL (0x6f6d672e), 
    ACE_NTOHL (0x6f72672f), 
    ACE_NTOHL (0x54696d65), 
    ACE_NTOHL (0x42617365), 
    ACE_NTOHL (0x2f54696d), 
    ACE_NTOHL (0x65543a31), 
    ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/TimeBase/TimeT:1.0
        6,
    ACE_NTOHL (0x54696d65), 
    ACE_NTOHL (0x54000000),  // name = TimeT
        CORBA::tk_ulonglong,


  8,
  ACE_NTOHL (0x7461736b), 
  ACE_NTOHL (0x5f696400),  // name = task_id
    CORBA::tk_long,

};

static CORBA::TypeCode _tc_TAO_tc_EDF_Scheduling_SchedulingParameter (
    CORBA::tk_struct,
    sizeof (_oc_EDF_Scheduling_SchedulingParameter),
    (char *) &_oc_EDF_Scheduling_SchedulingParameter,
    0,
    sizeof (EDF_Scheduling::SchedulingParameter)
  );

namespace EDF_Scheduling
{
  ::CORBA::TypeCode_ptr _tc_SchedulingParameter =
    &_tc_TAO_tc_EDF_Scheduling_SchedulingParameter;
}

// TAO_IDL - Generated from 
// be/be_visitor_structure/structure_cs.cpp:66

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

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

// Traits specializations for EDF_Scheduling::SchedulingParameterPolicy.

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION 
EDF_Scheduling::SchedulingParameterPolicy_ptr
TAO::Objref_Traits<EDF_Scheduling::SchedulingParameterPolicy>::tao_duplicate (
    EDF_Scheduling::SchedulingParameterPolicy_ptr p
  )
{
  return EDF_Scheduling::SchedulingParameterPolicy::_duplicate (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION 
void
TAO::Objref_Traits<EDF_Scheduling::SchedulingParameterPolicy>::tao_release (
    EDF_Scheduling::SchedulingParameterPolicy_ptr p
  )
{
  CORBA::release (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION 
EDF_Scheduling::SchedulingParameterPolicy_ptr
TAO::Objref_Traits<EDF_Scheduling::SchedulingParameterPolicy>::tao_nil (void)
{
  return EDF_Scheduling::SchedulingParameterPolicy::_nil ();
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION 
CORBA::Boolean
TAO::Objref_Traits<EDF_Scheduling::SchedulingParameterPolicy>::tao_marshal (
    EDF_Scheduling::SchedulingParameterPolicy_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return p->marshal (cdr);
}

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

EDF_Scheduling::SchedulingParameterPolicy::SchedulingParameterPolicy (void)
{}

EDF_Scheduling::SchedulingParameterPolicy::~SchedulingParameterPolicy (void)
{}

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

EDF_Scheduling::SchedulingParameterPolicy_ptr
EDF_Scheduling::SchedulingParameterPolicy::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (CORBA::is_nil (_tao_objref))
    {
      return SchedulingParameterPolicy::_nil ();
    }
  
  SchedulingParameterPolicy_ptr proxy =
    dynamic_cast<SchedulingParameterPolicy_ptr> (_tao_objref);
  
  return SchedulingParameterPolicy::_duplicate (proxy);
}

EDF_Scheduling::SchedulingParameterPolicy_ptr
EDF_Scheduling::SchedulingParameterPolicy::_duplicate (SchedulingParameterPolicy_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  
  return obj;
}

CORBA::Boolean
EDF_Scheduling::SchedulingParameterPolicy::_is_a (
    const char *value
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/Policy:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:EDF_Scheduling/SchedulingParameterPolicy: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* EDF_Scheduling::SchedulingParameterPolicy::_interface_repository_id (void) const
{
  return "IDL:EDF_Scheduling/SchedulingParameterPolicy:1.0";
}

CORBA::Boolean
EDF_Scheduling::SchedulingParameterPolicy::marshal (TAO_OutputCDR &)
{
  return 0;
}

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

static const CORBA::Long _oc_EDF_Scheduling_SchedulingParameterPolicy[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  49,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x4544465f), 
  ACE_NTOHL (0x53636865), 
  ACE_NTOHL (0x64756c69), 
  ACE_NTOHL (0x6e672f53), 
  ACE_NTOHL (0x63686564), 
  ACE_NTOHL (0x756c696e), 
  ACE_NTOHL (0x67506172), 
  ACE_NTOHL (0x616d6574), 
  ACE_NTOHL (0x6572506f), 
  ACE_NTOHL (0x6c696379), 
  ACE_NTOHL (0x3a312e30), 
  ACE_NTOHL (0x0),  // repository ID = IDL:EDF_Scheduling/SchedulingParameterPolicy:1.0
    26,
  ACE_NTOHL (0x53636865), 
  ACE_NTOHL (0x64756c69), 
  ACE_NTOHL (0x6e675061), 
  ACE_NTOHL (0x72616d65), 
  ACE_NTOHL (0x74657250), 
  ACE_NTOHL (0x6f6c6963), 
  ACE_NTOHL (0x79000000),  // name = SchedulingParameterPolicy
  };

static CORBA::TypeCode _tc_TAO_tc_EDF_Scheduling_SchedulingParameterPolicy (
    CORBA::tk_objref,
    sizeof (_oc_EDF_Scheduling_SchedulingParameterPolicy),
    (char *) &_oc_EDF_Scheduling_SchedulingParameterPolicy,
    0,
    sizeof (EDF_Scheduling::SchedulingParameterPolicy)
  );

namespace EDF_Scheduling
{
  ::CORBA::TypeCode_ptr _tc_SchedulingParameterPolicy =
    &_tc_TAO_tc_EDF_Scheduling_SchedulingParameterPolicy;
}

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

// Traits specializations for EDF_Scheduling::Scheduler.

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION 
EDF_Scheduling::Scheduler_ptr
TAO::Objref_Traits<EDF_Scheduling::Scheduler>::tao_duplicate (
    EDF_Scheduling::Scheduler_ptr p
  )
{
  return EDF_Scheduling::Scheduler::_duplicate (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION 
void
TAO::Objref_Traits<EDF_Scheduling::Scheduler>::tao_release (
    EDF_Scheduling::Scheduler_ptr p
  )
{
  CORBA::release (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION 
EDF_Scheduling::Scheduler_ptr
TAO::Objref_Traits<EDF_Scheduling::Scheduler>::tao_nil (void)
{
  return EDF_Scheduling::Scheduler::_nil ();
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION 
CORBA::Boolean
TAO::Objref_Traits<EDF_Scheduling::Scheduler>::tao_marshal (
    EDF_Scheduling::Scheduler_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return p->marshal (cdr);
}

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

EDF_Scheduling::Scheduler::Scheduler (void)
{}

EDF_Scheduling::Scheduler::~Scheduler (void)
{}

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

EDF_Scheduling::Scheduler_ptr
EDF_Scheduling::Scheduler::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (CORBA::is_nil (_tao_objref))
    {
      return Scheduler::_nil ();
    }
  
  Scheduler_ptr proxy =
    dynamic_cast<Scheduler_ptr> (_tao_objref);
  
  return Scheduler::_duplicate (proxy);
}

EDF_Scheduling::Scheduler_ptr
EDF_Scheduling::Scheduler::_duplicate (Scheduler_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  
  return obj;
}

CORBA::Boolean
EDF_Scheduling::Scheduler::_is_a (
    const char *value
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:RTScheduling/Scheduler:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:EDF_Scheduling/Scheduler: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* EDF_Scheduling::Scheduler::_interface_repository_id (void) const
{
  return "IDL:EDF_Scheduling/Scheduler:1.0";
}

CORBA::Boolean
EDF_Scheduling::Scheduler::marshal (TAO_OutputCDR &)
{
  return 0;
}

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

static const CORBA::Long _oc_EDF_Scheduling_Scheduler[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  33,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x4544465f), 
  ACE_NTOHL (0x53636865), 
  ACE_NTOHL (0x64756c69), 
  ACE_NTOHL (0x6e672f53), 
  ACE_NTOHL (0x63686564), 
  ACE_NTOHL (0x756c6572), 
  ACE_NTOHL (0x3a312e30), 
  ACE_NTOHL (0x0),  // repository ID = IDL:EDF_Scheduling/Scheduler:1.0
    10,
  ACE_NTOHL (0x53636865), 
  ACE_NTOHL (0x64756c65), 
  ACE_NTOHL (0x72000000),  // name = Scheduler
  };

static CORBA::TypeCode _tc_TAO_tc_EDF_Scheduling_Scheduler (
    CORBA::tk_objref,
    sizeof (_oc_EDF_Scheduling_Scheduler),
    (char *) &_oc_EDF_Scheduling_Scheduler,
    0,
    sizeof (EDF_Scheduling::Scheduler)
  );

namespace EDF_Scheduling
{
  ::CORBA::TypeCode_ptr _tc_Scheduler =
    &_tc_TAO_tc_EDF_Scheduling_Scheduler;
}

// TAO_IDL - Generated from 
// be/be_visitor_structure/any_op_cs.cpp:54

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

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

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

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

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

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Impl_T<EDF_Scheduling::SchedulingParameterPolicy>::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<EDF_Scheduling::SchedulingParameterPolicy>::marshal_value (TAO_OutputCDR &)
{
  return 0;
}

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

// Copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    EDF_Scheduling::SchedulingParameterPolicy_ptr _tao_elem
  )
{
  EDF_Scheduling::SchedulingParameterPolicy_ptr _tao_objptr =
    EDF_Scheduling::SchedulingParameterPolicy::_duplicate (_tao_elem);
  _tao_any <<= &_tao_objptr;
}

// Non-copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    EDF_Scheduling::SchedulingParameterPolicy_ptr *_tao_elem
  )
{
  TAO::Any_Impl_T<EDF_Scheduling::SchedulingParameterPolicy>::insert (
      _tao_any,
      EDF_Scheduling::SchedulingParameterPolicy::_tao_any_destructor,
      EDF_Scheduling::_tc_SchedulingParameterPolicy,
      *_tao_elem
    );
}

CORBA::Boolean
operator>>= (
    const CORBA::Any &_tao_any,
    EDF_Scheduling::SchedulingParameterPolicy_ptr &_tao_elem
  )
{
  return
    TAO::Any_Impl_T<EDF_Scheduling::SchedulingParameterPolicy>::extract (
        _tao_any,
        EDF_Scheduling::SchedulingParameterPolicy::_tao_any_destructor,
        EDF_Scheduling::_tc_SchedulingParameterPolicy,
        _tao_elem
      );
}

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

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Impl_T<EDF_Scheduling::Scheduler>::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<EDF_Scheduling::Scheduler>::marshal_value (TAO_OutputCDR &)
{
  return 0;
}

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

// Copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    EDF_Scheduling::Scheduler_ptr _tao_elem
  )
{
  EDF_Scheduling::Scheduler_ptr _tao_objptr =
    EDF_Scheduling::Scheduler::_duplicate (_tao_elem);
  _tao_any <<= &_tao_objptr;
}

// Non-copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    EDF_Scheduling::Scheduler_ptr *_tao_elem
  )
{
  TAO::Any_Impl_T<EDF_Scheduling::Scheduler>::insert (
      _tao_any,
      EDF_Scheduling::Scheduler::_tao_any_destructor,
      EDF_Scheduling::_tc_Scheduler,
      *_tao_elem
    );
}

CORBA::Boolean
operator>>= (
    const CORBA::Any &_tao_any,
    EDF_Scheduling::Scheduler_ptr &_tao_elem
  )
{
  return
    TAO::Any_Impl_T<EDF_Scheduling::Scheduler>::extract (
        _tao_any,
        EDF_Scheduling::Scheduler::_tao_any_destructor,
        EDF_Scheduling::_tc_Scheduler,
        _tao_elem
      );
}

