// -*- 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 "CommonC.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/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 "CommonC.inl"
#endif /* !defined INLINE */

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

Stock::Invalid_Stock::Invalid_Stock (void)
  : ::CORBA::UserException (
        "IDL:Stock/Invalid_Stock:1.0",
        "Invalid_Stock"
      )
{
}

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

Stock::Invalid_Stock::Invalid_Stock (const ::Stock::Invalid_Stock &_tao_excp)
  : ::CORBA::UserException (
        _tao_excp._rep_id (),
        _tao_excp._name ()
      )
{
}

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

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

Stock::Invalid_Stock *
Stock::Invalid_Stock::_downcast ( ::CORBA::Exception *_tao_excp)
{
  return dynamic_cast<Invalid_Stock *> (_tao_excp);
}

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

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

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

void Stock::Invalid_Stock::_raise (void) const
{
  throw *this;
}

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

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

// TAO extension - the virtual _type method.
::CORBA::TypeCode_ptr Stock::Invalid_Stock::_tao_type (void) const
{
  return ::Stock::_tc_Invalid_Stock;
}

// 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_Stock_Invalid_Stock = 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_Stock_Invalid_Stock (
  ::CORBA::tk_except,
  "IDL:Stock/Invalid_Stock:1.0",
  "Invalid_Stock",
  _tao_fields_Stock_Invalid_Stock,
  0);


namespace Stock
{
  ::CORBA::TypeCode_ptr const _tc_Invalid_Stock =
    &_tao_tc_Stock_Invalid_Stock;
}

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

static TAO::TypeCode::Struct_Field<
  char const *,
  ::CORBA::TypeCode_ptr const *> const 
    _tao_fields_Stock_StockInfo[] =
      {
        { "name", &CORBA::_tc_string },
        { "high", &CORBA::_tc_long },
        { "low", &CORBA::_tc_long },
        { "last", &CORBA::_tc_long }
      };
  
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_Stock_StockInfo (
  ::CORBA::tk_struct,
  "IDL:Stock/StockInfo:1.0",
  "StockInfo",
  _tao_fields_Stock_StockInfo,
  4);


namespace Stock
{
  ::CORBA::TypeCode_ptr const _tc_StockInfo =
    &_tao_tc_Stock_StockInfo;
}

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

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

// TAO_IDL - Generated from
// be/be_visitor_typecode/value_typecode.cpp:65



// TAO_IDL - Generated from
// be/be_visitor_typecode/typecode_defn.cpp:461

static TAO::TypeCode::Value_Field<char const *, ::CORBA::TypeCode_ptr const *> const _tao_fields_Stock_StockNames[] =
  {
    { "names", &CORBA::_tc_StringSeq, ::CORBA::PUBLIC_MEMBER }
    
  };
static TAO::TypeCode::Value<char const *,
                     ::CORBA::TypeCode_ptr const *,
                     TAO::TypeCode::Value_Field<char const *, ::CORBA::TypeCode_ptr const *> const *,
                     TAO::Null_RefCount_Policy>
  _tao_tc_Stock_StockNames (
    ::CORBA::tk_value,
    "IDL:Stock/StockNames:1.0",
    "StockNames",
    ::CORBA::VM_NONE,
    &::CORBA::_tc_null,
    _tao_fields_Stock_StockNames,
    1);
  

namespace Stock
{
  ::CORBA::TypeCode_ptr const _tc_StockNames =
    &_tao_tc_Stock_StockNames;
}

// TAO_IDL - Generated from
// be/be_visitor_valuetype/valuetype_cs.cpp:53

void
TAO::Value_Traits<Stock::StockNames>::add_ref (
    Stock::StockNames * p)
{
  ::CORBA::add_ref (p);
}

void
TAO::Value_Traits<Stock::StockNames>::remove_ref (
    Stock::StockNames * p)
{
  ::CORBA::remove_ref (p);
}

void
TAO::Value_Traits<Stock::StockNames>::release (
    Stock::StockNames * p)
{
  ::CORBA::remove_ref (p);
}

Stock::StockNames *
Stock::StockNames::_downcast ( ::CORBA::ValueBase *v)
{
  return dynamic_cast< ::Stock::StockNames * > (v);
}

const char *
Stock::StockNames::_tao_obv_repository_id (void) const
{
  return this->_tao_obv_static_repository_id ();
}

void
Stock::StockNames::_tao_obv_truncatable_repo_ids (Repository_Id_List& ids) const
{
  ids.push_back (this->_tao_obv_static_repository_id ());
}

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

