// -*- 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:283


#include "PushPorts.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/CDR.h"
#include "tao/Exception_Data.h"
#include "tao/Invocation_Adapter.h"
#include "tao/Object_T.h"
#include "tao/AnyTypeCode/Any.h"
#include "tao/AnyTypeCode/Any_Impl_T.h"
#include "tao/Basic_Arguments.h"
#include "tao/Var_Size_Argument_T.h"
#include "ace/OS_NS_string.h"

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

// TAO_IDL - Generated from
// be/be_visitor_arg_traits.cpp:71
TAO_BEGIN_VERSIONED_NAMESPACE_DECL



// Arg traits specializations.
namespace TAO
{
  
  // TAO_IDL - Generated from
  // be/be_visitor_arg_traits.cpp:595

#if !defined (_CF_PROPERTIES__ARG_TRAITS_)
#define _CF_PROPERTIES__ARG_TRAITS_
  
  template<>
  class Arg_Traits<CF::Properties>
    : public
        Var_Size_Arg_Traits_T<
            CF::Properties,
            CF::Properties_var,
            CF::Properties_out,
            TAO::Any_Insert_Policy_Stream <CF::Properties>
          >
  {
  };

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

#if !defined (_CF_OCTETSEQUENCE__ARG_TRAITS_)
#define _CF_OCTETSEQUENCE__ARG_TRAITS_
  
  template<>
  class Arg_Traits<CF::OctetSequence>
    : public
        Var_Size_Arg_Traits_T<
            CF::OctetSequence,
            CF::OctetSequence_var,
            CF::OctetSequence_out,
            TAO::Any_Insert_Policy_Stream <CF::OctetSequence>
          >
  {
  };

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

TAO_END_VERSIONED_NAMESPACE_DECL



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

// Traits specializations for PushPorts::OctetSeqConsumer.

PushPorts::OctetSeqConsumer_ptr
TAO::Objref_Traits<PushPorts::OctetSeqConsumer>::duplicate (
    PushPorts::OctetSeqConsumer_ptr p
  )
{
  return PushPorts::OctetSeqConsumer::_duplicate (p);
}

void
TAO::Objref_Traits<PushPorts::OctetSeqConsumer>::release (
    PushPorts::OctetSeqConsumer_ptr p
  )
{
  CORBA::release (p);
}

PushPorts::OctetSeqConsumer_ptr
TAO::Objref_Traits<PushPorts::OctetSeqConsumer>::nil (void)
{
  return PushPorts::OctetSeqConsumer::_nil ();
}

::CORBA::Boolean
TAO::Objref_Traits<PushPorts::OctetSeqConsumer>::marshal (
    const PushPorts::OctetSeqConsumer_ptr p,
    TAO_OutputCDR & cdr
  )
{
  return ::CORBA::Object::marshal (p, cdr);
}

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

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

void PushPorts::OctetSeqConsumer::processOctetMsg (
    const ::CF::OctetSequence & msg,
    const ::CF::Properties & options
  )
  ACE_THROW_SPEC ((
    ::CORBA::SystemException
  ))
{
  if (!this->is_evaluated ())
    {
      ACE_NESTED_CLASS ( ::CORBA, Object)::tao_object_initialize (this);
    }
  
  if (this->the_TAO_OctetSeqConsumer_Proxy_Broker_ == 0)
    {
      PushPorts_OctetSeqConsumer_setup_collocation ();
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::CF::OctetSequence>::in_arg_val _tao_msg (msg);
  TAO::Arg_Traits< ::CF::Properties>::in_arg_val _tao_options (options);
  
  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval,
      &_tao_msg,
      &_tao_options
    };
  
  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      3,
      "processOctetMsg",
      15,
      this->the_TAO_OctetSeqConsumer_Proxy_Broker_,
      TAO::TAO_ONEWAY_INVOCATION
    );
  
  _tao_call.invoke (0, 0 ACE_ENV_ARG_PARAMETER);
  ACE_CHECK;
}

PushPorts::OctetSeqConsumer::OctetSeqConsumer (void)
 : the_TAO_OctetSeqConsumer_Proxy_Broker_ (0)
{
  this->PushPorts_OctetSeqConsumer_setup_collocation ();
}

void
PushPorts::OctetSeqConsumer::PushPorts_OctetSeqConsumer_setup_collocation ()
{
  if (::PushPorts__TAO_OctetSeqConsumer_Proxy_Broker_Factory_function_pointer)
    {
      this->the_TAO_OctetSeqConsumer_Proxy_Broker_ =
        ::PushPorts__TAO_OctetSeqConsumer_Proxy_Broker_Factory_function_pointer (this);
    }
}

