// -*- 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 "QuoterC.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/AnyTypeCode/Value_TypeCode_Static.h"
#include "tao/AnyTypeCode/TypeCode_Value_Field.h"
#include "tao/CDR.h"
#include "tao/Exception_Data.h"
#include "tao/Invocation_Adapter.h"
#include "tao/Messaging/Asynch_Invocation_Adapter.h"
#include "tao/Messaging/ExceptionHolder_i.h"
#include "tao/Valuetype/ValueFactory.h"
#include "tao/Object_T.h"
#include "tao/SystemException.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 "QuoterC.inl"
#endif /* !defined INLINE */

// TAO_IDL - Generated from
// be/be_visitor_exception/exception_cs.cpp:98

Quoter::Invalid_Stock_Symbol::Invalid_Stock_Symbol (void)
  : ::CORBA::UserException (
        "IDL:Quoter/Invalid_Stock_Symbol:1.0",
        "Invalid_Stock_Symbol"
      )
{
}

Quoter::Invalid_Stock_Symbol::~Invalid_Stock_Symbol (void)
{
}

Quoter::Invalid_Stock_Symbol::Invalid_Stock_Symbol (const ::Quoter::Invalid_Stock_Symbol &_tao_excp)
  : ::CORBA::UserException (
        _tao_excp._rep_id (),
        _tao_excp._name ()
      )
{
}

Quoter::Invalid_Stock_Symbol&
Quoter::Invalid_Stock_Symbol::operator= (const ::Quoter::Invalid_Stock_Symbol &_tao_excp)
{
  this->::CORBA::UserException::operator= (_tao_excp);
  return *this;
}

void Quoter::Invalid_Stock_Symbol::_tao_any_destructor (void *_tao_void_pointer)
{
  Invalid_Stock_Symbol *_tao_tmp_pointer =
    static_cast<Invalid_Stock_Symbol *> (_tao_void_pointer);
  delete _tao_tmp_pointer;
}

Quoter::Invalid_Stock_Symbol *
Quoter::Invalid_Stock_Symbol::_downcast ( ::CORBA::Exception *_tao_excp)
{
  return dynamic_cast<Invalid_Stock_Symbol *> (_tao_excp);
}

const Quoter::Invalid_Stock_Symbol *
Quoter::Invalid_Stock_Symbol::_downcast ( ::CORBA::Exception const *_tao_excp)
{
  return dynamic_cast<const Invalid_Stock_Symbol *> (_tao_excp);
}

::CORBA::Exception *Quoter::Invalid_Stock_Symbol::_alloc (void)
{
  ::CORBA::Exception *retval = 0;
  ACE_NEW_RETURN (retval, ::Quoter::Invalid_Stock_Symbol, 0);
  return retval;
}

::CORBA::Exception *
Quoter::Invalid_Stock_Symbol::_tao_duplicate (void) const
{
  ::CORBA::Exception *result = 0;
  ACE_NEW_RETURN (
      result,
      ::Quoter::Invalid_Stock_Symbol (*this),
      0
    );
  return result;
}

void Quoter::Invalid_Stock_Symbol::_raise (void) const
{
  throw *this;
}

void Quoter::Invalid_Stock_Symbol::_tao_encode (TAO_OutputCDR &cdr) const
{
  if (!(cdr << *this))
    {
      throw ::CORBA::MARSHAL ();
    }
}

void Quoter::Invalid_Stock_Symbol::_tao_decode (TAO_InputCDR &cdr)
{
  if (!(cdr >> *this))
    {
      throw ::CORBA::MARSHAL ();
    }
}

// TAO extension - the virtual _type method.
::CORBA::TypeCode_ptr Quoter::Invalid_Stock_Symbol::_tao_type (void) const
{
  return ::Quoter::_tc_Invalid_Stock_Symbol;
}

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

static TAO::TypeCode::Struct_Field<
  char const *,
  ::CORBA::TypeCode_ptr const *> const * const 
    _tao_fields_Quoter_Invalid_Stock_Symbol = 0;
  
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_Quoter_Invalid_Stock_Symbol (
  ::CORBA::tk_except,
  "IDL:Quoter/Invalid_Stock_Symbol:1.0",
  "Invalid_Stock_Symbol",
  _tao_fields_Quoter_Invalid_Stock_Symbol,
  0);


namespace Quoter
{
  ::CORBA::TypeCode_ptr const _tc_Invalid_Stock_Symbol =
    &_tao_tc_Quoter_Invalid_Stock_Symbol;
}

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

// Traits specializations for Quoter::Stock_Factory.

Quoter::Stock_Factory_ptr
TAO::Objref_Traits<Quoter::Stock_Factory>::duplicate (
    Quoter::Stock_Factory_ptr p)
{
  return Quoter::Stock_Factory::_duplicate (p);
}

void
TAO::Objref_Traits<Quoter::Stock_Factory>::release (
    Quoter::Stock_Factory_ptr p)
{
  ::CORBA::release (p);
}

Quoter::Stock_Factory_ptr
TAO::Objref_Traits<Quoter::Stock_Factory>::nil (void)
{
  return Quoter::Stock_Factory::_nil ();
}

::CORBA::Boolean
TAO::Objref_Traits<Quoter::Stock_Factory>::marshal (
    const Quoter::Stock_Factory_ptr p,
    TAO_OutputCDR & cdr)
{
  return ::CORBA::Object::marshal (p, cdr);
}

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

::Quoter::Stock_ptr
Quoter::Stock_Factory::get_stock (
  const char * stock_symbol)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< ::Quoter::Stock>::ret_val _tao_retval;
  TAO::Arg_Traits< char *>::in_arg_val _tao_stock_symbol (stock_symbol);

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

  static TAO::Exception_Data
  _tao_Quoter_Stock_Factory_get_stock_exceptiondata [] = 
    {
      {
        "IDL:Quoter/Invalid_Stock_Symbol:1.0",
        Quoter::Invalid_Stock_Symbol::_alloc
#if TAO_HAS_INTERCEPTORS == 1
        , Quoter::_tc_Invalid_Stock_Symbol
#endif /* TAO_HAS_INTERCEPTORS */
      }
    };

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "get_stock",
      9,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (
      _tao_Quoter_Stock_Factory_get_stock_exceptiondata,
      1
    );

  return _tao_retval.retn ();
}

