// -*- 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 "TimeServiceC.h"
#include "tao/CDR.h"
#include "tao/Exception_Data.h"
#include "tao/Invocation_Adapter.h"
#include "tao/Object_T.h"
#include "tao/Typecode.h"
#include "tao/Any_Impl_T.h"
#include "tao/Any_Dual_Impl_T.h"
#include "tao/Any_Basic_Impl_T.h"
#include "tao/Basic_Arguments.h"
#include "tao/Fixed_Size_Argument_T.h"
#include "tao/Object_Argument_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 "TimeServiceC.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_arg_traits.cpp:618

#if !defined (_TIMEBASE_UTCT__ARG_TRAITS_CS_)
#define _TIMEBASE_UTCT__ARG_TRAITS_CS_
  
  ACE_TEMPLATE_SPECIALIZATION
  class TAO_Time_Export Arg_Traits<TimeBase::UtcT>
    : public
        Fixed_Size_Arg_Traits_T<
            TimeBase::UtcT
          >
  {
  };

#endif /* end #if !defined */
  
  // TAO_IDL - Generated from
  // be/be_visitor_arg_traits.cpp:618

#if !defined (_TIMEBASE_INTERVALT__ARG_TRAITS_CS_)
#define _TIMEBASE_INTERVALT__ARG_TRAITS_CS_
  
  ACE_TEMPLATE_SPECIALIZATION
  class TAO_Time_Export Arg_Traits<TimeBase::IntervalT>
    : public
        Fixed_Size_Arg_Traits_T<
            TimeBase::IntervalT
          >
  {
  };

#endif /* end #if !defined */
  
  // TAO_IDL - Generated from
  // be/be_visitor_arg_traits.cpp:537

#if !defined (_COSTIME_TIMECOMPARISON__ARG_TRAITS_CS_)
#define _COSTIME_TIMECOMPARISON__ARG_TRAITS_CS_
  
  ACE_TEMPLATE_SPECIALIZATION
  class TAO_Time_Export Arg_Traits<CosTime::TimeComparison>
    : public
        Basic_Arg_Traits_T<
            CosTime::TimeComparison
          >
  {
  };

#endif /* end #if !defined */
  
  // TAO_IDL - Generated from
  // be/be_visitor_arg_traits.cpp:537

#if !defined (_COSTIME_COMPARISONTYPE__ARG_TRAITS_CS_)
#define _COSTIME_COMPARISONTYPE__ARG_TRAITS_CS_
  
  ACE_TEMPLATE_SPECIALIZATION
  class TAO_Time_Export Arg_Traits<CosTime::ComparisonType>
    : public
        Basic_Arg_Traits_T<
            CosTime::ComparisonType
          >
  {
  };

#endif /* end #if !defined */
  
  // TAO_IDL - Generated from
  // be/be_visitor_arg_traits.cpp:537

#if !defined (_COSTIME_OVERLAPTYPE__ARG_TRAITS_CS_)
#define _COSTIME_OVERLAPTYPE__ARG_TRAITS_CS_
  
  ACE_TEMPLATE_SPECIALIZATION
  class TAO_Time_Export Arg_Traits<CosTime::OverlapType>
    : public
        Basic_Arg_Traits_T<
            CosTime::OverlapType
          >
  {
  };

#endif /* end #if !defined */

#if !defined (_COSTIME_TIO__ARG_TRAITS_CS_)
#define _COSTIME_TIO__ARG_TRAITS_CS_
  
  ACE_TEMPLATE_SPECIALIZATION
  class TAO_Time_Export Arg_Traits<CosTime::TIO>
    : public
        Object_Arg_Traits_T<
            CosTime::TIO_ptr,
            CosTime::TIO_var,
            CosTime::TIO_out,
            TAO::Objref_Traits<CosTime::TIO>
          >
  {
  };

#endif /* end #if !defined */

#if !defined (_COSTIME_UTO__ARG_TRAITS_CS_)
#define _COSTIME_UTO__ARG_TRAITS_CS_
  
  ACE_TEMPLATE_SPECIALIZATION
  class TAO_Time_Export Arg_Traits<CosTime::UTO>
    : public
        Object_Arg_Traits_T<
            CosTime::UTO_ptr,
            CosTime::UTO_var,
            CosTime::UTO_out,
            TAO::Objref_Traits<CosTime::UTO>
          >
  {
  };

#endif /* end #if !defined */
}


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

static const CORBA::Long _oc_CosTime_TimeComparison[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  39,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x6f6d672e), 
  ACE_NTOHL (0x6f72672f), 
  ACE_NTOHL (0x436f7354), 
  ACE_NTOHL (0x696d652f), 
  ACE_NTOHL (0x54696d65), 
  ACE_NTOHL (0x436f6d70), 
  ACE_NTOHL (0x61726973), 
  ACE_NTOHL (0x6f6e3a31), 
  ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/CosTime/TimeComparison:1.0
  15,
  ACE_NTOHL (0x54696d65), 
  ACE_NTOHL (0x436f6d70), 
  ACE_NTOHL (0x61726973), 
  ACE_NTOHL (0x6f6e0000),  // name = TimeComparison
  4, // member count
  10,
  ACE_NTOHL (0x54434571), 
  ACE_NTOHL (0x75616c54), 
  ACE_NTOHL (0x6f000000),  // name = TCEqualTo
  11,
  ACE_NTOHL (0x54434c65), 
  ACE_NTOHL (0x73735468), 
  ACE_NTOHL (0x616e0000),  // name = TCLessThan
  14,
  ACE_NTOHL (0x54434772), 
  ACE_NTOHL (0x65617465), 
  ACE_NTOHL (0x72546861), 
  ACE_NTOHL (0x6e000000),  // name = TCGreaterThan
  16,
  ACE_NTOHL (0x5443496e), 
  ACE_NTOHL (0x64657465), 
  ACE_NTOHL (0x726d696e), 
  ACE_NTOHL (0x61746500),  // name = TCIndeterminate
  };