PushPorts::OctetSeqConsumer::~OctetSeqConsumer (void)
{}

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

PushPorts::OctetSeqConsumer_ptr
PushPorts::OctetSeqConsumer::_narrow (
    ::CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL
  )
{
  return
    TAO::Narrow_Utils<OctetSeqConsumer>::narrow (
        _tao_objref,
        "IDL:PushPorts/OctetSeqConsumer:1.0",
        PushPorts__TAO_OctetSeqConsumer_Proxy_Broker_Factory_function_pointer
        ACE_ENV_ARG_PARAMETER
      );
}

PushPorts::OctetSeqConsumer_ptr
PushPorts::OctetSeqConsumer::_unchecked_narrow (
    ::CORBA::Object_ptr _tao_objref
    ACE_ENV_ARG_DECL
  )
{
  return
    TAO::Narrow_Utils<OctetSeqConsumer>::unchecked_narrow (
        _tao_objref,
        "IDL:PushPorts/OctetSeqConsumer:1.0",
        PushPorts__TAO_OctetSeqConsumer_Proxy_Broker_Factory_function_pointer
        ACE_ENV_ARG_PARAMETER
      );
}

PushPorts::OctetSeqConsumer_ptr
PushPorts::OctetSeqConsumer::_duplicate (OctetSeqConsumer_ptr obj)
{
  if (! CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  
  return obj;
}

void
PushPorts::OctetSeqConsumer::_tao_release (OctetSeqConsumer_ptr obj)
{
  CORBA::release (obj);
}

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

const char* PushPorts::OctetSeqConsumer::_interface_repository_id (void) const
{
  return "IDL:PushPorts/OctetSeqConsumer:1.0";
}

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

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

static TAO::TypeCode::Objref<char const *,
                             TAO::Null_RefCount_Policy>
  _tao_tc_PushPorts_OctetSeqConsumer (
    ::CORBA::tk_objref,
    "IDL:PushPorts/OctetSeqConsumer:1.0",
    "OctetSeqConsumer");
  
namespace PushPorts
{
  ::CORBA::TypeCode_ptr const _tc_OctetSeqConsumer =
    &_tao_tc_PushPorts_OctetSeqConsumer;
}



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



namespace TAO
{
  template<>
  ::CORBA::Boolean
  Any_Impl_T<PushPorts::OctetSeqConsumer>::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 PushPorts
{
  
  
  // Copying insertion.
  void
  operator<<= (
      ::CORBA::Any &_tao_any,
      OctetSeqConsumer_ptr _tao_elem
    )
  {
    OctetSeqConsumer_ptr _tao_objptr =
      OctetSeqConsumer::_duplicate (_tao_elem);
    _tao_any <<= &_tao_objptr;
  }
  
  // Non-copying insertion.
  void
  operator<<= (
      ::CORBA::Any &_tao_any,
      OctetSeqConsumer_ptr *_tao_elem
    )
  {
    TAO::Any_Impl_T<OctetSeqConsumer>::insert (
        _tao_any,
        OctetSeqConsumer::_tao_any_destructor,
        _tc_OctetSeqConsumer,
        *_tao_elem
      );
  }
  
  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      OctetSeqConsumer_ptr &_tao_elem
    )
  {
    return
      TAO::Any_Impl_T<OctetSeqConsumer>::extract (
          _tao_any,
          OctetSeqConsumer::_tao_any_destructor,
          _tc_OctetSeqConsumer,
          _tao_elem
        );
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    PushPorts::OctetSeqConsumer_ptr &_tao_elem
  )
{
  return
    TAO::Any_Impl_T<PushPorts::OctetSeqConsumer>::extract (
        _tao_any,
        PushPorts::OctetSeqConsumer::_tao_any_destructor,
        PushPorts::_tc_OctetSeqConsumer,
        _tao_elem
      );
}
TAO_END_VERSIONED_NAMESPACE_DECL



#endif

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


TAO_BEGIN_VERSIONED_NAMESPACE_DECL

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

::CORBA::Boolean operator>> (
    TAO_InputCDR &strm,
    PushPorts::OctetSeqConsumer_ptr &_tao_objref
  )
{
  ::CORBA::Object_var obj;
  
  if (!(strm >> obj.inout ()))
    {
      return false;
    }
  
  typedef ::PushPorts::OctetSeqConsumer RHS_SCOPED_NAME;
  
  // Narrow to the right type.
  _tao_objref =
    TAO::Narrow_Utils<RHS_SCOPED_NAME>::unchecked_narrow (
        obj.in (),
        PushPorts__TAO_OctetSeqConsumer_Proxy_Broker_Factory_function_pointer
      );
    
  return 1;
}
TAO_END_VERSIONED_NAMESPACE_DECL