// TAO_IDL - Generated from
// be/be_visitor_operation/ami_cs.cpp:55

void
Quoter::Stock_Factory::sendc_get_stock (
  ::Quoter::AMI_Stock_FactoryHandler_ptr ami_handler,
  const char * stock_symbol)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  
  
  TAO::Arg_Traits<void>::ret_val _tao_retval;
  TAO::Arg_Traits< char *>::in_arg_val _tao_stock_symbol (stock_symbol);

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

  TAO::Asynch_Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "get_stock",
      9,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
    );

  _tao_call.invoke (
      ami_handler,
      &Quoter::AMI_Stock_FactoryHandler::get_stock_reply_stub
    );
}

Quoter::Stock_Factory::Stock_Factory (void)
{
}

Quoter::Stock_Factory::~Stock_Factory (void)
{
}

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

Quoter::Stock_Factory_ptr
Quoter::Stock_Factory::_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<Stock_Factory>::narrow (
        _tao_objref,
        "IDL:Quoter/Stock_Factory:1.0");
}

Quoter::Stock_Factory_ptr
Quoter::Stock_Factory::_unchecked_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<Stock_Factory>::unchecked_narrow (
        _tao_objref);
}

Quoter::Stock_Factory_ptr
Quoter::Stock_Factory::_nil (void)
{
  return 0;
}

Quoter::Stock_Factory_ptr
Quoter::Stock_Factory::_duplicate (Stock_Factory_ptr obj)
{
  if (! ::CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  return obj;
}

void
Quoter::Stock_Factory::_tao_release (Stock_Factory_ptr obj)
{
  ::CORBA::release (obj);
}

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

::CORBA::Boolean
Quoter::Stock_Factory::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_Quoter_Stock_Factory (
    ::CORBA::tk_objref,
    "IDL:Quoter/Stock_Factory:1.0",
    "Stock_Factory");
  

namespace Quoter
{
  ::CORBA::TypeCode_ptr const _tc_Stock_Factory =
    &_tao_tc_Quoter_Stock_Factory;
}

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

// Traits specializations for Quoter::AMI_Stock_FactoryHandler.

Quoter::AMI_Stock_FactoryHandler_ptr
TAO::Objref_Traits<Quoter::AMI_Stock_FactoryHandler>::duplicate (
    Quoter::AMI_Stock_FactoryHandler_ptr p)
{
  return Quoter::AMI_Stock_FactoryHandler::_duplicate (p);
}

void
TAO::Objref_Traits<Quoter::AMI_Stock_FactoryHandler>::release (
    Quoter::AMI_Stock_FactoryHandler_ptr p)
{
  ::CORBA::release (p);
}

Quoter::AMI_Stock_FactoryHandler_ptr
TAO::Objref_Traits<Quoter::AMI_Stock_FactoryHandler>::nil (void)
{
  return Quoter::AMI_Stock_FactoryHandler::_nil ();
}

::CORBA::Boolean
TAO::Objref_Traits<Quoter::AMI_Stock_FactoryHandler>::marshal (
    const Quoter::AMI_Stock_FactoryHandler_ptr p,
    TAO_OutputCDR & cdr)
{
  return ::CORBA::Object::marshal (p, cdr);
}

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

void
Quoter::AMI_Stock_FactoryHandler::get_stock (
  ::Quoter::Stock_ptr ami_return_val)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::Quoter::Stock>::in_arg_val _tao_ami_return_val (ami_return_val);

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

  static TAO::Exception_Data
  _tao_Quoter_AMI_Stock_FactoryHandler_get_stock_exceptiondata [] = 
    {
      {
        "IDL:Quoter/Invalid_Stock_Symbol:1.0",
        Quoter::Invalid_Stock_Symbol::_alloc
#if TAO_HAS_INTERCEPTORS == 1
        , Quoter::_tc_Invalid_Stock_Symbol
#endif /* TAO_HAS_INTERCEPTORS */
      }
    };

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "get_stock",
      9,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (
      _tao_Quoter_AMI_Stock_FactoryHandler_get_stock_exceptiondata,
      1
    );
}

void
Quoter::AMI_Stock_FactoryHandler::get_stock_reply_stub (
  TAO_InputCDR &_tao_in,
  ::Messaging::ReplyHandler_ptr _tao_reply_handler,
  ::CORBA::ULong reply_status)
{
  // Retrieve Reply Handler object.
  Quoter::AMI_Stock_FactoryHandler_var _tao_reply_handler_object =
    Quoter::AMI_Stock_FactoryHandler::_narrow (_tao_reply_handler);

  // Exception handling
  switch (reply_status)
  {
    case TAO_AMI_REPLY_OK:
    {

      ::Quoter::Stock_var ami_return_val;      // Demarshall all the arguments.
      if (!(

            (_tao_in >> ami_return_val.out ())
         ))
        throw ::CORBA::MARSHAL ();
      
      // Invoke the call back method.
      _tao_reply_handler_object->get_stock (
          
          ami_return_val.in ()
        );
      break;
    }
    case TAO_AMI_REPLY_USER_EXCEPTION:
    case TAO_AMI_REPLY_SYSTEM_EXCEPTION:
    {
      const ACE_Message_Block* cdr = _tao_in.start ();
      
      static TAO::Exception_Data exceptions_data [] =
      {
        {
          "IDL:Quoter/Invalid_Stock_Symbol:1.0",
          Quoter::Invalid_Stock_Symbol::_alloc
#if TAO_HAS_INTERCEPTORS == 1
          , Quoter::_tc_Invalid_Stock_Symbol
#endif /* TAO_HAS_INTERCEPTORS */
        }
      };

      ::CORBA::ULong const exceptions_count = 1;

      ::CORBA::OctetSeq _tao_marshaled_exception (
          static_cast <CORBA::ULong> (cdr->length ()),
          static_cast <CORBA::ULong> (cdr->length ()),
          reinterpret_cast <unsigned char*> (cdr->rd_ptr ()),
          0
        );
      ::Messaging::ExceptionHolder* exception_holder_ptr = 0;
      ACE_NEW (
          exception_holder_ptr,
          ::TAO::ExceptionHolder (
            (reply_status == TAO_AMI_REPLY_SYSTEM_EXCEPTION),
            _tao_in.byte_order (),
            _tao_marshaled_exception,
            exceptions_data,
            exceptions_count,
            _tao_in.char_translator (),
            _tao_in.wchar_translator ())
          );
        
      ::Messaging::ExceptionHolder_var exception_holder_var = exception_holder_ptr;
      _tao_reply_handler_object->get_stock_excep (
          exception_holder_var
        );
      break;
    }
    case TAO_AMI_REPLY_NOT_OK:
      // @@ Michael: Not even the spec mentions this case.
      //             We have to think about this case.
      break;
  }
}

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