static CORBA::TypeCode _tc_TAO_tc_CosTime_TimeComparison (
    CORBA::tk_enum,
    sizeof (_oc_CosTime_TimeComparison),
    (char *) &_oc_CosTime_TimeComparison,
    0,
    sizeof (CosTime::TimeComparison)
  );

namespace CosTime
{
  ::CORBA::TypeCode_ptr _tc_TimeComparison =
    &_tc_TAO_tc_CosTime_TimeComparison;
}

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

static const CORBA::Long _oc_CosTime_ComparisonType[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  39,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x6f6d672e), 
  ACE_NTOHL (0x6f72672f), 
  ACE_NTOHL (0x436f7354), 
  ACE_NTOHL (0x696d652f), 
  ACE_NTOHL (0x436f6d70), 
  ACE_NTOHL (0x61726973), 
  ACE_NTOHL (0x6f6e5479), 
  ACE_NTOHL (0x70653a31), 
  ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/CosTime/ComparisonType:1.0
  15,
  ACE_NTOHL (0x436f6d70), 
  ACE_NTOHL (0x61726973), 
  ACE_NTOHL (0x6f6e5479), 
  ACE_NTOHL (0x70650000),  // name = ComparisonType
  2, // member count
  10,
  ACE_NTOHL (0x496e7465), 
  ACE_NTOHL (0x7276616c), 
  ACE_NTOHL (0x43000000),  // name = IntervalC
  5,
  ACE_NTOHL (0x4d696443), 
  ACE_NTOHL (0x0),  // name = MidC
  };

static CORBA::TypeCode _tc_TAO_tc_CosTime_ComparisonType (
    CORBA::tk_enum,
    sizeof (_oc_CosTime_ComparisonType),
    (char *) &_oc_CosTime_ComparisonType,
    0,
    sizeof (CosTime::ComparisonType)
  );

namespace CosTime
{
  ::CORBA::TypeCode_ptr _tc_ComparisonType =
    &_tc_TAO_tc_CosTime_ComparisonType;
}

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

static const CORBA::Long _oc_CosTime_OverlapType[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  36,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x6f6d672e), 
  ACE_NTOHL (0x6f72672f), 
  ACE_NTOHL (0x436f7354), 
  ACE_NTOHL (0x696d652f), 
  ACE_NTOHL (0x4f766572), 
  ACE_NTOHL (0x6c617054), 
  ACE_NTOHL (0x7970653a), 
  ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosTime/OverlapType:1.0
  12,
  ACE_NTOHL (0x4f766572), 
  ACE_NTOHL (0x6c617054), 
  ACE_NTOHL (0x79706500),  // name = OverlapType
  4, // member count
  12,
  ACE_NTOHL (0x4f54436f), 
  ACE_NTOHL (0x6e746169), 
  ACE_NTOHL (0x6e657200),  // name = OTContainer
  12,
  ACE_NTOHL (0x4f54436f), 
  ACE_NTOHL (0x6e746169), 
  ACE_NTOHL (0x6e656400),  // name = OTContained
  10,
  ACE_NTOHL (0x4f544f76), 
  ACE_NTOHL (0x65726c61), 
  ACE_NTOHL (0x70000000),  // name = OTOverlap
  12,
  ACE_NTOHL (0x4f544e6f), 
  ACE_NTOHL (0x4f766572), 
  ACE_NTOHL (0x6c617000),  // name = OTNoOverlap
  };

static CORBA::TypeCode _tc_TAO_tc_CosTime_OverlapType (
    CORBA::tk_enum,
    sizeof (_oc_CosTime_OverlapType),
    (char *) &_oc_CosTime_OverlapType,
    0,
    sizeof (CosTime::OverlapType)
  );

namespace CosTime
{
  ::CORBA::TypeCode_ptr _tc_OverlapType =
    &_tc_TAO_tc_CosTime_OverlapType;
}

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

CosTime::TimeUnavailable::TimeUnavailable (void)
  : CORBA::UserException (
        "IDL:omg.org/CosTime/TimeUnavailable:1.0",
        "TimeUnavailable"
      )
{
}

CosTime::TimeUnavailable::~TimeUnavailable (void)
{
}

CosTime::TimeUnavailable::TimeUnavailable (const ::CosTime::TimeUnavailable &_tao_excp)
  : CORBA::UserException (
        _tao_excp._rep_id (),
        _tao_excp._name ()
      )
{
}

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

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

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

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

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

void CosTime::TimeUnavailable::_raise (void) const
{
  TAO_RAISE (*this);
}

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

void CosTime::TimeUnavailable::_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 CosTime::TimeUnavailable::_type (void) const
{
  return ::CosTime::_tc_TimeUnavailable;
}

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

