// -*- C++ -*-
/**
 * Code generated by the The ACE ORB (TAO) IDL Compiler v2.4.0
 * 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 "BrokerC.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/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 "BrokerC.inl"
#endif /* !defined INLINE */

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

// Traits specializations for Stock::StockBroker.

Stock::StockBroker_ptr
TAO::Objref_Traits<Stock::StockBroker>::duplicate (
    Stock::StockBroker_ptr p)
{
  return Stock::StockBroker::_duplicate (p);
}

void
TAO::Objref_Traits<Stock::StockBroker>::release (
    Stock::StockBroker_ptr p)
{
  ::CORBA::release (p);
}

Stock::StockBroker_ptr
TAO::Objref_Traits<Stock::StockBroker>::nil (void)
{
  return Stock::StockBroker::_nil ();
}

::CORBA::Boolean
TAO::Objref_Traits<Stock::StockBroker>::marshal (
    const Stock::StockBroker_ptr p,
    TAO_OutputCDR & cdr)
{
  return ::CORBA::Object::marshal (p, cdr);
}

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

::Stock::StockNameConsumer_ptr
Stock::StockBroker::get_consumer_notifier (
  void)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< ::Stock::StockNameConsumer>::ret_val _tao_retval;

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "get_consumer_notifier",
      21,
      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

void
Stock::StockBroker::connect_quoter_info (
  ::Stock::StockQuoter_ptr c)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::Stock::StockQuoter>::in_arg_val _tao_c (c);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "connect_quoter_info",
      19,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (0, 0);
}

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

::Stock::StockQuoter_ptr
Stock::StockBroker::disconnect_quoter_info (
  void)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< ::Stock::StockQuoter>::ret_val _tao_retval;

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "disconnect_quoter_info",
      22,
      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

::Stock::StockQuoter_ptr
Stock::StockBroker::get_connection_quoter_info (
  void)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< ::Stock::StockQuoter>::ret_val _tao_retval;

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "get_connection_quoter_info",
      26,
      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

void
Stock::StockBroker::shutdown (
  void)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;

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

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

  _tao_call.invoke (0, 0);
}

Stock::StockBroker::StockBroker (void)
{
}

Stock::StockBroker::~StockBroker (void)
{
}

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

Stock::StockBroker_ptr
Stock::StockBroker::_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<StockBroker>::narrow (
        _tao_objref,
        "IDL:Stock/StockBroker:1.0");
}

Stock::StockBroker_ptr
Stock::StockBroker::_unchecked_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<StockBroker>::unchecked_narrow (
        _tao_objref);
}

Stock::StockBroker_ptr
Stock::StockBroker::_nil (void)
{
  return 0;
}

Stock::StockBroker_ptr
Stock::StockBroker::_duplicate (StockBroker_ptr obj)
{
  if (! ::CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  return obj;
}

void
Stock::StockBroker::_tao_release (StockBroker_ptr obj)
{
  ::CORBA::release (obj);
}

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

::CORBA::Boolean
Stock::StockBroker::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_Stock_StockBroker (
    ::CORBA::tk_objref,
    "IDL:Stock/StockBroker:1.0",
    "StockBroker");
  

namespace Stock
{
  ::CORBA::TypeCode_ptr const _tc_StockBroker =
    &_tao_tc_Stock_StockBroker;
}

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

// Traits specializations for Stock::StockBrokerHome.

Stock::StockBrokerHome_ptr
TAO::Objref_Traits<Stock::StockBrokerHome>::duplicate (
    Stock::StockBrokerHome_ptr p)
{
  return Stock::StockBrokerHome::_duplicate (p);
}

void
TAO::Objref_Traits<Stock::StockBrokerHome>::release (
    Stock::StockBrokerHome_ptr p)
{
  ::CORBA::release (p);
}

Stock::StockBrokerHome_ptr
TAO::Objref_Traits<Stock::StockBrokerHome>::nil (void)
{
  return Stock::StockBrokerHome::_nil ();
}

::CORBA::Boolean
TAO::Objref_Traits<Stock::StockBrokerHome>::marshal (
    const Stock::StockBrokerHome_ptr p,
    TAO_OutputCDR & cdr)
{
  return ::CORBA::Object::marshal (p, cdr);
}

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

::Stock::StockBroker_ptr
Stock::StockBrokerHome::create (
  ::Stock::StockDistributor_ptr dist,
  const char * stock_name)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< ::Stock::StockBroker>::ret_val _tao_retval;
  TAO::Arg_Traits< ::Stock::StockDistributor>::in_arg_val _tao_dist (dist);
  TAO::Arg_Traits< char *>::in_arg_val _tao_stock_name (stock_name);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      3,
      "create",
      6,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (0, 0);

  return _tao_retval.retn ();
}

Stock::StockBrokerHome::StockBrokerHome (void)
{
}

Stock::StockBrokerHome::~StockBrokerHome (void)
{
}

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

Stock::StockBrokerHome_ptr
Stock::StockBrokerHome::_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<StockBrokerHome>::narrow (
        _tao_objref,
        "IDL:Stock/StockBrokerHome:1.0");
}

Stock::StockBrokerHome_ptr
Stock::StockBrokerHome::_unchecked_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<StockBrokerHome>::unchecked_narrow (
        _tao_objref);
}

Stock::StockBrokerHome_ptr
Stock::StockBrokerHome::_nil (void)
{
  return 0;
}

Stock::StockBrokerHome_ptr
Stock::StockBrokerHome::_duplicate (StockBrokerHome_ptr obj)
{
  if (! ::CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  return obj;
}

void
Stock::StockBrokerHome::_tao_release (StockBrokerHome_ptr obj)
{
  ::CORBA::release (obj);
}

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

::CORBA::Boolean
Stock::StockBrokerHome::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_Stock_StockBrokerHome (
    ::CORBA::tk_objref,
    "IDL:Stock/StockBrokerHome:1.0",
    "StockBrokerHome");
  

namespace Stock
{
  ::CORBA::TypeCode_ptr const _tc_StockBrokerHome =
    &_tao_tc_Stock_StockBrokerHome;
}

// 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<Stock::StockBroker>::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 Stock
{
  

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

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      StockBroker_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<StockBroker>::extract (
          _tao_any,
          StockBroker::_tao_any_destructor,
          _tc_StockBroker,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Stock::StockBroker_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Stock::StockBroker>::extract (
        _tao_any,
        Stock::StockBroker::_tao_any_destructor,
        Stock::_tc_StockBroker,
        _tao_elem);
}

TAO_END_VERSIONED_NAMESPACE_DECL



#endif

// 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<Stock::StockBrokerHome>::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 Stock
{
  

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

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      StockBrokerHome_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<StockBrokerHome>::extract (
          _tao_any,
          StockBrokerHome::_tao_any_destructor,
          _tc_StockBrokerHome,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Stock::StockBrokerHome_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Stock::StockBrokerHome>::extract (
        _tao_any,
        Stock::StockBrokerHome::_tao_any_destructor,
        Stock::_tc_StockBrokerHome,
        _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 Stock::StockBroker_ptr _tao_objref)
{
  ::CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

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

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



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

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

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