void
Quoter::AMI_Stock_FactoryHandler::get_stock_excep (
  ::Messaging::ExceptionHolder * excep_holder)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::Messaging::ExceptionHolder>::in_arg_val _tao_excep_holder (excep_holder);

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

  static TAO::Exception_Data
  _tao_Quoter_AMI_Stock_FactoryHandler_get_stock_excep_exceptiondata [] = 
    {
      {
        "IDL:Quoter/Invalid_Stock_Symbol:1.0",
        Quoter::Invalid_Stock_Symbol::_alloc
#if TAO_HAS_INTERCEPTORS == 1
        , Quoter::_tc_Invalid_Stock_Symbol
#endif /* TAO_HAS_INTERCEPTORS */
      }
    };

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "get_stock_excep",
      15,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (
      _tao_Quoter_AMI_Stock_FactoryHandler_get_stock_excep_exceptiondata,
      1
    );
}

Quoter::AMI_Stock_FactoryHandler::AMI_Stock_FactoryHandler (void)
{
}

Quoter::AMI_Stock_FactoryHandler::~AMI_Stock_FactoryHandler (void)
{
}

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

Quoter::AMI_Stock_FactoryHandler_ptr
Quoter::AMI_Stock_FactoryHandler::_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<AMI_Stock_FactoryHandler>::narrow (
        _tao_objref,
        "IDL:Quoter/AMI_Stock_FactoryHandler:1.0");
}

Quoter::AMI_Stock_FactoryHandler_ptr
Quoter::AMI_Stock_FactoryHandler::_unchecked_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<AMI_Stock_FactoryHandler>::unchecked_narrow (
        _tao_objref);
}

Quoter::AMI_Stock_FactoryHandler_ptr
Quoter::AMI_Stock_FactoryHandler::_nil (void)
{
  return 0;
}

Quoter::AMI_Stock_FactoryHandler_ptr
Quoter::AMI_Stock_FactoryHandler::_duplicate (AMI_Stock_FactoryHandler_ptr obj)
{
  if (! ::CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  return obj;
}

void
Quoter::AMI_Stock_FactoryHandler::_tao_release (AMI_Stock_FactoryHandler_ptr obj)
{
  ::CORBA::release (obj);
}

::CORBA::Boolean
Quoter::AMI_Stock_FactoryHandler::_is_a (const char *value)
{
  if (
      ACE_OS::strcmp (
          value,
          "IDL:omg.org/Messaging/ReplyHandler:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:Quoter/AMI_Stock_FactoryHandler: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* Quoter::AMI_Stock_FactoryHandler::_interface_repository_id (void) const
{
  return "IDL:Quoter/AMI_Stock_FactoryHandler:1.0";
}

::CORBA::Boolean
Quoter::AMI_Stock_FactoryHandler::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_Quoter_AMI_Stock_FactoryHandler (
    ::CORBA::tk_objref,
    "IDL:Quoter/AMI_Stock_FactoryHandler:1.0",
    "AMI_Stock_FactoryHandler");
  

namespace Quoter
{
  ::CORBA::TypeCode_ptr const _tc_AMI_Stock_FactoryHandler =
    &_tao_tc_Quoter_AMI_Stock_FactoryHandler;
}

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

// Traits specializations for Quoter::Stock.

Quoter::Stock_ptr
TAO::Objref_Traits<Quoter::Stock>::duplicate (
    Quoter::Stock_ptr p)
{
  return Quoter::Stock::_duplicate (p);
}

void
TAO::Objref_Traits<Quoter::Stock>::release (
    Quoter::Stock_ptr p)
{
  ::CORBA::release (p);
}

Quoter::Stock_ptr
TAO::Objref_Traits<Quoter::Stock>::nil (void)
{
  return Quoter::Stock::_nil ();
}

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

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

char *
Quoter::Stock::symbol (
  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,
      "_get_symbol",
      11,
      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 *
Quoter::Stock::full_name (
  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,
      "_get_full_name",
      14,
      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

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

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "price",
      5,
      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/ami_cs.cpp:55

void
Quoter::Stock::sendc_get_symbol (
  ::Quoter::AMI_StockHandler_ptr ami_handler)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  

  TAO::Argument ** _the_tao_operation_signature = 0;

  TAO::Asynch_Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      0,
      "_get_symbol",
      11,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
    );

  _tao_call.invoke (
      ami_handler,
      &Quoter::AMI_StockHandler::get_symbol_reply_stub
    );
}

// TAO_IDL - Generated from
// be/be_visitor_operation/ami_cs.cpp:55

void
Quoter::Stock::sendc_get_full_name (
  ::Quoter::AMI_StockHandler_ptr ami_handler)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  

  TAO::Argument ** _the_tao_operation_signature = 0;

  TAO::Asynch_Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      0,
      "_get_full_name",
      14,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
    );

  _tao_call.invoke (
      ami_handler,
      &Quoter::AMI_StockHandler::get_full_name_reply_stub
    );
}

// TAO_IDL - Generated from
// be/be_visitor_operation/ami_cs.cpp:55

void
Quoter::Stock::sendc_price (
  ::Quoter::AMI_StockHandler_ptr ami_handler)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  

  TAO::Argument ** _the_tao_operation_signature = 0;

  TAO::Asynch_Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      0,
      "price",
      5,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
    );

  _tao_call.invoke (
      ami_handler,
      &Quoter::AMI_StockHandler::price_reply_stub
    );
}