// TAO extension - the virtual _type method.
::CORBA::TypeCode_ptr Stock::StockNames::_tao_type (void) const
{
  return ::Stock::_tc_StockNames;
}

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

::CORBA::Boolean
Stock::StockNames::_tao_marshal_v (TAO_OutputCDR & strm) const
{
  TAO_ChunkInfo ci (this->is_truncatable_ || this->chunking_);
  return this->_tao_marshal__Stock_StockNames (strm, ci);
}

::CORBA::Boolean
Stock::StockNames::_tao_unmarshal_v (TAO_InputCDR & strm)
{
  TAO_ChunkInfo ci (this->is_truncatable_ || this->chunking_, 1);
  return this->_tao_unmarshal__Stock_StockNames (strm,ci);
}

::CORBA::Boolean
Stock::StockNames::_tao_match_formal_type (ptrdiff_t formal_type_id) const
{
  return formal_type_id == reinterpret_cast<ptrdiff_t> (Stock::StockNames::_downcast);
}

::CORBA::Boolean
Stock::StockNames::_tao_unmarshal (
    TAO_InputCDR &strm,
    StockNames *&new_object
  )
{
  ::CORBA::ValueBase *base = 0;
  ::CORBA::Boolean is_indirected = false;
  ::CORBA::Boolean is_null_object = false;
  ::CORBA::Boolean const retval =
    ::CORBA::ValueBase::_tao_unmarshal_pre (
        strm,
        base,
        StockNames::_tao_obv_static_repository_id (),
        is_null_object,
        is_indirected
      );
  
  ::CORBA::ValueBase_var owner (base);

  if (!retval)
    return false;
  
  if (is_null_object)
    return true;
  
  if (!is_indirected && !base->_tao_unmarshal_v (strm))
    return false;
  
  // Now base must point to the unmarshaled object.
  // Align the pointer to the right subobject.
  new_object = StockNames::_downcast (base);
  if (0 == new_object)
    return false;
  
  if (is_indirected)
    new_object->_add_ref ();
  
  owner._retn ();
  return true;
}

// TAO_IDL - Generated from
// be/be_visitor_valuetype/valuetype_init_cs.cpp:73

Stock::StockNames_init::StockNames_init (void)
{
}

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

Stock::StockNames_init *
Stock::StockNames_init::_downcast ( ::CORBA::ValueFactoryBase *v)
{
  return dynamic_cast< ::Stock::StockNames_init * > (v);
}

const char*
Stock::StockNames_init::tao_repository_id (void)
{
  return ::Stock::StockNames::_tao_obv_static_repository_id ();
}

::CORBA::ValueBase *
Stock::StockNames_init::create_for_unmarshal (void)
{
  ::CORBA::ValueBase *ret_val = 0;
  ACE_NEW_THROW_EX (
      ret_val,
      OBV_Stock::StockNames,
      ::CORBA::NO_MEMORY ()
    );
  return ret_val;
}

// TAO_IDL - Generated from
// be/be_visitor_typecode/value_typecode.cpp:65

static TAO::TypeCode::Value_Field<char const *, ::CORBA::TypeCode_ptr const *> const _tao_fields_Stock_Cookie[] =
  {
    { "cookie_id", &CORBA::_tc_string, ::CORBA::PUBLIC_MEMBER }
    
  };
static TAO::TypeCode::Value<char const *,
                     ::CORBA::TypeCode_ptr const *,
                     TAO::TypeCode::Value_Field<char const *, ::CORBA::TypeCode_ptr const *> const *,
                     TAO::Null_RefCount_Policy>
  _tao_tc_Stock_Cookie (
    ::CORBA::tk_value,
    "IDL:Stock/Cookie:1.0",
    "Cookie",
    ::CORBA::VM_NONE,
    &::CORBA::_tc_null,
    _tao_fields_Stock_Cookie,
    1);
  

namespace Stock
{
  ::CORBA::TypeCode_ptr const _tc_Cookie =
    &_tao_tc_Stock_Cookie;
}

// TAO_IDL - Generated from
// be/be_visitor_valuetype/valuetype_cs.cpp:53

void
TAO::Value_Traits<Stock::Cookie>::add_ref (
    Stock::Cookie * p)
{
  ::CORBA::add_ref (p);
}

void
TAO::Value_Traits<Stock::Cookie>::remove_ref (
    Stock::Cookie * p)
{
  ::CORBA::remove_ref (p);
}

