// -*- 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 "testPingComp1C.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/AnyTypeCode/String_TypeCode_Static.h"
#include "tao/AnyTypeCode/Struct_TypeCode_Static.h"
#include "tao/AnyTypeCode/TypeCode_Struct_Field.h"
#include "tao/CDR.h"
#include "tao/Exception_Data.h"
#include "tao/Invocation_Adapter.h"
#include "tao/Object_T.h"
#include "tao/CDR.h"
#include "tao/AnyTypeCode/Any.h"
#include "tao/AnyTypeCode/Any_Impl_T.h"
#include "tao/AnyTypeCode/Any_Dual_Impl_T.h"
#include "ace/OS_NS_string.h"

#if !defined (__ACE_INLINE__)
#include "testPingComp1C.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::testPingComp1.

test::testPingComp1_ptr
TAO::Objref_Traits<test::testPingComp1>::duplicate (
    test::testPingComp1_ptr p)
{
  return test::testPingComp1::_duplicate (p);
}

void
TAO::Objref_Traits<test::testPingComp1>::release (
    test::testPingComp1_ptr p)
{
  ::CORBA::release (p);
}

test::testPingComp1_ptr
TAO::Objref_Traits<test::testPingComp1>::nil (void)
{
  return test::testPingComp1::_nil ();
}

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

TAO_END_VERSIONED_NAMESPACE_DECL



// TAO_IDL - Generated from
// be/be_visitor_constant/constant_cs.cpp:54

const char *const test::testPingComp1::CHANNELNAME_TEST = "testChannel";

// TAO_IDL - Generated from
// be/be_visitor_typecode/struct_typecode.cpp:86

static TAO::TypeCode::Struct_Field<
  char const *,
  ::CORBA::TypeCode_ptr const *> const 
    _tao_fields_test_testPingComp1_testPingCompNotificationEvent[] =
      {
        { "timestamp", &CORBA::_tc_string },
        { "msgtype", &CORBA::_tc_string },
        { "txt", &CORBA::_tc_string }
      };
  
static TAO::TypeCode::Struct<
  char const *,
  ::CORBA::TypeCode_ptr const *,
  TAO::TypeCode::Struct_Field<
    char const *,
    ::CORBA::TypeCode_ptr const *> const *,
  TAO::Null_RefCount_Policy>
_tao_tc_test_testPingComp1_testPingCompNotificationEvent (
  ::CORBA::tk_struct,
  "IDL:astri/test/testPingComp1/testPingCompNotificationEvent:1.0",
  "testPingCompNotificationEvent",
  _tao_fields_test_testPingComp1_testPingCompNotificationEvent,
  3);

::CORBA::TypeCode_ptr const test::testPingComp1::_tc_testPingCompNotificationEvent =
  &_tao_tc_test_testPingComp1_testPingCompNotificationEvent;

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

void
test::testPingComp1::testPingCompNotificationEvent::_tao_any_destructor (
    void *_tao_void_pointer)
{
  testPingCompNotificationEvent *_tao_tmp_pointer =
    static_cast<testPingCompNotificationEvent *> (_tao_void_pointer);
  delete _tao_tmp_pointer;
}

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

char *
test::testPingComp1::sayHello (
  void)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< char *>::ret_val _tao_retval;

  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval
    };

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "sayHello",
      8,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY,
      TAO::TAO_TWOWAY_INVOCATION
      ,
      TAO::TAO_SYNCHRONOUS_INVOCATION,
      false
    );

  _tao_call.invoke (0, 0);

  return _tao_retval.retn ();
}

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

char *
test::testPingComp1::sayHelloWithParameters (
  const char * inString,
  ::CORBA::Double & inoutDouble,
  ::CORBA::Long_out outInt)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< char *>::ret_val _tao_retval;
  TAO::Arg_Traits< char *>::in_arg_val _tao_inString (inString);
  TAO::Arg_Traits< ::CORBA::Double>::inout_arg_val _tao_inoutDouble (inoutDouble);
  TAO::Arg_Traits< ::CORBA::Long>::out_arg_val _tao_outInt (outInt);

  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval,
      &_tao_inString,
      &_tao_inoutDouble,
      &_tao_outInt
    };

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      4,
      "sayHelloWithParameters",
      22,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (0, 0);

  return _tao_retval.retn ();
}

test::testPingComp1::testPingComp1 (void)
{
}

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

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

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

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