Quoter::Stock::Stock (void)
{
}

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

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

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

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

Quoter::Stock_ptr
Quoter::Stock::_nil (void)
{
  return 0;
}

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

void
Quoter::Stock::_tao_release (Stock_ptr obj)
{
  ::CORBA::release (obj);
}

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

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

namespace Quoter
{
  ::CORBA::TypeCode_ptr const _tc_Stock =
    &_tao_tc_Quoter_Stock;
}

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

// Traits specializations for Quoter::AMI_StockHandler.

Quoter::AMI_StockHandler_ptr
TAO::Objref_Traits<Quoter::AMI_StockHandler>::duplicate (
    Quoter::AMI_StockHandler_ptr p)
{
  return Quoter::AMI_StockHandler::_duplicate (p);
}

void
TAO::Objref_Traits<Quoter::AMI_StockHandler>::release (
    Quoter::AMI_StockHandler_ptr p)
{
  ::CORBA::release (p);
}

Quoter::AMI_StockHandler_ptr
TAO::Objref_Traits<Quoter::AMI_StockHandler>::nil (void)
{
  return Quoter::AMI_StockHandler::_nil ();
}

::CORBA::Boolean
TAO::Objref_Traits<Quoter::AMI_StockHandler>::marshal (
    const Quoter::AMI_StockHandler_ptr p,
    TAO_OutputCDR & cdr)
{
  return ::CORBA::Object::marshal (p, cdr);
}

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

void
Quoter::AMI_StockHandler::get_symbol (
  const char * ami_return_val)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< char *>::in_arg_val _tao_ami_return_val (ami_return_val);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "get_symbol",
      10,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (0, 0);
}

void
Quoter::AMI_StockHandler::get_symbol_reply_stub (
  TAO_InputCDR &_tao_in,
  ::Messaging::ReplyHandler_ptr _tao_reply_handler,
  ::CORBA::ULong reply_status)
{
  // Retrieve Reply Handler object.
  Quoter::AMI_StockHandler_var _tao_reply_handler_object =
    Quoter::AMI_StockHandler::_narrow (_tao_reply_handler);

  // Exception handling
  switch (reply_status)
  {
    case TAO_AMI_REPLY_OK:
    {

      ::CORBA::String_var ami_return_val;      // Demarshall all the arguments.
      if (!(

            (_tao_in >> ami_return_val.out ())
         ))
        throw ::CORBA::MARSHAL ();
      
      // Invoke the call back method.
      _tao_reply_handler_object->get_symbol (
          
          ami_return_val.in ()
        );
      break;
    }
    case TAO_AMI_REPLY_USER_EXCEPTION:
    case TAO_AMI_REPLY_SYSTEM_EXCEPTION:
    {
      const ACE_Message_Block* cdr = _tao_in.start ();
      ::CORBA::OctetSeq _tao_marshaled_exception (
          static_cast <CORBA::ULong> (cdr->length ()),
          static_cast <CORBA::ULong> (cdr->length ()),
          reinterpret_cast <unsigned char*> (cdr->rd_ptr ()),
          0
        );
      ::Messaging::ExceptionHolder* exception_holder_ptr = 0;
      ACE_NEW (
          exception_holder_ptr,
          ::TAO::ExceptionHolder (
            (reply_status == TAO_AMI_REPLY_SYSTEM_EXCEPTION),
            _tao_in.byte_order (),
            _tao_marshaled_exception,
            0,
            0,
            _tao_in.char_translator (),
            _tao_in.wchar_translator ())
          );
        
      ::Messaging::ExceptionHolder_var exception_holder_var = exception_holder_ptr;
      _tao_reply_handler_object->get_symbol_excep (
          exception_holder_var
        );
      break;
    }
    case TAO_AMI_REPLY_NOT_OK:
      // @@ Michael: Not even the spec mentions this case.
      //             We have to think about this case.
      break;
  }
}

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

void
Quoter::AMI_StockHandler::get_symbol_excep (
  ::Messaging::ExceptionHolder * excep_holder)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::Messaging::ExceptionHolder>::in_arg_val _tao_excep_holder (excep_holder);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "get_symbol_excep",
      16,
      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

void
Quoter::AMI_StockHandler::get_full_name (
  const char * ami_return_val)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< char *>::in_arg_val _tao_ami_return_val (ami_return_val);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "get_full_name",
      13,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (0, 0);
}

void
Quoter::AMI_StockHandler::get_full_name_reply_stub (
  TAO_InputCDR &_tao_in,
  ::Messaging::ReplyHandler_ptr _tao_reply_handler,
  ::CORBA::ULong reply_status)
{
  // Retrieve Reply Handler object.
  Quoter::AMI_StockHandler_var _tao_reply_handler_object =
    Quoter::AMI_StockHandler::_narrow (_tao_reply_handler);

  // Exception handling
  switch (reply_status)
  {
    case TAO_AMI_REPLY_OK:
    {

      ::CORBA::String_var ami_return_val;      // Demarshall all the arguments.
      if (!(

            (_tao_in >> ami_return_val.out ())
         ))
        throw ::CORBA::MARSHAL ();
      
      // Invoke the call back method.
      _tao_reply_handler_object->get_full_name (
          
          ami_return_val.in ()
        );
      break;
    }
    case TAO_AMI_REPLY_USER_EXCEPTION:
    case TAO_AMI_REPLY_SYSTEM_EXCEPTION:
    {
      const ACE_Message_Block* cdr = _tao_in.start ();
      ::CORBA::OctetSeq _tao_marshaled_exception (
          static_cast <CORBA::ULong> (cdr->length ()),
          static_cast <CORBA::ULong> (cdr->length ()),
          reinterpret_cast <unsigned char*> (cdr->rd_ptr ()),
          0
        );
      ::Messaging::ExceptionHolder* exception_holder_ptr = 0;
      ACE_NEW (
          exception_holder_ptr,
          ::TAO::ExceptionHolder (
            (reply_status == TAO_AMI_REPLY_SYSTEM_EXCEPTION),
            _tao_in.byte_order (),
            _tao_marshaled_exception,
            0,
            0,
            _tao_in.char_translator (),
            _tao_in.wchar_translator ())
          );
        
      ::Messaging::ExceptionHolder_var exception_holder_var = exception_holder_ptr;
      _tao_reply_handler_object->get_full_name_excep (
          exception_holder_var
        );
      break;
    }
    case TAO_AMI_REPLY_NOT_OK:
      // @@ Michael: Not even the spec mentions this case.
      //             We have to think about this case.
      break;
  }
}

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