void
TAO::Value_Traits<Stock::Cookie>::release (
    Stock::Cookie * p)
{
  ::CORBA::remove_ref (p);
}

Stock::Cookie *
Stock::Cookie::_downcast ( ::CORBA::ValueBase *v)
{
  return dynamic_cast< ::Stock::Cookie * > (v);
}

const char *
Stock::Cookie::_tao_obv_repository_id (void) const
{
  return this->_tao_obv_static_repository_id ();
}

void
Stock::Cookie::_tao_obv_truncatable_repo_ids (Repository_Id_List& ids) const
{
  ids.push_back (this->_tao_obv_static_repository_id ());
}

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

// TAO extension - the virtual _type method.
::CORBA::TypeCode_ptr Stock::Cookie::_tao_type (void) const
{
  return ::Stock::_tc_Cookie;
}

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

::CORBA::Boolean
Stock::Cookie::_tao_marshal_v (TAO_OutputCDR & strm) const
{
  TAO_ChunkInfo ci (this->is_truncatable_ || this->chunking_);
  return this->_tao_marshal__Stock_Cookie (strm, ci);
}

::CORBA::Boolean
Stock::Cookie::_tao_unmarshal_v (TAO_InputCDR & strm)
{
  TAO_ChunkInfo ci (this->is_truncatable_ || this->chunking_, 1);
  return this->_tao_unmarshal__Stock_Cookie (strm,ci);
}

::CORBA::Boolean
Stock::Cookie::_tao_match_formal_type (ptrdiff_t formal_type_id) const
{
  return formal_type_id == reinterpret_cast<ptrdiff_t> (Stock::Cookie::_downcast);
}

::CORBA::Boolean
Stock::Cookie::_tao_unmarshal (
    TAO_InputCDR &strm,
    Cookie *&new_object
  )
{
  ::CORBA::ValueBase *base = 0;
  ::CORBA::Boolean is_indirected = false;
  ::CORBA::Boolean is_null_object = false;
  ::CORBA::Boolean const retval =
    ::CORBA::ValueBase::_tao_unmarshal_pre (
        strm,
        base,
        Cookie::_tao_obv_static_repository_id (),
        is_null_object,
        is_indirected
      );
  
  ::CORBA::ValueBase_var owner (base);

  if (!retval)
    return false;
  
  if (is_null_object)
    return true;
  
  if (!is_indirected && !base->_tao_unmarshal_v (strm))
    return false;
  
  // Now base must point to the unmarshaled object.
  // Align the pointer to the right subobject.
  new_object = Cookie::_downcast (base);
  if (0 == new_object)
    return false;
  
  if (is_indirected)
    new_object->_add_ref ();
  
  owner._retn ();
  return true;
}

// TAO_IDL - Generated from
// be/be_visitor_valuetype/valuetype_init_cs.cpp:73

Stock::Cookie_init::Cookie_init (void)
{
}

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

Stock::Cookie_init *
Stock::Cookie_init::_downcast ( ::CORBA::ValueFactoryBase *v)
{
  return dynamic_cast< ::Stock::Cookie_init * > (v);
}

const char*
Stock::Cookie_init::tao_repository_id (void)
{
  return ::Stock::Cookie::_tao_obv_static_repository_id ();
}

::CORBA::ValueBase *
Stock::Cookie_init::create_for_unmarshal (void)
{
  ::CORBA::ValueBase *ret_val = 0;
  ACE_NEW_THROW_EX (
      ret_val,
      OBV_Stock::Cookie,
      ::CORBA::NO_MEMORY ()
    );
  return ret_val;
}

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

// Traits specializations for Stock::Trigger.

Stock::Trigger_ptr
TAO::Objref_Traits<Stock::Trigger>::duplicate (
    Stock::Trigger_ptr p)
{
  return Stock::Trigger::_duplicate (p);
}

void
TAO::Objref_Traits<Stock::Trigger>::release (
    Stock::Trigger_ptr p)
{
  ::CORBA::release (p);
}

Stock::Trigger_ptr
TAO::Objref_Traits<Stock::Trigger>::nil (void)
{
  return Stock::Trigger::_nil ();
}

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

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

void
Stock::Trigger::start (
  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,
      "start",
      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);
}

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

void
Stock::Trigger::stop (
  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,
      "stop",
      4,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY,
      TAO::TAO_TWOWAY_INVOCATION
      ,
      TAO::TAO_SYNCHRONOUS_INVOCATION,
      false
    );

  _tao_call.invoke (0, 0);
}

