// -*- C++ -*-
/**
 * Code generated by the The ACE ORB (TAO) IDL Compiler v2.4.3
 * 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
 * and
 *       Institute for Software Integrated Systems
 *       Vanderbilt University
 *       Nashville, TN
 *       USA
 *       http://www.isis.vanderbilt.edu/
 *
 * Information about TAO is available at:
 *     http://www.dre.vanderbilt.edu/~schmidt/TAO.html
 **/

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


#include "testMasterCompC.h"
#include "tao/AnyTypeCode/Null_RefCount_Policy.h"
#include "tao/AnyTypeCode/TypeCode_Constants.h"
#include "tao/AnyTypeCode/Alias_TypeCode_Static.h"
#include "tao/AnyTypeCode/Objref_TypeCode_Static.h"
#include "tao/CDR.h"
#include "tao/Object_T.h"
#include "tao/CDR.h"
#include "tao/AnyTypeCode/Any.h"
#include "tao/AnyTypeCode/Any_Impl_T.h"
#include "ace/OS_NS_string.h"

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

// TAO_IDL - Generated from
// be/be_visitor_interface/interface_cs.cpp:48
TAO_BEGIN_VERSIONED_NAMESPACE_DECL

// Traits specializations for test::testMasterComp.

test::testMasterComp_ptr
TAO::Objref_Traits<test::testMasterComp>::duplicate (
    test::testMasterComp_ptr p)
{
  return test::testMasterComp::_duplicate (p);
}

void
TAO::Objref_Traits<test::testMasterComp>::release (
    test::testMasterComp_ptr p)
{
  ::CORBA::release (p);
}

test::testMasterComp_ptr
TAO::Objref_Traits<test::testMasterComp>::nil (void)
{
  return test::testMasterComp::_nil ();
}

::CORBA::Boolean
TAO::Objref_Traits<test::testMasterComp>::marshal (
    const test::testMasterComp_ptr p,
    TAO_OutputCDR & cdr)
{
  return ::CORBA::Object::marshal (p, cdr);
}

TAO_END_VERSIONED_NAMESPACE_DECL



test::testMasterComp::testMasterComp (void)
{
}

test::testMasterComp::~testMasterComp (void)
{
}

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

test::testMasterComp_ptr
test::testMasterComp::_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<testMasterComp>::narrow (
        _tao_objref,
        "IDL:astri/test/testMasterComp:1.0");
}

test::testMasterComp_ptr
test::testMasterComp::_unchecked_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<testMasterComp>::unchecked_narrow (
        _tao_objref);
}

test::testMasterComp_ptr
test::testMasterComp::_nil (void)
{
  return 0;
}

test::testMasterComp_ptr
test::testMasterComp::_duplicate (testMasterComp_ptr obj)
{
  if (! ::CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  return obj;
}

void
test::testMasterComp::_tao_release (testMasterComp_ptr obj)
{
  ::CORBA::release (obj);
}

::CORBA::Boolean
test::testMasterComp::_is_a (const char *value)
{
  if (
      ACE_OS::strcmp (
          value,
          "IDL:alma/ACS/ACSComponent:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:alma/ACS/CharacteristicModel:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:alma/ACS/CharacteristicComponent:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:alma/ACS/MasterComponentReadOnly:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:alma/ACS/MasterComponent:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:astri/test/testMasterComp:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:omg.org/CORBA/Object:1.0"
        ) == 0
    )
    {
      return true; // success using local knowledge
    }
  else
    {
      return this->::CORBA::Object::_is_a (value);
    }
}

const char* test::testMasterComp::_interface_repository_id (void) const
{
  return "IDL:astri/test/testMasterComp:1.0";
}

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

// TAO_IDL - Generated from
// be/be_visitor_typecode/objref_typecode.cpp:70

static TAO::TypeCode::Objref<char const *,
                             TAO::Null_RefCount_Policy>
  _tao_tc_test_testMasterComp (
    ::CORBA::tk_objref,
    "IDL:astri/test/testMasterComp:1.0",
    "testMasterComp");
  

namespace test
{
  ::CORBA::TypeCode_ptr const _tc_testMasterComp =
    &_tao_tc_test_testMasterComp;
}

// TAO_IDL - Generated from
// be/be_visitor_interface/any_op_cs.cpp:38
TAO_BEGIN_VERSIONED_NAMESPACE_DECL



namespace TAO
{
  template<>
  ::CORBA::Boolean
  Any_Impl_T<test::testMasterComp>::to_object (
      ::CORBA::Object_ptr &_tao_elem) const
  {
    _tao_elem = ::CORBA::Object::_duplicate (this->value_);
    return true;
  }
}
TAO_END_VERSIONED_NAMESPACE_DECL



#if defined (ACE_ANY_OPS_USE_NAMESPACE)

namespace test
{
  

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

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      testMasterComp_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<testMasterComp>::extract (
          _tao_any,
          testMasterComp::_tao_any_destructor,
          _tc_testMasterComp,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



/// Copying insertion.
void
operator<<= (
    ::CORBA::Any &_tao_any,
    test::testMasterComp_ptr _tao_elem)
{
  test::testMasterComp_ptr _tao_objptr =
    test::testMasterComp::_duplicate (_tao_elem);
  _tao_any <<= &_tao_objptr;
}

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    test::testMasterComp_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<test::testMasterComp>::extract (
        _tao_any,
        test::testMasterComp::_tao_any_destructor,
        test::_tc_testMasterComp,
        _tao_elem);
}

TAO_END_VERSIONED_NAMESPACE_DECL



#endif

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

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

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

::CORBA::Boolean operator>> (
    TAO_InputCDR &strm,
    test::testMasterComp_ptr &_tao_objref)
{
  ::CORBA::Object_var obj;

  if (!(strm >> obj.inout ()))
    {
      return false;
    }
  
  typedef ::test::testMasterComp RHS_SCOPED_NAME;

  // Narrow to the right type.
  _tao_objref =
    TAO::Narrow_Utils<RHS_SCOPED_NAME>::unchecked_narrow (obj.in ());
    
  return true;
}

TAO_END_VERSIONED_NAMESPACE_DECL