void
Quoter::AMI_StockHandler::get_full_name_excep (
  ::Messaging::ExceptionHolder * excep_holder)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::Messaging::ExceptionHolder>::in_arg_val _tao_excep_holder (excep_holder);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "get_full_name_excep",
      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

void
Quoter::AMI_StockHandler::price (
  ::CORBA::Double ami_return_val)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::CORBA::Double>::in_arg_val _tao_ami_return_val (ami_return_val);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "price",
      5,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (0, 0);
}

void
Quoter::AMI_StockHandler::price_reply_stub (
  TAO_InputCDR &_tao_in,
  ::Messaging::ReplyHandler_ptr _tao_reply_handler,
  ::CORBA::ULong reply_status)
{
  // Retrieve Reply Handler object.
  Quoter::AMI_StockHandler_var _tao_reply_handler_object =
    Quoter::AMI_StockHandler::_narrow (_tao_reply_handler);

  // Exception handling
  switch (reply_status)
  {
    case TAO_AMI_REPLY_OK:
    {

      ::CORBA::Double ami_return_val;      // Demarshall all the arguments.
      if (!(

            (_tao_in >> ami_return_val)
         ))
        throw ::CORBA::MARSHAL ();
      
      // Invoke the call back method.
      _tao_reply_handler_object->price (
          
          ami_return_val
        );
      break;
    }
    case TAO_AMI_REPLY_USER_EXCEPTION:
    case TAO_AMI_REPLY_SYSTEM_EXCEPTION:
    {
      const ACE_Message_Block* cdr = _tao_in.start ();
      ::CORBA::OctetSeq _tao_marshaled_exception (
          static_cast <CORBA::ULong> (cdr->length ()),
          static_cast <CORBA::ULong> (cdr->length ()),
          reinterpret_cast <unsigned char*> (cdr->rd_ptr ()),
          0
        );
      ::Messaging::ExceptionHolder* exception_holder_ptr = 0;
      ACE_NEW (
          exception_holder_ptr,
          ::TAO::ExceptionHolder (
            (reply_status == TAO_AMI_REPLY_SYSTEM_EXCEPTION),
            _tao_in.byte_order (),
            _tao_marshaled_exception,
            0,
            0,
            _tao_in.char_translator (),
            _tao_in.wchar_translator ())
          );
        
      ::Messaging::ExceptionHolder_var exception_holder_var = exception_holder_ptr;
      _tao_reply_handler_object->price_excep (
          exception_holder_var
        );
      break;
    }
    case TAO_AMI_REPLY_NOT_OK:
      // @@ Michael: Not even the spec mentions this case.
      //             We have to think about this case.
      break;
  }
}

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

void
Quoter::AMI_StockHandler::price_excep (
  ::Messaging::ExceptionHolder * excep_holder)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::Messaging::ExceptionHolder>::in_arg_val _tao_excep_holder (excep_holder);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "price_excep",
      11,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (0, 0);
}

Quoter::AMI_StockHandler::AMI_StockHandler (void)
{
}

Quoter::AMI_StockHandler::~AMI_StockHandler (void)
{
}

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

Quoter::AMI_StockHandler_ptr
Quoter::AMI_StockHandler::_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<AMI_StockHandler>::narrow (
        _tao_objref,
        "IDL:Quoter/AMI_StockHandler:1.0");
}

Quoter::AMI_StockHandler_ptr
Quoter::AMI_StockHandler::_unchecked_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<AMI_StockHandler>::unchecked_narrow (
        _tao_objref);
}

Quoter::AMI_StockHandler_ptr
Quoter::AMI_StockHandler::_nil (void)
{
  return 0;
}