Stock::Trigger::Trigger (void)
{
}

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

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

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

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

Stock::Trigger_ptr
Stock::Trigger::_nil (void)
{
  return 0;
}

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

void
Stock::Trigger::_tao_release (Trigger_ptr obj)
{
  ::CORBA::release (obj);
}

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

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

namespace Stock
{
  ::CORBA::TypeCode_ptr const _tc_Trigger =
    &_tao_tc_Stock_Trigger;
}

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

// Traits specializations for Stock::StockNameConsumer.

Stock::StockNameConsumer_ptr
TAO::Objref_Traits<Stock::StockNameConsumer>::duplicate (
    Stock::StockNameConsumer_ptr p)
{
  return Stock::StockNameConsumer::_duplicate (p);
}

void
TAO::Objref_Traits<Stock::StockNameConsumer>::release (
    Stock::StockNameConsumer_ptr p)
{
  ::CORBA::release (p);
}

Stock::StockNameConsumer_ptr
TAO::Objref_Traits<Stock::StockNameConsumer>::nil (void)
{
  return Stock::StockNameConsumer::_nil ();
}

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

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

void
Stock::StockNameConsumer::push_StockName (
  ::Stock::StockNames * the_stocknames)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::Stock::StockNames>::in_arg_val _tao_the_stocknames (the_stocknames);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "push_StockName",
      14,
      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::Cookie *
Stock::StockNameConsumer::cookie_ (
  void)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< ::Stock::Cookie>::ret_val _tao_retval;

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      1,
      "_get_cookie_",
      12,
      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::StockNameConsumer::cookie_ (
  ::Stock::Cookie * cookie_)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< void>::ret_val _tao_retval;
  TAO::Arg_Traits< ::Stock::Cookie>::in_arg_val _tao_cookie_ (cookie_);

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

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "_set_cookie_",
      12,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (0, 0);
}

Stock::StockNameConsumer::StockNameConsumer (void)
{
}

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

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

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

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

Stock::StockNameConsumer_ptr
Stock::StockNameConsumer::_nil (void)
{
  return 0;
}

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

void
Stock::StockNameConsumer::_tao_release (StockNameConsumer_ptr obj)
{
  ::CORBA::release (obj);
}

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

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

namespace Stock
{
  ::CORBA::TypeCode_ptr const _tc_StockNameConsumer =
    &_tao_tc_Stock_StockNameConsumer;
}

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

// Traits specializations for Stock::StockQuoter.

Stock::StockQuoter_ptr
TAO::Objref_Traits<Stock::StockQuoter>::duplicate (
    Stock::StockQuoter_ptr p)
{
  return Stock::StockQuoter::_duplicate (p);
}

void
TAO::Objref_Traits<Stock::StockQuoter>::release (
    Stock::StockQuoter_ptr p)
{
  ::CORBA::release (p);
}

Stock::StockQuoter_ptr
TAO::Objref_Traits<Stock::StockQuoter>::nil (void)
{
  return Stock::StockQuoter::_nil ();
}

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

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

::Stock::StockInfo *
Stock::StockQuoter::get_stock_info (
  const char * stock_name)
{
  if (!this->is_evaluated ())
    {
      ::CORBA::Object::tao_object_initialize (this);
    }
  
  TAO::Arg_Traits< ::Stock::StockInfo>::ret_val _tao_retval;
  TAO::Arg_Traits< char *>::in_arg_val _tao_stock_name (stock_name);

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

  static TAO::Exception_Data
  _tao_Stock_StockQuoter_get_stock_info_exceptiondata [] = 
    {
      {
        "IDL:Stock/Invalid_Stock:1.0",
        Stock::Invalid_Stock::_alloc
#if TAO_HAS_INTERCEPTORS == 1
        , Stock::_tc_Invalid_Stock
#endif /* TAO_HAS_INTERCEPTORS */
      }
    };

  TAO::Invocation_Adapter _tao_call (
      this,
      _the_tao_operation_signature,
      2,
      "get_stock_info",
      14,
      TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY
      
    );

  _tao_call.invoke (
      _tao_Stock_StockQuoter_get_stock_info_exceptiondata,
      1
    );

  return _tao_retval.retn ();
}

Stock::StockQuoter::StockQuoter (void)
{
}

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

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

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

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

Stock::StockQuoter_ptr
Stock::StockQuoter::_nil (void)
{
  return 0;
}

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