static const CORBA::Long _oc_CosTime_TimeUnavailable[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  40,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x6f6d672e), 
  ACE_NTOHL (0x6f72672f), 
  ACE_NTOHL (0x436f7354), 
  ACE_NTOHL (0x696d652f), 
  ACE_NTOHL (0x54696d65), 
  ACE_NTOHL (0x556e6176), 
  ACE_NTOHL (0x61696c61), 
  ACE_NTOHL (0x626c653a), 
  ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosTime/TimeUnavailable:1.0
    16,
  ACE_NTOHL (0x54696d65), 
  ACE_NTOHL (0x556e6176), 
  ACE_NTOHL (0x61696c61), 
  ACE_NTOHL (0x626c6500),  // name = TimeUnavailable
  0, // member count
  };

static CORBA::TypeCode _tc_TAO_tc_CosTime_TimeUnavailable (
    CORBA::tk_except,
    sizeof (_oc_CosTime_TimeUnavailable),
    (char *) &_oc_CosTime_TimeUnavailable,
    0,
    sizeof (CosTime::TimeUnavailable)
  );

namespace CosTime
{
  ::CORBA::TypeCode_ptr _tc_TimeUnavailable =
    &_tc_TAO_tc_CosTime_TimeUnavailable;
}

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

// Traits specializations for CosTime::UTO.

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CosTime::UTO_ptr
TAO::Objref_Traits<CosTime::UTO>::tao_duplicate (
    CosTime::UTO_ptr p
  )
{
  return CosTime::UTO::_duplicate (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
void
TAO::Objref_Traits<CosTime::UTO>::tao_release (
    CosTime::UTO_ptr p
  )
{
  CORBA::release (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CosTime::UTO_ptr
TAO::Objref_Traits<CosTime::UTO>::tao_nil (void)
{
  return CosTime::UTO::_nil ();
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CORBA::Boolean
TAO::Objref_Traits<CosTime::UTO>::tao_marshal (
    CosTime::UTO_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return CORBA::Object::marshal (p, cdr);
}

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

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

TimeBase::TimeT CosTime::UTO::time (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_UTO_Proxy_Broker_ == 0)
    {
      CosTime_UTO_setup_collocation ();
    }
  
  TAO::Arg_Traits< TimeBase::TimeT>::ret_val _tao_retval;
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "_get_time",
      9,
      this->the_TAO_UTO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

TimeBase::InaccuracyT CosTime::UTO::inaccuracy (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_UTO_Proxy_Broker_ == 0)
    {
      CosTime_UTO_setup_collocation ();
    }
  
  TAO::Arg_Traits< TimeBase::InaccuracyT>::ret_val _tao_retval;
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "_get_inaccuracy",
      15,
      this->the_TAO_UTO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

TimeBase::TdfT CosTime::UTO::tdf (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_UTO_Proxy_Broker_ == 0)
    {
      CosTime_UTO_setup_collocation ();
    }
  
  TAO::Arg_Traits< TimeBase::TdfT>::ret_val _tao_retval;
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "_get_tdf",
      8,
      this->the_TAO_UTO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::TimeBase::UtcT CosTime::UTO::utc_time (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_UTO_Proxy_Broker_ == 0)
    {
      CosTime_UTO_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::TimeBase::UtcT>::ret_val _tao_retval;
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "_get_utc_time",
      13,
      this->the_TAO_UTO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::UTO_ptr CosTime::UTO::absolute_time (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_UTO_Proxy_Broker_ == 0)
    {
      CosTime_UTO_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::UTO>::ret_val _tao_retval;
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "absolute_time",
      13,
      this->the_TAO_UTO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::TimeComparison CosTime::UTO::compare_time (
    ::CosTime::ComparisonType comparison_type,
    ::CosTime::UTO_ptr otu
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_UTO_Proxy_Broker_ == 0)
    {
      CosTime_UTO_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::TimeComparison>::ret_val _tao_retval;
  TAO::Arg_Traits< ::CosTime::ComparisonType>::in_arg_val _tao_comparison_type (comparison_type);
  TAO::Arg_Traits< ::CosTime::UTO>::in_arg_val _tao_otu (otu);
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval,
      &_tao_comparison_type,
      &_tao_otu
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      3,
      "compare_time",
      12,
      this->the_TAO_UTO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::TIO_ptr CosTime::UTO::time_to_interval (
    ::CosTime::UTO_ptr otu
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_UTO_Proxy_Broker_ == 0)
    {
      CosTime_UTO_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::TIO>::ret_val _tao_retval;
  TAO::Arg_Traits< ::CosTime::UTO>::in_arg_val _tao_otu (otu);
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval,
      &_tao_otu
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "time_to_interval",
      16,
      this->the_TAO_UTO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::TIO_ptr CosTime::UTO::interval (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_UTO_Proxy_Broker_ == 0)
    {
      CosTime_UTO_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::TIO>::ret_val _tao_retval;
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "interval",
      8,
      this->the_TAO_UTO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

CosTime::UTO::UTO (void)
 : the_TAO_UTO_Proxy_Broker_ (0)
{
  this->CosTime_UTO_setup_collocation ();
}

void
CosTime::UTO::CosTime_UTO_setup_collocation ()
{
  if (::CosTime__TAO_UTO_Proxy_Broker_Factory_function_pointer)
    {
      this->the_TAO_UTO_Proxy_Broker_ =
        ::CosTime__TAO_UTO_Proxy_Broker_Factory_function_pointer (this);
    }
}

CosTime::UTO::~UTO (void)
{}

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

CosTime::UTO_ptr
CosTime::UTO::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL
  )
{
  return
    TAO::Narrow_Utils<UTO>::narrow (
        _tao_objref,
        "IDL:omg.org/CosTime/UTO:1.0",
        CosTime__TAO_UTO_Proxy_Broker_Factory_function_pointer
        ACE_ENV_ARG_PARAMETER
      );
}

CosTime::UTO_ptr
CosTime::UTO::_unchecked_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL
  )
{
  return
    TAO::Narrow_Utils<UTO>::unchecked_narrow (
        _tao_objref,
        "IDL:omg.org/CosTime/UTO:1.0",
        CosTime__TAO_UTO_Proxy_Broker_Factory_function_pointer
        ACE_ENV_ARG_PARAMETER
      );
}

CosTime::UTO_ptr
CosTime::UTO::_duplicate (UTO_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  
  return obj;
}

CORBA::Boolean
CosTime::UTO::_is_a (
    const char *value
    ACE_ENV_ARG_DECL
  )
{
  if (
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CosTime/UTO:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/Object:1.0"
        )
     )
    {
      return 1; // success using local knowledge
    }
  else
    {
      return this->ACE_NESTED_CLASS (CORBA, Object)::_is_a (
          value
          ACE_ENV_ARG_PARAMETER
        );
    }
}

const char* CosTime::UTO::_interface_repository_id (void) const
{
  return "IDL:omg.org/CosTime/UTO:1.0";
}

CORBA::Boolean
CosTime::UTO::marshal (TAO_OutputCDR &cdr)
{
  return (cdr << this);
}

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

static const CORBA::Long _oc_CosTime_UTO[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  28,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x6f6d672e), 
  ACE_NTOHL (0x6f72672f), 
  ACE_NTOHL (0x436f7354), 
  ACE_NTOHL (0x696d652f), 
  ACE_NTOHL (0x55544f3a), 
  ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosTime/UTO:1.0
    4,
  ACE_NTOHL (0x55544f00),  // name = UTO
  };

static CORBA::TypeCode _tc_TAO_tc_CosTime_UTO (
    CORBA::tk_objref,
    sizeof (_oc_CosTime_UTO),
    (char *) &_oc_CosTime_UTO,
    0,
    sizeof (CosTime::UTO)
  );

namespace CosTime
{
  ::CORBA::TypeCode_ptr _tc_UTO =
    &_tc_TAO_tc_CosTime_UTO;
}

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

// Traits specializations for CosTime::TIO.

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CosTime::TIO_ptr
TAO::Objref_Traits<CosTime::TIO>::tao_duplicate (
    CosTime::TIO_ptr p
  )
{
  return CosTime::TIO::_duplicate (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
void
TAO::Objref_Traits<CosTime::TIO>::tao_release (
    CosTime::TIO_ptr p
  )
{
  CORBA::release (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CosTime::TIO_ptr
TAO::Objref_Traits<CosTime::TIO>::tao_nil (void)
{
  return CosTime::TIO::_nil ();
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CORBA::Boolean
TAO::Objref_Traits<CosTime::TIO>::tao_marshal (
    CosTime::TIO_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return CORBA::Object::marshal (p, cdr);
}

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

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::TimeBase::IntervalT CosTime::TIO::time_interval (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_TIO_Proxy_Broker_ == 0)
    {
      CosTime_TIO_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::TimeBase::IntervalT>::ret_val _tao_retval;
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "_get_time_interval",
      18,
      this->the_TAO_TIO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::OverlapType CosTime::TIO::spans (
    ::CosTime::UTO_ptr time,
    ::CosTime::TIO_out overlap
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_TIO_Proxy_Broker_ == 0)
    {
      CosTime_TIO_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::OverlapType>::ret_val _tao_retval;
  TAO::Arg_Traits< ::CosTime::UTO>::in_arg_val _tao_time (time);
  TAO::Arg_Traits< ::CosTime::TIO>::out_arg_val _tao_overlap (overlap);
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval,
      &_tao_time,
      &_tao_overlap
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      3,
      "spans",
      5,
      this->the_TAO_TIO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::OverlapType CosTime::TIO::overlaps (
    ::CosTime::TIO_ptr interval,
    ::CosTime::TIO_out overlap
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_TIO_Proxy_Broker_ == 0)
    {
      CosTime_TIO_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::OverlapType>::ret_val _tao_retval;
  TAO::Arg_Traits< ::CosTime::TIO>::in_arg_val _tao_interval (interval);
  TAO::Arg_Traits< ::CosTime::TIO>::out_arg_val _tao_overlap (overlap);
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval,
      &_tao_interval,
      &_tao_overlap
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      3,
      "overlaps",
      8,
      this->the_TAO_TIO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::UTO_ptr CosTime::TIO::time (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_TIO_Proxy_Broker_ == 0)
    {
      CosTime_TIO_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::UTO>::ret_val _tao_retval;
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "time",
      4,
      this->the_TAO_TIO_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

CosTime::TIO::TIO (void)
 : the_TAO_TIO_Proxy_Broker_ (0)
{
  this->CosTime_TIO_setup_collocation ();
}

void
CosTime::TIO::CosTime_TIO_setup_collocation ()
{
  if (::CosTime__TAO_TIO_Proxy_Broker_Factory_function_pointer)
    {
      this->the_TAO_TIO_Proxy_Broker_ =
        ::CosTime__TAO_TIO_Proxy_Broker_Factory_function_pointer (this);
    }
}

CosTime::TIO::~TIO (void)
{}

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

CosTime::TIO_ptr
CosTime::TIO::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL
  )
{
  return
    TAO::Narrow_Utils<TIO>::narrow (
        _tao_objref,
        "IDL:omg.org/CosTime/TIO:1.0",
        CosTime__TAO_TIO_Proxy_Broker_Factory_function_pointer
        ACE_ENV_ARG_PARAMETER
      );
}

CosTime::TIO_ptr
CosTime::TIO::_unchecked_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL
  )
{
  return
    TAO::Narrow_Utils<TIO>::unchecked_narrow (
        _tao_objref,
        "IDL:omg.org/CosTime/TIO:1.0",
        CosTime__TAO_TIO_Proxy_Broker_Factory_function_pointer
        ACE_ENV_ARG_PARAMETER
      );
}

CosTime::TIO_ptr
CosTime::TIO::_duplicate (TIO_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  
  return obj;
}

CORBA::Boolean
CosTime::TIO::_is_a (
    const char *value
    ACE_ENV_ARG_DECL
  )
{
  if (
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CosTime/TIO:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/Object:1.0"
        )
     )
    {
      return 1; // success using local knowledge
    }
  else
    {
      return this->ACE_NESTED_CLASS (CORBA, Object)::_is_a (
          value
          ACE_ENV_ARG_PARAMETER
        );
    }
}

const char* CosTime::TIO::_interface_repository_id (void) const
{
  return "IDL:omg.org/CosTime/TIO:1.0";
}

CORBA::Boolean
CosTime::TIO::marshal (TAO_OutputCDR &cdr)
{
  return (cdr << this);
}

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

static const CORBA::Long _oc_CosTime_TIO[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  28,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x6f6d672e), 
  ACE_NTOHL (0x6f72672f), 
  ACE_NTOHL (0x436f7354), 
  ACE_NTOHL (0x696d652f), 
  ACE_NTOHL (0x54494f3a), 
  ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosTime/TIO:1.0
    4,
  ACE_NTOHL (0x54494f00),  // name = TIO
  };

static CORBA::TypeCode _tc_TAO_tc_CosTime_TIO (
    CORBA::tk_objref,
    sizeof (_oc_CosTime_TIO),
    (char *) &_oc_CosTime_TIO,
    0,
    sizeof (CosTime::TIO)
  );

namespace CosTime
{
  ::CORBA::TypeCode_ptr _tc_TIO =
    &_tc_TAO_tc_CosTime_TIO;
}

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

// Traits specializations for CosTime::TimeService.

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CosTime::TimeService_ptr
TAO::Objref_Traits<CosTime::TimeService>::tao_duplicate (
    CosTime::TimeService_ptr p
  )
{
  return CosTime::TimeService::_duplicate (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
void
TAO::Objref_Traits<CosTime::TimeService>::tao_release (
    CosTime::TimeService_ptr p
  )
{
  CORBA::release (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CosTime::TimeService_ptr
TAO::Objref_Traits<CosTime::TimeService>::tao_nil (void)
{
  return CosTime::TimeService::_nil ();
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CORBA::Boolean
TAO::Objref_Traits<CosTime::TimeService>::tao_marshal (
    CosTime::TimeService_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return CORBA::Object::marshal (p, cdr);
}

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

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::UTO_ptr CosTime::TimeService::universal_time (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    ::CosTime::TimeUnavailable
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_TimeService_Proxy_Broker_ == 0)
    {
      CosTime_TimeService_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::UTO>::ret_val _tao_retval;
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };
  
  static TAO::Exception_Data
  _tao_CosTime_TimeService_universal_time_exceptiondata [] = 
    {
      {
        "IDL:omg.org/CosTime/TimeUnavailable:1.0",
        CosTime::TimeUnavailable::_alloc,
        CosTime::_tc_TimeUnavailable
      }
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "universal_time",
      14,
      this->the_TAO_TimeService_Proxy_Broker_
    );
  
  _tao_call.invoke (
      _tao_CosTime_TimeService_universal_time_exceptiondata,
      1
      ACE_ENV_ARG_PARAMETER
    );
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::UTO_ptr CosTime::TimeService::secure_universal_time (
    ACE_ENV_SINGLE_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    ::CosTime::TimeUnavailable
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_TimeService_Proxy_Broker_ == 0)
    {
      CosTime_TimeService_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::UTO>::ret_val _tao_retval;
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };
  
  static TAO::Exception_Data
  _tao_CosTime_TimeService_secure_universal_time_exceptiondata [] = 
    {
      {
        "IDL:omg.org/CosTime/TimeUnavailable:1.0",
        CosTime::TimeUnavailable::_alloc,
        CosTime::_tc_TimeUnavailable
      }
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "secure_universal_time",
      21,
      this->the_TAO_TimeService_Proxy_Broker_
    );
  
  _tao_call.invoke (
      _tao_CosTime_TimeService_secure_universal_time_exceptiondata,
      1
      ACE_ENV_ARG_PARAMETER
    );
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::UTO_ptr CosTime::TimeService::new_universal_time (
    ::TimeBase::TimeT time,
    ::TimeBase::InaccuracyT inaccuracy,
    ::TimeBase::TdfT tdf
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_TimeService_Proxy_Broker_ == 0)
    {
      CosTime_TimeService_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::UTO>::ret_val _tao_retval;
  TAO::Arg_Traits< TimeBase::TimeT>::in_arg_val _tao_time (time);
  TAO::Arg_Traits< TimeBase::InaccuracyT>::in_arg_val _tao_inaccuracy (inaccuracy);
  TAO::Arg_Traits< TimeBase::TdfT>::in_arg_val _tao_tdf (tdf);
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval,
      &_tao_time,
      &_tao_inaccuracy,
      &_tao_tdf
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      4,
      "new_universal_time",
      18,
      this->the_TAO_TimeService_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::UTO_ptr CosTime::TimeService::uto_from_utc (
    const ::TimeBase::UtcT & utc
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_TimeService_Proxy_Broker_ == 0)
    {
      CosTime_TimeService_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::UTO>::ret_val _tao_retval;
  TAO::Arg_Traits< ::TimeBase::UtcT>::in_arg_val _tao_utc (utc);
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval,
      &_tao_utc
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "uto_from_utc",
      12,
      this->the_TAO_TimeService_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/operation_cs.cpp:78

::CosTime::TIO_ptr CosTime::TimeService::new_interval (
    ::TimeBase::TimeT lower,
    ::TimeBase::TimeT upper
    ACE_ENV_ARG_DECL
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS (CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_TimeService_Proxy_Broker_ == 0)
    {
      CosTime_TimeService_setup_collocation ();
    }
  
  TAO::Arg_Traits< ::CosTime::TIO>::ret_val _tao_retval;
  TAO::Arg_Traits< TimeBase::TimeT>::in_arg_val _tao_lower (lower);
  TAO::Arg_Traits< TimeBase::TimeT>::in_arg_val _tao_upper (upper);
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval,
      &_tao_lower,
      &_tao_upper
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      3,
      "new_interval",
      12,
      this->the_TAO_TimeService_Proxy_Broker_
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK_RETURN (_tao_retval.excp ());
  
  return _tao_retval.retn ();
}

CosTime::TimeService::TimeService (void)
 : the_TAO_TimeService_Proxy_Broker_ (0)
{
  this->CosTime_TimeService_setup_collocation ();
}

void
CosTime::TimeService::CosTime_TimeService_setup_collocation ()
{
  if (::CosTime__TAO_TimeService_Proxy_Broker_Factory_function_pointer)
    {
      this->the_TAO_TimeService_Proxy_Broker_ =
        ::CosTime__TAO_TimeService_Proxy_Broker_Factory_function_pointer (this);
    }
}

CosTime::TimeService::~TimeService (void)
{}

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

CosTime::TimeService_ptr
CosTime::TimeService::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL
  )
{
  return
    TAO::Narrow_Utils<TimeService>::narrow (
        _tao_objref,
        "IDL:omg.org/CosTime/TimeService:1.0",
        CosTime__TAO_TimeService_Proxy_Broker_Factory_function_pointer
        ACE_ENV_ARG_PARAMETER
      );
}

CosTime::TimeService_ptr
CosTime::TimeService::_unchecked_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL
  )
{
  return
    TAO::Narrow_Utils<TimeService>::unchecked_narrow (
        _tao_objref,
        "IDL:omg.org/CosTime/TimeService:1.0",
        CosTime__TAO_TimeService_Proxy_Broker_Factory_function_pointer
        ACE_ENV_ARG_PARAMETER
      );
}

CosTime::TimeService_ptr
CosTime::TimeService::_duplicate (TimeService_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  
  return obj;
}

CORBA::Boolean
CosTime::TimeService::_is_a (
    const char *value
    ACE_ENV_ARG_DECL
  )
{
  if (
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CosTime/TimeService:1.0"
        ) ||
      !ACE_OS::strcmp (
          (char *)value,
          "IDL:omg.org/CORBA/Object:1.0"
        )
     )
    {
      return 1; // success using local knowledge
    }
  else
    {
      return this->ACE_NESTED_CLASS (CORBA, Object)::_is_a (
          value
          ACE_ENV_ARG_PARAMETER
        );
    }
}

const char* CosTime::TimeService::_interface_repository_id (void) const
{
  return "IDL:omg.org/CosTime/TimeService:1.0";
}

CORBA::Boolean
CosTime::TimeService::marshal (TAO_OutputCDR &cdr)
{
  return (cdr << this);
}

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

static const CORBA::Long _oc_CosTime_TimeService[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  36,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x6f6d672e), 
  ACE_NTOHL (0x6f72672f), 
  ACE_NTOHL (0x436f7354), 
  ACE_NTOHL (0x696d652f), 
  ACE_NTOHL (0x54696d65), 
  ACE_NTOHL (0x53657276), 
  ACE_NTOHL (0x6963653a), 
  ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosTime/TimeService:1.0
    12,
  ACE_NTOHL (0x54696d65), 
  ACE_NTOHL (0x53657276), 
  ACE_NTOHL (0x69636500),  // name = TimeService
  };

static CORBA::TypeCode _tc_TAO_tc_CosTime_TimeService (
    CORBA::tk_objref,
    sizeof (_oc_CosTime_TimeService),
    (char *) &_oc_CosTime_TimeService,
    0,
    sizeof (CosTime::TimeService)
  );

namespace CosTime
{
  ::CORBA::TypeCode_ptr _tc_TimeService =
    &_tc_TAO_tc_CosTime_TimeService;
}

// TAO_IDL - Generated from
// be/be_visitor_enum/any_op_cs.cpp:52

void operator<<= (
    CORBA::Any &_tao_any,
    CosTime::TimeComparison _tao_elem
  )
{
  TAO::Any_Basic_Impl_T<CosTime::TimeComparison>::insert (
      _tao_any,
      CosTime::_tc_TimeComparison,
      _tao_elem
    );
}

CORBA::Boolean operator>>= (
    const CORBA::Any &_tao_any,
    CosTime::TimeComparison &_tao_elem
  )
{
  return
    TAO::Any_Basic_Impl_T<CosTime::TimeComparison>::extract (
        _tao_any,
        CosTime::_tc_TimeComparison,
        _tao_elem 
      );
}

// TAO_IDL - Generated from
// be/be_visitor_enum/any_op_cs.cpp:52

void operator<<= (
    CORBA::Any &_tao_any,
    CosTime::ComparisonType _tao_elem
  )
{
  TAO::Any_Basic_Impl_T<CosTime::ComparisonType>::insert (
      _tao_any,
      CosTime::_tc_ComparisonType,
      _tao_elem
    );
}

CORBA::Boolean operator>>= (
    const CORBA::Any &_tao_any,
    CosTime::ComparisonType &_tao_elem
  )
{
  return
    TAO::Any_Basic_Impl_T<CosTime::ComparisonType>::extract (
        _tao_any,
        CosTime::_tc_ComparisonType,
        _tao_elem 
      );
}

// TAO_IDL - Generated from
// be/be_visitor_enum/any_op_cs.cpp:52

void operator<<= (
    CORBA::Any &_tao_any,
    CosTime::OverlapType _tao_elem
  )
{
  TAO::Any_Basic_Impl_T<CosTime::OverlapType>::insert (
      _tao_any,
      CosTime::_tc_OverlapType,
      _tao_elem
    );
}

CORBA::Boolean operator>>= (
    const CORBA::Any &_tao_any,
    CosTime::OverlapType &_tao_elem
  )
{
  return
    TAO::Any_Basic_Impl_T<CosTime::OverlapType>::extract (
        _tao_any,
        CosTime::_tc_OverlapType,
        _tao_elem 
      );
}

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

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Dual_Impl_T<CosTime::TimeUnavailable>::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 CosTime::TimeUnavailable &_tao_elem
  )
{
  TAO::Any_Dual_Impl_T<CosTime::TimeUnavailable>::insert_copy (
      _tao_any,
      CosTime::TimeUnavailable::_tao_any_destructor,
      CosTime::_tc_TimeUnavailable,
      _tao_elem
    );
}

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

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

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

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

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

// Copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    CosTime::UTO_ptr _tao_elem
  )
{
  CosTime::UTO_ptr _tao_objptr =
    CosTime::UTO::_duplicate (_tao_elem);
  _tao_any <<= &_tao_objptr;
}

// Non-copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    CosTime::UTO_ptr *_tao_elem
  )
{
  TAO::Any_Impl_T<CosTime::UTO>::insert (
      _tao_any,
      CosTime::UTO::_tao_any_destructor,
      CosTime::_tc_UTO,
      *_tao_elem
    );
}

CORBA::Boolean
operator>>= (
    const CORBA::Any &_tao_any,
    CosTime::UTO_ptr &_tao_elem
  )
{
  return
    TAO::Any_Impl_T<CosTime::UTO>::extract (
        _tao_any,
        CosTime::UTO::_tao_any_destructor,
        CosTime::_tc_UTO,
        _tao_elem
      );
}

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

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

// Copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    CosTime::TIO_ptr _tao_elem
  )
{
  CosTime::TIO_ptr _tao_objptr =
    CosTime::TIO::_duplicate (_tao_elem);
  _tao_any <<= &_tao_objptr;
}

// Non-copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    CosTime::TIO_ptr *_tao_elem
  )
{
  TAO::Any_Impl_T<CosTime::TIO>::insert (
      _tao_any,
      CosTime::TIO::_tao_any_destructor,
      CosTime::_tc_TIO,
      *_tao_elem
    );
}

CORBA::Boolean
operator>>= (
    const CORBA::Any &_tao_any,
    CosTime::TIO_ptr &_tao_elem
  )
{
  return
    TAO::Any_Impl_T<CosTime::TIO>::extract (
        _tao_any,
        CosTime::TIO::_tao_any_destructor,
        CosTime::_tc_TIO,
        _tao_elem
      );
}

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

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

// Copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    CosTime::TimeService_ptr _tao_elem
  )
{
  CosTime::TimeService_ptr _tao_objptr =
    CosTime::TimeService::_duplicate (_tao_elem);
  _tao_any <<= &_tao_objptr;
}

// Non-copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    CosTime::TimeService_ptr *_tao_elem
  )
{
  TAO::Any_Impl_T<CosTime::TimeService>::insert (
      _tao_any,
      CosTime::TimeService::_tao_any_destructor,
      CosTime::_tc_TimeService,
      *_tao_elem
    );
}

CORBA::Boolean
operator>>= (
    const CORBA::Any &_tao_any,
    CosTime::TimeService_ptr &_tao_elem
  )
{
  return
    TAO::Any_Impl_T<CosTime::TimeService>::extract (
        _tao_any,
        CosTime::TimeService::_tao_any_destructor,
        CosTime::_tc_TimeService,
        _tao_elem
      );
}

// TAO_IDL - Generated from
// be/be_visitor_enum/cdr_op_cs.cpp:51

CORBA::Boolean operator<< (TAO_OutputCDR &strm, const CosTime::TimeComparison &_tao_enumval)
{
  CORBA::ULong _tao_temp = _tao_enumval;
  return strm << _tao_temp;
}

CORBA::Boolean operator>> (TAO_InputCDR &strm, CosTime::TimeComparison &_tao_enumval)
{
  CORBA::ULong _tao_temp = 0;
  CORBA::Boolean _tao_result = strm >> _tao_temp;
  
  if (_tao_result == 1)
    {
      _tao_enumval = static_cast<CosTime::TimeComparison> (_tao_temp);
    }
  
  return _tao_result;
}

// TAO_IDL - Generated from
// be/be_visitor_enum/cdr_op_cs.cpp:51

CORBA::Boolean operator<< (TAO_OutputCDR &strm, const CosTime::ComparisonType &_tao_enumval)
{
  CORBA::ULong _tao_temp = _tao_enumval;
  return strm << _tao_temp;
}

CORBA::Boolean operator>> (TAO_InputCDR &strm, CosTime::ComparisonType &_tao_enumval)
{
  CORBA::ULong _tao_temp = 0;
  CORBA::Boolean _tao_result = strm >> _tao_temp;
  
  if (_tao_result == 1)
    {
      _tao_enumval = static_cast<CosTime::ComparisonType> (_tao_temp);
    }
  
  return _tao_result;
}

// TAO_IDL - Generated from
// be/be_visitor_enum/cdr_op_cs.cpp:51

CORBA::Boolean operator<< (TAO_OutputCDR &strm, const CosTime::OverlapType &_tao_enumval)
{
  CORBA::ULong _tao_temp = _tao_enumval;
  return strm << _tao_temp;
}

CORBA::Boolean operator>> (TAO_InputCDR &strm, CosTime::OverlapType &_tao_enumval)
{
  CORBA::ULong _tao_temp = 0;
  CORBA::Boolean _tao_result = strm >> _tao_temp;
  
  if (_tao_result == 1)
    {
      _tao_enumval = static_cast<CosTime::OverlapType> (_tao_temp);
    }
  
  return _tao_result;
}

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

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

CORBA::Boolean operator>> (
    TAO_InputCDR &,
    CosTime::TimeUnavailable&
  )
{
  return 1;
}

// TAO_IDL - Generated from
// be/be_visitor_interface/cdr_op_cs.cpp:63

CORBA::Boolean operator<< (
    TAO_OutputCDR &strm,
    const CosTime::UTO_ptr _tao_objref
  )
{
  CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

CORBA::Boolean operator>> (
    TAO_InputCDR &strm,
    CosTime::UTO_ptr &_tao_objref
  )
{
  CORBA::Object_var obj;
  
  if ((strm >> obj.inout ()) == 0)
    {
      return 0;
    }
  
  typedef ::CosTime::UTO RHS_SCOPED_NAME;
  
  // Narrow to the right type.
  _tao_objref =
    TAO::Narrow_Utils<RHS_SCOPED_NAME>::unchecked_narrow (
        obj.in (),
        CosTime__TAO_UTO_Proxy_Broker_Factory_function_pointer
      );
    
  return 1;
}

// TAO_IDL - Generated from
// be/be_visitor_interface/cdr_op_cs.cpp:63

CORBA::Boolean operator<< (
    TAO_OutputCDR &strm,
    const CosTime::TIO_ptr _tao_objref
  )
{
  CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

CORBA::Boolean operator>> (
    TAO_InputCDR &strm,
    CosTime::TIO_ptr &_tao_objref
  )
{
  CORBA::Object_var obj;
  
  if ((strm >> obj.inout ()) == 0)
    {
      return 0;
    }
  
  typedef ::CosTime::TIO RHS_SCOPED_NAME;
  
  // Narrow to the right type.
  _tao_objref =
    TAO::Narrow_Utils<RHS_SCOPED_NAME>::unchecked_narrow (
        obj.in (),
        CosTime__TAO_TIO_Proxy_Broker_Factory_function_pointer
      );
    
  return 1;
}

// TAO_IDL - Generated from
// be/be_visitor_interface/cdr_op_cs.cpp:63

CORBA::Boolean operator<< (
    TAO_OutputCDR &strm,
    const CosTime::TimeService_ptr _tao_objref
  )
{
  CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

CORBA::Boolean operator>> (
    TAO_InputCDR &strm,
    CosTime::TimeService_ptr &_tao_objref
  )
{
  CORBA::Object_var obj;
  
  if ((strm >> obj.inout ()) == 0)
    {
      return 0;
    }
  
  typedef ::CosTime::TimeService RHS_SCOPED_NAME;
  
  // Narrow to the right type.
  _tao_objref =
    TAO::Narrow_Utils<RHS_SCOPED_NAME>::unchecked_narrow (
        obj.in (),
        CosTime__TAO_TimeService_Proxy_Broker_Factory_function_pointer
      );
    
  return 1;
}