Quoter::AMI_StockHandler_ptr
Quoter::AMI_StockHandler::_duplicate (AMI_StockHandler_ptr obj)
{
  if (! ::CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  return obj;
}

void
Quoter::AMI_StockHandler::_tao_release (AMI_StockHandler_ptr obj)
{
  ::CORBA::release (obj);
}

::CORBA::Boolean
Quoter::AMI_StockHandler::_is_a (const char *value)
{
  if (
      ACE_OS::strcmp (
          value,
          "IDL:omg.org/Messaging/ReplyHandler:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:Quoter/AMI_StockHandler: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* Quoter::AMI_StockHandler::_interface_repository_id (void) const
{
  return "IDL:Quoter/AMI_StockHandler:1.0";
}

::CORBA::Boolean
Quoter::AMI_StockHandler::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_Quoter_AMI_StockHandler (
    ::CORBA::tk_objref,
    "IDL:Quoter/AMI_StockHandler:1.0",
    "AMI_StockHandler");
  

namespace Quoter
{
  ::CORBA::TypeCode_ptr const _tc_AMI_StockHandler =
    &_tao_tc_Quoter_AMI_StockHandler;
}

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

// Traits specializations for Quoter::Single_Query_Stock.

Quoter::Single_Query_Stock_ptr
TAO::Objref_Traits<Quoter::Single_Query_Stock>::duplicate (
    Quoter::Single_Query_Stock_ptr p)
{
  return Quoter::Single_Query_Stock::_duplicate (p);
}

void
TAO::Objref_Traits<Quoter::Single_Query_Stock>::release (
    Quoter::Single_Query_Stock_ptr p)
{
  ::CORBA::release (p);
}

Quoter::Single_Query_Stock_ptr
TAO::Objref_Traits<Quoter::Single_Query_Stock>::nil (void)
{
  return Quoter::Single_Query_Stock::_nil ();
}

::CORBA::Boolean
TAO::Objref_Traits<Quoter::Single_Query_Stock>::marshal (
    const Quoter::Single_Query_Stock_ptr p,
    TAO_OutputCDR & cdr)
{
  return ::CORBA::Object::marshal (p, cdr);
}

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

::CORBA::Double
Quoter::Single_Query_Stock::get_price_and_names (
  ::CORBA::String_out symbol,
  ::CORBA::String_out full_name)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< ::CORBA::Double>::ret_val _tao_retval;
  TAO::Arg_Traits< char *>::out_arg_val _tao_symbol (symbol);
  TAO::Arg_Traits< char *>::out_arg_val _tao_full_name (full_name);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      3,
      "get_price_and_names",
      19,
      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/ami_cs.cpp:55

void
Quoter::Single_Query_Stock::sendc_get_price_and_names (
  ::Quoter::AMI_Single_Query_StockHandler_ptr ami_handler)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  

  TAO::Argument ** _the_tao_operation_signature = 0;

  TAO::Asynch_Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      0,
      "get_price_and_names",
      19,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
    );

  _tao_call.invoke (
      ami_handler,
      &Quoter::AMI_Single_Query_StockHandler::get_price_and_names_reply_stub
    );
}

Quoter::Single_Query_Stock::Single_Query_Stock (void)
{
}

Quoter::Single_Query_Stock::~Single_Query_Stock (void)
{
}

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

Quoter::Single_Query_Stock_ptr
Quoter::Single_Query_Stock::_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<Single_Query_Stock>::narrow (
        _tao_objref,
        "IDL:Quoter/Single_Query_Stock:1.0");
}

Quoter::Single_Query_Stock_ptr
Quoter::Single_Query_Stock::_unchecked_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<Single_Query_Stock>::unchecked_narrow (
        _tao_objref);
}

Quoter::Single_Query_Stock_ptr
Quoter::Single_Query_Stock::_nil (void)
{
  return 0;
}

Quoter::Single_Query_Stock_ptr
Quoter::Single_Query_Stock::_duplicate (Single_Query_Stock_ptr obj)
{
  if (! ::CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  return obj;
}

void
Quoter::Single_Query_Stock::_tao_release (Single_Query_Stock_ptr obj)
{
  ::CORBA::release (obj);
}

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

::CORBA::Boolean
Quoter::Single_Query_Stock::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_Quoter_Single_Query_Stock (
    ::CORBA::tk_objref,
    "IDL:Quoter/Single_Query_Stock:1.0",
    "Single_Query_Stock");
  

namespace Quoter
{
  ::CORBA::TypeCode_ptr const _tc_Single_Query_Stock =
    &_tao_tc_Quoter_Single_Query_Stock;
}

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

// Traits specializations for Quoter::AMI_Single_Query_StockHandler.

Quoter::AMI_Single_Query_StockHandler_ptr
TAO::Objref_Traits<Quoter::AMI_Single_Query_StockHandler>::duplicate (
    Quoter::AMI_Single_Query_StockHandler_ptr p)
{
  return Quoter::AMI_Single_Query_StockHandler::_duplicate (p);
}

void
TAO::Objref_Traits<Quoter::AMI_Single_Query_StockHandler>::release (
    Quoter::AMI_Single_Query_StockHandler_ptr p)
{
  ::CORBA::release (p);
}

Quoter::AMI_Single_Query_StockHandler_ptr
TAO::Objref_Traits<Quoter::AMI_Single_Query_StockHandler>::nil (void)
{
  return Quoter::AMI_Single_Query_StockHandler::_nil ();
}

::CORBA::Boolean
TAO::Objref_Traits<Quoter::AMI_Single_Query_StockHandler>::marshal (
    const Quoter::AMI_Single_Query_StockHandler_ptr p,
    TAO_OutputCDR & cdr)
{
  return ::CORBA::Object::marshal (p, cdr);
}

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

void
Quoter::AMI_Single_Query_StockHandler::get_price_and_names (
  ::CORBA::Double ami_return_val,
  const char * symbol,
  const char * full_name)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::CORBA::Double>::in_arg_val _tao_ami_return_val (ami_return_val);
  TAO::Arg_Traits< char *>::in_arg_val _tao_symbol (symbol);
  TAO::Arg_Traits< char *>::in_arg_val _tao_full_name (full_name);

  TAO::Argument *_the_tao_operation_signature [] =
    {
      &_tao_retval,
      &_tao_ami_return_val,
      &_tao_symbol,
      &_tao_full_name
    };

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      4,
      "get_price_and_names",
      19,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (0, 0);
}