void
Stock::StockQuoter::_tao_release (StockQuoter_ptr obj)
{
  ::CORBA::release (obj);
}

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

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

namespace Stock
{
  ::CORBA::TypeCode_ptr const _tc_StockQuoter =
    &_tao_tc_Stock_StockQuoter;
}

// TAO_IDL - Generated from
// be/be_visitor_valuetype/valuetype_obv_cs.cpp:44

OBV_Stock::StockNames::StockNames (void)
: require_truncation_ (false)
{}

OBV_Stock::StockNames::StockNames (
    const ::CORBA::StringSeq & _tao_init_names)
: require_truncation_ (false)
{
  names (_tao_init_names);
}

OBV_Stock::StockNames::~StockNames (void)
{}

::CORBA::ValueBase *
OBV_Stock::StockNames::_copy_value (void)
{
  ::CORBA::ValueBase *ret_val = 0;
  ACE_NEW_THROW_EX (
    ret_val,
    StockNames (
      names ()
    ),
    ::CORBA::NO_MEMORY ()
  );
  return ret_val;
}

::CORBA::Boolean
OBV_Stock::StockNames::_tao_marshal__Stock_StockNames (TAO_OutputCDR &strm, TAO_ChunkInfo& ci) const
{
  return _tao_marshal_state (strm, ci);
}

::CORBA::Boolean
OBV_Stock::StockNames::_tao_unmarshal__Stock_StockNames (TAO_InputCDR &strm, TAO_ChunkInfo& ci)
{
  return _tao_unmarshal_state (strm, ci);
}

// TAO_IDL - Generated from
// be/be_visitor_valuetype/field_cs.cpp:762

/// Accessor to set the member.
void
OBV_Stock::StockNames::names (const CORBA::StringSeq &val)
{
  this->_pd_names = val;
}

/// Readonly get method.
const CORBA::StringSeq &
OBV_Stock::StockNames::names (void) const
{
  return this->_pd_names;
}

/// Read/write get method.
CORBA::StringSeq &
OBV_Stock::StockNames::names (void)
{
  return this->_pd_names;
}

// TAO_IDL - Generated from
// be/be_visitor_valuetype/valuetype_obv_cs.cpp:44

OBV_Stock::Cookie::Cookie (void)
: require_truncation_ (false)
{}

OBV_Stock::Cookie::Cookie (
    const char * _tao_init_cookie_id)
: require_truncation_ (false)
{
  cookie_id (_tao_init_cookie_id);
}

OBV_Stock::Cookie::~Cookie (void)
{}

::CORBA::ValueBase *
OBV_Stock::Cookie::_copy_value (void)
{
  ::CORBA::ValueBase *ret_val = 0;
  ACE_NEW_THROW_EX (
    ret_val,
    Cookie (
      cookie_id ()
    ),
    ::CORBA::NO_MEMORY ()
  );
  return ret_val;
}

::CORBA::Boolean
OBV_Stock::Cookie::_tao_marshal__Stock_Cookie (TAO_OutputCDR &strm, TAO_ChunkInfo& ci) const
{
  return _tao_marshal_state (strm, ci);
}

::CORBA::Boolean
OBV_Stock::Cookie::_tao_unmarshal__Stock_Cookie (TAO_InputCDR &strm, TAO_ChunkInfo& ci)
{
  return _tao_unmarshal_state (strm, ci);
}

// TAO_IDL - Generated from
// be/be_visitor_valuetype/field_cs.cpp:834

/// Accessor to set the member.
void
OBV_Stock::Cookie::cookie_id (char *val)
{
  this->_pd_cookie_id = (val);
}

/// Accessor to set the member.
void
OBV_Stock::Cookie::cookie_id (const char *val)
{
  // Set the value.
  this->_pd_cookie_id = ::CORBA::string_dup (val);
}

/// Accessor to set the member.
void
OBV_Stock::Cookie::cookie_id (const ::CORBA::String_var &val)
{
  ::CORBA::String_var cookie_id_var = val;
  this->_pd_cookie_id = cookie_id_var._retn ();
}

const char *
OBV_Stock::Cookie::cookie_id (void) const // get method
{
  return this->_pd_cookie_id;
}

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

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

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

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

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

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

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

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



#endif

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



#if defined (ACE_ANY_OPS_USE_NAMESPACE)

