// -*- 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 "Null_MediaCtrlC.h"
#include "tao/CDR.h"
#include "tao/Object_T.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 "Null_MediaCtrlC.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 Null_MediaCtrl.

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
Null_MediaCtrl_ptr
TAO::Objref_Traits<Null_MediaCtrl>::tao_duplicate (
    Null_MediaCtrl_ptr p
  )
{
  return Null_MediaCtrl::_duplicate (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
void
TAO::Objref_Traits<Null_MediaCtrl>::tao_release (
    Null_MediaCtrl_ptr p
  )
{
  CORBA::release (p);
}

ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION
Null_MediaCtrl_ptr
TAO::Objref_Traits<Null_MediaCtrl>::tao_nil (void)
{
  return Null_MediaCtrl::_nil ();
}

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

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

Null_MediaCtrl::Null_MediaCtrl (void)
 : the_TAO_Null_MediaCtrl_Proxy_Broker_ (0)
{
  this->Null_MediaCtrl_setup_collocation ();
}

void
Null_MediaCtrl::Null_MediaCtrl_setup_collocation ()
{
  if (::_TAO_Null_MediaCtrl_Proxy_Broker_Factory_function_pointer)
    {
      this->the_TAO_Null_MediaCtrl_Proxy_Broker_ =
        ::_TAO_Null_MediaCtrl_Proxy_Broker_Factory_function_pointer (this);
    }
}

Null_MediaCtrl::~Null_MediaCtrl (void)
{}

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

Null_MediaCtrl_ptr
Null_MediaCtrl::_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL
  )
{
  return
    TAO::Narrow_Utils<Null_MediaCtrl>::narrow (
        _tao_objref,
        "IDL:Null_MediaCtrl:1.0",
        _TAO_Null_MediaCtrl_Proxy_Broker_Factory_function_pointer
        ACE_ENV_ARG_PARAMETER
      );
}

Null_MediaCtrl_ptr
Null_MediaCtrl::_unchecked_narrow (
    CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL
  )
{
  return
    TAO::Narrow_Utils<Null_MediaCtrl>::unchecked_narrow (
        _tao_objref,
        "IDL:Null_MediaCtrl:1.0",
        _TAO_Null_MediaCtrl_Proxy_Broker_Factory_function_pointer
        ACE_ENV_ARG_PARAMETER
      );
}

Null_MediaCtrl_ptr
Null_MediaCtrl::_duplicate (Null_MediaCtrl_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  
  return obj;
}

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

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

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

static const CORBA::Long _oc_Null_MediaCtrl[] =
{
    TAO_ENCAP_BYTE_ORDER, // byte order
  23,
  ACE_NTOHL (0x49444c3a), 
  ACE_NTOHL (0x4e756c6c), 
  ACE_NTOHL (0x5f4d6564), 
  ACE_NTOHL (0x69614374), 
  ACE_NTOHL (0x726c3a31), 
  ACE_NTOHL (0x2e300000),  // repository ID = IDL:Null_MediaCtrl:1.0
    15,
  ACE_NTOHL (0x4e756c6c), 
  ACE_NTOHL (0x5f4d6564), 
  ACE_NTOHL (0x69614374), 
  ACE_NTOHL (0x726c0000),  // name = Null_MediaCtrl
  };

static CORBA::TypeCode _tc_TAO_tc_Null_MediaCtrl (
    CORBA::tk_objref,
    sizeof (_oc_Null_MediaCtrl),
    (char *) &_oc_Null_MediaCtrl,
    0,
    sizeof (Null_MediaCtrl)
  );

::CORBA::TypeCode_ptr _tc_Null_MediaCtrl =
  &_tc_TAO_tc_Null_MediaCtrl;

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

ACE_TEMPLATE_SPECIALIZATION
CORBA::Boolean
TAO::Any_Impl_T<Null_MediaCtrl>::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,
    Null_MediaCtrl_ptr _tao_elem
  )
{
  Null_MediaCtrl_ptr _tao_objptr =
    Null_MediaCtrl::_duplicate (_tao_elem);
  _tao_any <<= &_tao_objptr;
}

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

CORBA::Boolean
operator>>= (
    const CORBA::Any &_tao_any,
    Null_MediaCtrl_ptr &_tao_elem
  )
{
  return
    TAO::Any_Impl_T<Null_MediaCtrl>::extract (
        _tao_any,
        Null_MediaCtrl::_tao_any_destructor,
        _tc_Null_MediaCtrl,
        _tao_elem
      );
}

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

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

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