void
Quoter::AMI_Single_Query_StockHandler::get_price_and_names_reply_stub (
  TAO_InputCDR &_tao_in,
  ::Messaging::ReplyHandler_ptr _tao_reply_handler,
  ::CORBA::ULong reply_status)
{
  // Retrieve Reply Handler object.
  Quoter::AMI_Single_Query_StockHandler_var _tao_reply_handler_object =
    Quoter::AMI_Single_Query_StockHandler::_narrow (_tao_reply_handler);

  // Exception handling
  switch (reply_status)
  {
    case TAO_AMI_REPLY_OK:
    {

      ::CORBA::Double ami_return_val;
      ::CORBA::String_var symbol;
      ::CORBA::String_var full_name;      // Demarshall all the arguments.
      if (!(

            (_tao_in >> ami_return_val) &&
            (_tao_in >> symbol.out ()) &&
            (_tao_in >> full_name.out ())
         ))
        throw ::CORBA::MARSHAL ();
      
      // Invoke the call back method.
      _tao_reply_handler_object->get_price_and_names (
          
          ami_return_val,
          
          symbol.in (),
          
          full_name.in ()
        );
      break;
    }
    case TAO_AMI_REPLY_USER_EXCEPTION:
    case TAO_AMI_REPLY_SYSTEM_EXCEPTION:
    {
      const ACE_Message_Block* cdr = _tao_in.start ();
      ::CORBA::OctetSeq _tao_marshaled_exception (
          static_cast <CORBA::ULong> (cdr->length ()),
          static_cast <CORBA::ULong> (cdr->length ()),
          reinterpret_cast <unsigned char*> (cdr->rd_ptr ()),
          0
        );
      ::Messaging::ExceptionHolder* exception_holder_ptr = 0;
      ACE_NEW (
          exception_holder_ptr,
          ::TAO::ExceptionHolder (
            (reply_status == TAO_AMI_REPLY_SYSTEM_EXCEPTION),
            _tao_in.byte_order (),
            _tao_marshaled_exception,
            0,
            0,
            _tao_in.char_translator (),
            _tao_in.wchar_translator ())
          );
        
      ::Messaging::ExceptionHolder_var exception_holder_var = exception_holder_ptr;
      _tao_reply_handler_object->get_price_and_names_excep (
          exception_holder_var
        );
      break;
    }
    case TAO_AMI_REPLY_NOT_OK:
      // @@ Michael: Not even the spec mentions this case.
      //             We have to think about this case.
      break;
  }
}

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

void
Quoter::AMI_Single_Query_StockHandler::get_price_and_names_excep (
  ::Messaging::ExceptionHolder * excep_holder)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::Messaging::ExceptionHolder>::in_arg_val _tao_excep_holder (excep_holder);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "get_price_and_names_excep",
      25,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (0, 0);
}

Quoter::AMI_Single_Query_StockHandler::AMI_Single_Query_StockHandler (void)
{
}

Quoter::AMI_Single_Query_StockHandler::~AMI_Single_Query_StockHandler (void)
{
}

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

Quoter::AMI_Single_Query_StockHandler_ptr
Quoter::AMI_Single_Query_StockHandler::_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<AMI_Single_Query_StockHandler>::narrow (
        _tao_objref,
        "IDL:Quoter/AMI_Single_Query_StockHandler:1.0");
}

Quoter::AMI_Single_Query_StockHandler_ptr
Quoter::AMI_Single_Query_StockHandler::_unchecked_narrow (
    ::CORBA::Object_ptr _tao_objref)
{
  return
    TAO::Narrow_Utils<AMI_Single_Query_StockHandler>::unchecked_narrow (
        _tao_objref);
}

Quoter::AMI_Single_Query_StockHandler_ptr
Quoter::AMI_Single_Query_StockHandler::_nil (void)
{
  return 0;
}

Quoter::AMI_Single_Query_StockHandler_ptr
Quoter::AMI_Single_Query_StockHandler::_duplicate (AMI_Single_Query_StockHandler_ptr obj)
{
  if (! ::CORBA::is_nil (obj))
    {
      obj->_add_ref ();
    }
  return obj;
}

void
Quoter::AMI_Single_Query_StockHandler::_tao_release (AMI_Single_Query_StockHandler_ptr obj)
{
  ::CORBA::release (obj);
}