namespace Stock
{
  /// Copying insertion.
  void operator<<= (
      ::CORBA::Any &_tao_any,
      const ::Stock::StockInfo &_tao_elem)
  {
    if (0 == &_tao_elem) // Trying to de-reference NULL object
      _tao_any <<= static_cast< ::Stock::StockInfo *>( 0 ); // Use non-copying insertion of a NULL
    else
      TAO::Any_Dual_Impl_T< ::Stock::StockInfo>::insert_copy (
          _tao_any,
          ::Stock::StockInfo::_tao_any_destructor,
          ::Stock::_tc_StockInfo,
          _tao_elem);
  }

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

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

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

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

/// Copying insertion.
void operator<<= (
  ::CORBA::Any &_tao_any,
  const Stock::StockInfo &_tao_elem)
{
  if (0 == &_tao_elem) // Trying to de-reference NULL object
    _tao_any <<= static_cast<Stock::StockInfo *>( 0 ); // Use non-copying insertion of a NULL
  else
    TAO::Any_Dual_Impl_T<Stock::StockInfo>::insert_copy (
      _tao_any,
      Stock::StockInfo::_tao_any_destructor,
      Stock::_tc_StockInfo,
      _tao_elem);
}

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

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

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



#endif

// TAO_IDL - Generated from
// be/be_visitor_valuetype/any_op_cs.cpp:45
TAO_BEGIN_VERSIONED_NAMESPACE_DECL



namespace TAO
{
  template<>
  ::CORBA::Boolean
  Any_Impl_T<Stock::StockNames>::to_value (
      ::CORBA::ValueBase *&_tao_elem
    ) const
  {
    ::CORBA::add_ref (this->value_);
    _tao_elem = 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,
      StockNames *_tao_elem
    )
  {
    #ifdef TAO_VALUETYPE_COPYING_ANY_INSERTION_USES_COPY_VALUE
      StockNames *_tao_copy =
        _tao_elem ?
          StockNames::_downcast (_tao_elem->_copy_value ())
          : 0;
      _tao_any <<= &_tao_copy;
    #else
      ::CORBA::add_ref (_tao_elem);
      _tao_any <<= &_tao_elem;
    #endif
  }

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      StockNames *&_tao_elem
    )
  {
    return
      TAO::Any_Impl_T<StockNames>::extract (
          _tao_any,
          StockNames::_tao_any_destructor,
          _tc_StockNames,
          _tao_elem
        );
  }

  
}

#else


TAO_BEGIN_VERSIONED_NAMESPACE_DECL

// Copying insertion.
void
operator<<= (
    ::CORBA::Any &_tao_any,
    Stock::StockNames *_tao_elem
  )
{
  #ifdef TAO_VALUETYPE_COPYING_ANY_INSERTION_USES_COPY_VALUE
    Stock::StockNames *_tao_copy =
      _tao_elem ?
        Stock::StockNames::_downcast (_tao_elem->_copy_value ())
        : 0;
    _tao_any <<= &_tao_copy;
  #else
    ::CORBA::add_ref (_tao_elem);
    _tao_any <<= &_tao_elem;
  #endif
}

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

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


TAO_END_VERSIONED_NAMESPACE_DECL



#endif

// TAO_IDL - Generated from
// be/be_visitor_valuetype/any_op_cs.cpp:45
TAO_BEGIN_VERSIONED_NAMESPACE_DECL



namespace TAO
{
  template<>
  ::CORBA::Boolean
  Any_Impl_T<Stock::Cookie>::to_value (
      ::CORBA::ValueBase *&_tao_elem
    ) const
  {
    ::CORBA::add_ref (this->value_);
    _tao_elem = 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,
      Cookie *_tao_elem
    )
  {
    #ifdef TAO_VALUETYPE_COPYING_ANY_INSERTION_USES_COPY_VALUE
      Cookie *_tao_copy =
        _tao_elem ?
          Cookie::_downcast (_tao_elem->_copy_value ())
          : 0;
      _tao_any <<= &_tao_copy;
    #else
      ::CORBA::add_ref (_tao_elem);
      _tao_any <<= &_tao_elem;
    #endif
  }

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      Cookie *&_tao_elem
    )
  {
    return
      TAO::Any_Impl_T<Cookie>::extract (
          _tao_any,
          Cookie::_tao_any_destructor,
          _tc_Cookie,
          _tao_elem
        );
  }

  
}

#else


TAO_BEGIN_VERSIONED_NAMESPACE_DECL

