// -*- 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 "SecurityLevel1C.h"
#include "tao/CDR.h"
#include "tao/Typecode.h"
#include "tao/Any_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 "SecurityLevel1C.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_interface/interface_cs.cpp:60

// Traits specializations for SecurityLevel1::Current.

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
SecurityLevel1::Current_ptr
TAO::Objref_Traits<SecurityLevel1::Current>::tao_duplicate (
    SecurityLevel1::Current_ptr p
  )
{
  return SecurityLevel1::Current::_duplicate (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
void
TAO::Objref_Traits<SecurityLevel1::Current>::tao_release (
    SecurityLevel1::Current_ptr p
  )
{
  CORBA::release (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
SecurityLevel1::Current_ptr
TAO::Objref_Traits<SecurityLevel1::Current>::tao_nil (void)
{
  return SecurityLevel1::Current::_nil ();
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
CORBA::Boolean
TAO::Objref_Traits<SecurityLevel1::Current>::tao_marshal (
    SecurityLevel1::Current_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return CORBA::Object::marshal (p, cdr);
}

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

SecurityLevel1::Current::Current (void)
{}

SecurityLevel1::Current::~Current (void)
{}

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

SecurityLevel1::Current_ptr
SecurityLevel1::Current::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (CORBA::is_nil (_tao_objref))
    {
      return Current::_nil ();
    }
  
  Current_ptr proxy =
    dynamic_cast<Current_ptr> (_tao_objref);
  
  return Current::_duplicate (proxy);
}

SecurityLevel1::Current_ptr
SecurityLevel1::Current::_unchecked_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL_NOT_USED
  )
{
  if (CORBA::is_nil (_tao_objref))
    {
      return Current::_nil ();
    }
  
  Current_ptr proxy =
    dynamic_cast<Current_ptr> (_tao_objref);
  
  return Current::_duplicate (proxy);
}

SecurityLevel1::Current_ptr
SecurityLevel1::Current::_duplicate (Current_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  
  return obj;
}

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

CORBA::Boolean
SecurityLevel1::Current::marshal (TAO_OutputCDR &)
{
  return 0;
}

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

static const CORBA::Long _oc_SecurityLevel1_Current[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  39,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x6f6d672e), 
  ACE_NTOHL (0x6f72672f), 
  ACE_NTOHL (0x53656375), 
  ACE_NTOHL (0x72697479), 
  ACE_NTOHL (0x4c657665), 
  ACE_NTOHL (0x6c312f43), 
  ACE_NTOHL (0x75727265), 
  ACE_NTOHL (0x6e743a31), 
  ACE_NTOHL (0x2e380000),  // repository ID = IDL:omg.org/SecurityLevel1/Current:1.8
    8,
  ACE_NTOHL (0x43757272), 
  ACE_NTOHL (0x656e7400),  // name = Current
  };

static CORBA::TypeCode _tc_TAO_tc_SecurityLevel1_Current (
    CORBA::tk_objref,
    sizeof (_oc_SecurityLevel1_Current),
    (char *) &_oc_SecurityLevel1_Current,
    0,
    sizeof (SecurityLevel1::Current)
  );

namespace SecurityLevel1
{
  ::CORBA::TypeCode_ptr _tc_Current =
    &_tc_TAO_tc_SecurityLevel1_Current;
}

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

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

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

// Copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    SecurityLevel1::Current_ptr _tao_elem
  )
{
  SecurityLevel1::Current_ptr _tao_objptr =
    SecurityLevel1::Current::_duplicate (_tao_elem);
  _tao_any <<= &_tao_objptr;
}

// Non-copying insertion.
void
operator<<= (
    CORBA::Any &_tao_any,
    SecurityLevel1::Current_ptr *_tao_elem
  )
{
  TAO::Any_Impl_T<SecurityLevel1::Current>::insert (
      _tao_any,
      SecurityLevel1::Current::_tao_any_destructor,
      SecurityLevel1::_tc_Current,
      *_tao_elem
    );
}

CORBA::Boolean
operator>>= (
    const CORBA::Any &_tao_any,
    SecurityLevel1::Current_ptr &_tao_elem
  )
{
  return
    TAO::Any_Impl_T<SecurityLevel1::Current>::extract (
        _tao_any,
        SecurityLevel1::Current::_tao_any_destructor,
        SecurityLevel1::_tc_Current,
        _tao_elem
      );
}