::CORBA::Boolean
Quoter::AMI_Single_Query_StockHandler::_is_a (const char *value)
{
  if (
      ACE_OS::strcmp (
          value,
          "IDL:omg.org/Messaging/ReplyHandler:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:Quoter/AMI_StockHandler:1.0"
        ) == 0 ||
      ACE_OS::strcmp (
          value,
          "IDL:Quoter/AMI_Single_Query_StockHandler: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* Quoter::AMI_Single_Query_StockHandler::_interface_repository_id (void) const
{
  return "IDL:Quoter/AMI_Single_Query_StockHandler:1.0";
}

::CORBA::Boolean
Quoter::AMI_Single_Query_StockHandler::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_Quoter_AMI_Single_Query_StockHandler (
    ::CORBA::tk_objref,
    "IDL:Quoter/AMI_Single_Query_StockHandler:1.0",
    "AMI_Single_Query_StockHandler");
  

namespace Quoter
{
  ::CORBA::TypeCode_ptr const _tc_AMI_Single_Query_StockHandler =
    &_tao_tc_Quoter_AMI_Single_Query_StockHandler;
}

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



namespace TAO
{
  template<>
  ::CORBA::Boolean
  Any_Dual_Impl_T<Quoter::Invalid_Stock_Symbol>::demarshal_value (TAO_InputCDR & cdr)
  {
    ::CORBA::String_var id;

    if (!(cdr >> id.out ()))
      {
        return false;
      }
    
    try
      {
        this->value_->_tao_decode (cdr);
      }
    catch (const ::CORBA::Exception &)
      {
        return false;
      }

    return true;
  }
}
TAO_END_VERSIONED_NAMESPACE_DECL



#if defined (ACE_ANY_OPS_USE_NAMESPACE)

namespace Quoter
{
  

  // Copying insertion.
  void operator<<= (
      ::CORBA::Any &_tao_any,
      const ::Quoter::Invalid_Stock_Symbol &_tao_elem)
  {
    TAO::Any_Dual_Impl_T< ::Quoter::Invalid_Stock_Symbol>::insert_copy (
        _tao_any,
        ::Quoter::Invalid_Stock_Symbol::_tao_any_destructor,
        ::Quoter::_tc_Invalid_Stock_Symbol,
        _tao_elem);
  }

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

  // Extraction to non-const pointer (deprecated).
  ::CORBA::Boolean operator>>= (
      const ::CORBA::Any &_tao_any,
      ::Quoter::Invalid_Stock_Symbol *&_tao_elem)
  {
    return _tao_any >>= const_cast<
        const ::Quoter::Invalid_Stock_Symbol *&> (
        _tao_elem);
  }

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

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



// Copying insertion.
void operator<<= (
    ::CORBA::Any &_tao_any,
    const Quoter::Invalid_Stock_Symbol &_tao_elem)
{
  TAO::Any_Dual_Impl_T<Quoter::Invalid_Stock_Symbol>::insert_copy (
      _tao_any,
      Quoter::Invalid_Stock_Symbol::_tao_any_destructor,
      Quoter::_tc_Invalid_Stock_Symbol,
      _tao_elem
    );
}

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

// Extraction to non-const pointer (deprecated).
::CORBA::Boolean operator>>= (
    const ::CORBA::Any &_tao_any,
    Quoter::Invalid_Stock_Symbol *&_tao_elem)
{
  return _tao_any >>= const_cast<
      const Quoter::Invalid_Stock_Symbol *&> (
      _tao_elem);
}

// Extraction to const pointer.
::CORBA::Boolean operator>>= (
    const ::CORBA::Any &_tao_any,
    const Quoter::Invalid_Stock_Symbol *&_tao_elem
  )
{
  return
    TAO::Any_Dual_Impl_T<Quoter::Invalid_Stock_Symbol>::extract (
        _tao_any,
        Quoter::Invalid_Stock_Symbol::_tao_any_destructor,
        Quoter::_tc_Invalid_Stock_Symbol,
        _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<Quoter::Stock_Factory>::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 Quoter
{
  

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

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      Stock_Factory_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<Stock_Factory>::extract (
          _tao_any,
          Stock_Factory::_tao_any_destructor,
          _tc_Stock_Factory,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Quoter::Stock_Factory_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Quoter::Stock_Factory>::extract (
        _tao_any,
        Quoter::Stock_Factory::_tao_any_destructor,
        Quoter::_tc_Stock_Factory,
        _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<Quoter::AMI_Stock_FactoryHandler>::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 Quoter
{
  

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

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      AMI_Stock_FactoryHandler_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<AMI_Stock_FactoryHandler>::extract (
          _tao_any,
          AMI_Stock_FactoryHandler::_tao_any_destructor,
          _tc_AMI_Stock_FactoryHandler,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Quoter::AMI_Stock_FactoryHandler_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Quoter::AMI_Stock_FactoryHandler>::extract (
        _tao_any,
        Quoter::AMI_Stock_FactoryHandler::_tao_any_destructor,
        Quoter::_tc_AMI_Stock_FactoryHandler,
        _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<Quoter::Stock>::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 Quoter
{
  

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

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

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

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Quoter::Stock_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Quoter::Stock>::extract (
        _tao_any,
        Quoter::Stock::_tao_any_destructor,
        Quoter::_tc_Stock,
        _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<Quoter::AMI_StockHandler>::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 Quoter
{
  

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

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      AMI_StockHandler_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<AMI_StockHandler>::extract (
          _tao_any,
          AMI_StockHandler::_tao_any_destructor,
          _tc_AMI_StockHandler,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Quoter::AMI_StockHandler_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Quoter::AMI_StockHandler>::extract (
        _tao_any,
        Quoter::AMI_StockHandler::_tao_any_destructor,
        Quoter::_tc_AMI_StockHandler,
        _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<Quoter::Single_Query_Stock>::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 Quoter
{
  

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

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      Single_Query_Stock_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<Single_Query_Stock>::extract (
          _tao_any,
          Single_Query_Stock::_tao_any_destructor,
          _tc_Single_Query_Stock,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Quoter::Single_Query_Stock_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Quoter::Single_Query_Stock>::extract (
        _tao_any,
        Quoter::Single_Query_Stock::_tao_any_destructor,
        Quoter::_tc_Single_Query_Stock,
        _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<Quoter::AMI_Single_Query_StockHandler>::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 Quoter
{
  

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

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      AMI_Single_Query_StockHandler_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<AMI_Single_Query_StockHandler>::extract (
          _tao_any,
          AMI_Single_Query_StockHandler::_tao_any_destructor,
          _tc_AMI_Single_Query_StockHandler,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Quoter::AMI_Single_Query_StockHandler_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Quoter::AMI_Single_Query_StockHandler>::extract (
        _tao_any,
        Quoter::AMI_Single_Query_StockHandler::_tao_any_destructor,
        Quoter::_tc_AMI_Single_Query_StockHandler,
        _tao_elem);
}

TAO_END_VERSIONED_NAMESPACE_DECL



#endif

// TAO_IDL - Generated from
// be/be_visitor_exception/cdr_op_cs.cpp:48
TAO_BEGIN_VERSIONED_NAMESPACE_DECL



::CORBA::Boolean operator<< (
    TAO_OutputCDR &strm,
    const Quoter::Invalid_Stock_Symbol &_tao_aggregate
  )
{
  // Marshal the repository ID.
  return (strm << _tao_aggregate._rep_id ());
}

::CORBA::Boolean operator>> (
    TAO_InputCDR &,
    Quoter::Invalid_Stock_Symbol&
  )
{
  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 Quoter::Stock_Factory_ptr _tao_objref)
{
  ::CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

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

  if (!(strm >> obj.inout ()))
    {
      return false;
    }
  
  typedef ::Quoter::Stock_Factory 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 Quoter::AMI_Stock_FactoryHandler_ptr _tao_objref)
{
  ::CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

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

  if (!(strm >> obj.inout ()))
    {
      return false;
    }
  
  typedef ::Quoter::AMI_Stock_FactoryHandler 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 Quoter::Stock_ptr _tao_objref)
{
  ::CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

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

  if (!(strm >> obj.inout ()))
    {
      return false;
    }
  
  typedef ::Quoter::Stock 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 Quoter::AMI_StockHandler_ptr _tao_objref)
{
  ::CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

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

  if (!(strm >> obj.inout ()))
    {
      return false;
    }
  
  typedef ::Quoter::AMI_StockHandler 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 Quoter::Single_Query_Stock_ptr _tao_objref)
{
  ::CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

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

  if (!(strm >> obj.inout ()))
    {
      return false;
    }
  
  typedef ::Quoter::Single_Query_Stock 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 Quoter::AMI_Single_Query_StockHandler_ptr _tao_objref)
{
  ::CORBA::Object_ptr _tao_corba_obj = _tao_objref;
  return (strm << _tao_corba_obj);
}

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

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