// Copying insertion.
void
operator<<= (
    ::CORBA::Any &_tao_any,
    Stock::Cookie *_tao_elem
  )
{
  #ifdef TAO_VALUETYPE_COPYING_ANY_INSERTION_USES_COPY_VALUE
    Stock::Cookie *_tao_copy =
      _tao_elem ?
        Stock::Cookie::_downcast (_tao_elem->_copy_value ())
        : 0;
    _tao_any <<= &_tao_copy;
  #else
    ::CORBA::add_ref (_tao_elem);
    _tao_any <<= &_tao_elem;
  #endif
}

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Stock::Cookie *&_tao_elem
  )
{
  return
    TAO::Any_Impl_T<Stock::Cookie>::extract (
        _tao_any,
        Stock::Cookie::_tao_any_destructor,
        Stock::_tc_Cookie,
        _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::Trigger>::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,
      Trigger_ptr _tao_elem)
  {
    Trigger_ptr _tao_objptr =
      Trigger::_duplicate (_tao_elem);
    _tao_any <<= &_tao_objptr;
  }

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      Trigger_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<Trigger>::extract (
          _tao_any,
          Trigger::_tao_any_destructor,
          _tc_Trigger,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Stock::Trigger_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Stock::Trigger>::extract (
        _tao_any,
        Stock::Trigger::_tao_any_destructor,
        Stock::_tc_Trigger,
        _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::StockNameConsumer>::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,
      StockNameConsumer_ptr _tao_elem)
  {
    StockNameConsumer_ptr _tao_objptr =
      StockNameConsumer::_duplicate (_tao_elem);
    _tao_any <<= &_tao_objptr;
  }

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      StockNameConsumer_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<StockNameConsumer>::extract (
          _tao_any,
          StockNameConsumer::_tao_any_destructor,
          _tc_StockNameConsumer,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Stock::StockNameConsumer_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Stock::StockNameConsumer>::extract (
        _tao_any,
        Stock::StockNameConsumer::_tao_any_destructor,
        Stock::_tc_StockNameConsumer,
        _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::StockQuoter>::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,
      StockQuoter_ptr _tao_elem)
  {
    StockQuoter_ptr _tao_objptr =
      StockQuoter::_duplicate (_tao_elem);
    _tao_any <<= &_tao_objptr;
  }

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

  ::CORBA::Boolean
  operator>>= (
      const ::CORBA::Any &_tao_any,
      StockQuoter_ptr &_tao_elem)
  {
    return
      TAO::Any_Impl_T<StockQuoter>::extract (
          _tao_any,
          StockQuoter::_tao_any_destructor,
          _tc_StockQuoter,
          _tao_elem);
  }
}

#else

TAO_BEGIN_VERSIONED_NAMESPACE_DECL



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

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

::CORBA::Boolean
operator>>= (
    const ::CORBA::Any &_tao_any,
    Stock::StockQuoter_ptr &_tao_elem)
{
  return
    TAO::Any_Impl_T<Stock::StockQuoter>::extract (
        _tao_any,
        Stock::StockQuoter::_tao_any_destructor,
        Stock::_tc_StockQuoter,
        _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 Stock::Invalid_Stock &_tao_aggregate
  )
{
  // Marshal the repository ID.
  return (strm << _tao_aggregate._rep_id ());
}

::CORBA::Boolean operator>> (
    TAO_InputCDR &,
    Stock::Invalid_Stock&
  )
{
  return true;
}

TAO_END_VERSIONED_NAMESPACE_DECL



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

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

::CORBA::Boolean operator<< (
    TAO_OutputCDR &strm,
    const Stock::StockInfo &_tao_aggregate)
{
  return
    (strm << _tao_aggregate.name.in ()) &&
    (strm << _tao_aggregate.high) &&
    (strm << _tao_aggregate.low) &&
    (strm << _tao_aggregate.last);
}

::CORBA::Boolean operator>> (
    TAO_InputCDR &strm,
    Stock::StockInfo &_tao_aggregate)
{
  return
    (strm >> _tao_aggregate.name.out ()) &&
    (strm >> _tao_aggregate.high) &&
    (strm >> _tao_aggregate.low) &&
    (strm >> _tao_aggregate.last);
}

TAO_END_VERSIONED_NAMESPACE_DECL



// TAO_IDL - Generated from
// be/be_valuetype.cpp:512

void
CORBA::add_ref (Stock::StockNames * vt)
{
  if (vt != 0)
    {
      vt->_add_ref ();
    }
}

void
CORBA::remove_ref (Stock::StockNames * vt)
{
  if (vt != 0)
    {
      vt->_remove_ref ();
    }
}

// TAO_IDL - Generated from
// be/be_visitor_valuetype/cdr_op_cs.cpp:60


TAO_BEGIN_VERSIONED_NAMESPACE_DECL

::CORBA::Boolean
operator<< (
    TAO_OutputCDR &strm,
    const Stock::StockNames *_tao_valuetype
  )
{
  return
    ::CORBA::ValueBase::_tao_marshal (
        strm,
        _tao_valuetype,
        reinterpret_cast<ptrdiff_t> (&Stock::StockNames::_downcast)
      );
}

::CORBA::Boolean
operator>> (
    TAO_InputCDR &strm,
    Stock::StockNames *&_tao_valuetype
  )
{
  return Stock::StockNames::_tao_unmarshal (strm, _tao_valuetype);
}


TAO_END_VERSIONED_NAMESPACE_DECL

// TAO_IDL - Generated from
// be/be_visitor_valuetype/marshal_cs.cpp:33

::CORBA::Boolean
OBV_Stock::StockNames::_tao_marshal_state (TAO_OutputCDR &strm, TAO_ChunkInfo&ci) const
{
  if (! ci.start_chunk (strm))
    return false;
  
  CORBA::Boolean const ret = 
      (strm << _pd_names);
  if ( ! ret) 
    return false; 
  
  if (! ci.end_chunk (strm))
    return false;
  
  return true;
}

::CORBA::Boolean
OBV_Stock::StockNames::_tao_unmarshal_state (TAO_InputCDR &strm, TAO_ChunkInfo&ci)
{
  if (!ci.handle_chunking (strm))
    return false;
  
  CORBA::Boolean const ret = 
      (strm >> _pd_names);
  if (!ret) 
    return false; 
  
  if (this->require_truncation_)
    return ci.skip_chunks (strm);
  
  else
    return ci.handle_chunking (strm);
  
  
}

void
OBV_Stock::StockNames::truncation_hook (void)
{
  this->require_truncation_ = true;
}



// TAO_IDL - Generated from
// be/be_valuetype.cpp:512

void
CORBA::add_ref (Stock::Cookie * vt)
{
  if (vt != 0)
    {
      vt->_add_ref ();
    }
}

void
CORBA::remove_ref (Stock::Cookie * vt)
{
  if (vt != 0)
    {
      vt->_remove_ref ();
    }
}

// TAO_IDL - Generated from
// be/be_visitor_valuetype/cdr_op_cs.cpp:60


TAO_BEGIN_VERSIONED_NAMESPACE_DECL

::CORBA::Boolean
operator<< (
    TAO_OutputCDR &strm,
    const Stock::Cookie *_tao_valuetype
  )
{
  return
    ::CORBA::ValueBase::_tao_marshal (
        strm,
        _tao_valuetype,
        reinterpret_cast<ptrdiff_t> (&Stock::Cookie::_downcast)
      );
}

::CORBA::Boolean
operator>> (
    TAO_InputCDR &strm,
    Stock::Cookie *&_tao_valuetype
  )
{
  return Stock::Cookie::_tao_unmarshal (strm, _tao_valuetype);
}


TAO_END_VERSIONED_NAMESPACE_DECL

// TAO_IDL - Generated from
// be/be_visitor_valuetype/marshal_cs.cpp:33

::CORBA::Boolean
OBV_Stock::Cookie::_tao_marshal_state (TAO_OutputCDR &strm, TAO_ChunkInfo&ci) const
{
  if (! ci.start_chunk (strm))
    return false;
  
  CORBA::Boolean const ret = 
      (strm << _pd_cookie_id.in ());
  if ( ! ret) 
    return false; 
  
  if (! ci.end_chunk (strm))
    return false;
  
  return true;
}

::CORBA::Boolean
OBV_Stock::Cookie::_tao_unmarshal_state (TAO_InputCDR &strm, TAO_ChunkInfo&ci)
{
  if (!ci.handle_chunking (strm))
    return false;
  
  CORBA::Boolean const ret = 
      (strm >> _pd_cookie_id.out ());
  if (!ret) 
    return false; 
  
  if (this->require_truncation_)
    return ci.skip_chunks (strm);
  
  else
    return ci.handle_chunking (strm);
  
  
}

void
OBV_Stock::Cookie::truncation_hook (void)
{
  this->require_truncation_ = true;
}



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

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

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

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

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

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

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