test::testPingComp1_ptr
test::testPingComp1::_nil (void)
{
  return 0;
}

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

void
test::testPingComp1::_tao_release (testPingComp1_ptr obj)
{
  ::CORBA::release (obj);
}

::CORBA::Boolean
test::testPingComp1::_is_a (const char *value)
{
  if (
      ACE_OS::strcmp (
          value,
          "IDL:alma/ACS/ACSComponent:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:alma/ACS/PingableResource:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:astri/test/testPingComp1: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::testPingComp1::_interface_repository_id (void) const
{
  return "IDL:astri/test/testPingComp1:1.0";
}

::CORBA::Boolean
test::testPingComp1::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_testPingComp1 (
    ::CORBA::tk_objref,
    "IDL:astri/test/testPingComp1:1.0",
    "testPingComp1");
  

namespace test
{
  ::CORBA::TypeCode_ptr const _tc_testPingComp1 =
    &_tao_tc_test_testPingComp1;
}

// 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::testPingComp1>::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,
      testPingComp1_ptr _tao_elem)
  {
    testPingComp1_ptr _tao_objptr =
      testPingComp1::_duplicate (_tao_elem);
    _tao_any <<= &_tao_objptr;
  }

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      testPingComp1_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<testPingComp1>::extract (
          _tao_any,
          testPingComp1::_tao_any_destructor,
          _tc_testPingComp1,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

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

TAO_END_VERSIONED_NAMESPACE_DECL



#endif

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



#if defined (ACE_ANY_OPS_USE_NAMESPACE)

namespace test
{
  /// Copying insertion.
  void operator<<= (
      ::CORBA::Any &_tao_any,
      const ::test::testPingComp1::testPingCompNotificationEvent &_tao_elem)
  {
    TAO::Any_Dual_Impl_T< ::test::testPingComp1::testPingCompNotificationEvent>::insert_copy (
        _tao_any,
        ::test::testPingComp1::testPingCompNotificationEvent::_tao_any_destructor,
        ::test::testPingComp1::_tc_testPingCompNotificationEvent,
        _tao_elem);
}

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

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

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

/// Copying insertion.
void operator<<= (
  ::CORBA::Any &_tao_any,
  const test::testPingComp1::testPingCompNotificationEvent &_tao_elem)
{
  TAO::Any_Dual_Impl_T<test::testPingComp1::testPingCompNotificationEvent>::insert_copy (
    _tao_any,
    test::testPingComp1::testPingCompNotificationEvent::_tao_any_destructor,
    test::testPingComp1::_tc_testPingCompNotificationEvent,
    _tao_elem);
}

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

/// Extraction to const pointer.
::CORBA::Boolean operator>>= (
  const ::CORBA::Any &_tao_any,
  const test::testPingComp1::testPingCompNotificationEvent *&_tao_elem)
{
  return
    TAO::Any_Dual_Impl_T<test::testPingComp1::testPingCompNotificationEvent>::extract (
      _tao_any,
      test::testPingComp1::testPingCompNotificationEvent::_tao_any_destructor,
      test::testPingComp1::_tc_testPingCompNotificationEvent,
      _tao_elem);
}
TAO_END_VERSIONED_NAMESPACE_DECL



#endif

// TAO_IDL - Generated from
// be/be_visitor_structure/cdr_op_cs.cpp:49

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

::CORBA::Boolean operator<< (
    TAO_OutputCDR &strm,
    const test::testPingComp1::testPingCompNotificationEvent &_tao_aggregate)
{
  return
    (strm << _tao_aggregate.timestamp.in ()) &&
    (strm << _tao_aggregate.msgtype.in ()) &&
    (strm << _tao_aggregate.txt.in ());
}

::CORBA::Boolean operator>> (
    TAO_InputCDR &strm,
    test::testPingComp1::testPingCompNotificationEvent &_tao_aggregate)
{
  return
    (strm >> _tao_aggregate.timestamp.out ()) &&
    (strm >> _tao_aggregate.msgtype.out ()) &&
    (strm >> _tao_aggregate.txt.out ());
}

TAO_END_VERSIONED_NAMESPACE_DECL



// 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::testPingComp1_ptr _tao_objref)
{
  ::CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

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

  if (!(strm >> obj.inout ()))
    {
      return false;
    }
  
  typedef ::test::testPingComp1 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



