/* -*- C++ -*- $Id$ */

// ******  Code generated by the The ACE ORB (TAO) IDL Compiler *******
// TAO and the TAO IDL Compiler have been developed by the Center for
// Distributed Object Computing at Washington University, St. Louis.
//
// Information about TAO is available at:
//                 http://www.cs.wustl.edu/~schmidt/TAO.html

#include "CosNamingC.h"

#if !defined (__ACE_INLINE__)
#include "CosNamingC.i"
#endif /* !defined INLINE */

static const CORBA::Long _oc_CosNaming_Istring[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
  8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
  CORBA::tk_string, 
  0U, // string length
};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_Istring (CORBA::tk_alias, sizeof (_oc_CosNaming_Istring), (char *) &_oc_CosNaming_Istring, 0, sizeof (CosNaming::Istring));
TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)
TAO_NAMESPACE_BEGIN (CosNaming)
TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_Istring, &_tc_TAO_tc_CosNaming_Istring)
TAO_NAMESPACE_END
static const CORBA::Long _oc_CosNaming_NameComponent[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  40, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d65436f), ACE_NTOHL (0x6d706f6e), ACE_NTOHL (0x656e743a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosNaming/NameComponent:1.0
  14, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x436f6d70), ACE_NTOHL (0x6f6e656e), ACE_NTOHL (0x74000000),  // name = NameComponent
  2, // member count
  3, ACE_NTOHL (0x69640000),  // name = id
  CORBA::tk_alias, // typecode kind for typedefs
  64, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
    8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
    CORBA::tk_string, 
    0U, // string length

  5, ACE_NTOHL (0x6b696e64), ACE_NTOHL (0x0),  // name = kind
  CORBA::tk_alias, // typecode kind for typedefs
  64, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
    8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
    CORBA::tk_string, 
    0U, // string length

};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_NameComponent (CORBA::tk_struct, sizeof (_oc_CosNaming_NameComponent), (char *) &_oc_CosNaming_NameComponent, 0, sizeof (CosNaming::NameComponent));
TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)
TAO_NAMESPACE_BEGIN (CosNaming)
TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_NameComponent, &_tc_TAO_tc_CosNaming_NameComponent)
TAO_NAMESPACE_END

#if !defined (TAO_USE_SEQUENCE_TEMPLATES)
  
#if !defined (__TAO_UNBOUNDED_SEQUENCE_COSNAMING_NAME_CS_)
#define __TAO_UNBOUNDED_SEQUENCE_COSNAMING_NAME_CS_

  void
  CosNaming::_TAO_Unbounded_Sequence_CosNaming_Name::_allocate_buffer (CORBA::ULong length)
  {
    CosNaming::NameComponent* tmp = 0;
    tmp = _TAO_Unbounded_Sequence_CosNaming_Name::allocbuf (length);
    
    if (this->buffer_ != 0)
    {
      CosNaming::NameComponent *old = ACE_reinterpret_cast (CosNaming::NameComponent *,this->buffer_);
      
      for (CORBA::ULong i = 0; i < this->length_; ++i)
        tmp[i] = old[i];
      
      if (this->release_)
        _TAO_Unbounded_Sequence_CosNaming_Name::freebuf (old);
      
    }
    this->buffer_ = tmp;
  }
  
  void
  CosNaming::_TAO_Unbounded_Sequence_CosNaming_Name::_deallocate_buffer (void)
  {
    if (this->buffer_ == 0 || this->release_ == 0)
      return;
    
    CosNaming::NameComponent *tmp = ACE_reinterpret_cast (CosNaming::NameComponent *,this->buffer_);
    
    _TAO_Unbounded_Sequence_CosNaming_Name::freebuf (tmp);
    this->buffer_ = 0;
  } 
  
  CosNaming::_TAO_Unbounded_Sequence_CosNaming_Name::~_TAO_Unbounded_Sequence_CosNaming_Name (void) // Dtor.
  {
    this->_deallocate_buffer ();
  }
  
  
#endif /* end #if !defined */


#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ 

#if !defined (_COSNAMING_NAME_CS_)
#define _COSNAMING_NAME_CS_

// *************************************************************
// CosNaming::Name
// *************************************************************

CosNaming::Name::Name (void)
{}
CosNaming::Name::Name (CORBA::ULong max) // uses max size
  : 
#if !defined (TAO_USE_SEQUENCE_TEMPLATES)
  _TAO_Unbounded_Sequence_CosNaming_Name
#else /* TAO_USE_SEQUENCE_TEMPLATES */
  TAO_Unbounded_Sequence<CosNaming::NameComponent>
#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ 
 (max)
{}
CosNaming::Name::Name (CORBA::ULong max, CORBA::ULong length, CosNaming::NameComponent *buffer, CORBA::Boolean release)
  : 
#if !defined (TAO_USE_SEQUENCE_TEMPLATES)
  _TAO_Unbounded_Sequence_CosNaming_Name
#else /* TAO_USE_SEQUENCE_TEMPLATES */
  TAO_Unbounded_Sequence<CosNaming::NameComponent>
#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ 
 (max, length, buffer, release)
{}
CosNaming::Name::Name (const Name &seq) // copy ctor
  : 
#if !defined (TAO_USE_SEQUENCE_TEMPLATES)
  _TAO_Unbounded_Sequence_CosNaming_Name
#else /* TAO_USE_SEQUENCE_TEMPLATES */
  TAO_Unbounded_Sequence<CosNaming::NameComponent>
#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ 
 (seq)
{}
CosNaming::Name::~Name (void) // dtor
{}


#endif /* end #if !defined */

static const CORBA::Long _oc_CosNaming_Name[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  31, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d653a31), ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/CosNaming/Name:1.0
  5, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x0),  // name = Name
  CORBA::tk_sequence, // typecode kind
  252, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    CORBA::tk_struct, // typecode kind
    236, // encapsulation length
      TAO_ENCAP_BYTE_ORDER, // byte order
      40, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d65436f), ACE_NTOHL (0x6d706f6e), ACE_NTOHL (0x656e743a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosNaming/NameComponent:1.0
      14, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x436f6d70), ACE_NTOHL (0x6f6e656e), ACE_NTOHL (0x74000000),  // name = NameComponent
      2, // member count
      3, ACE_NTOHL (0x69640000),  // name = id
      CORBA::tk_alias, // typecode kind for typedefs
      64, // encapsulation length
        TAO_ENCAP_BYTE_ORDER, // byte order
        34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
        8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
        CORBA::tk_string, 
        0U, // string length

      5, ACE_NTOHL (0x6b696e64), ACE_NTOHL (0x0),  // name = kind
      CORBA::tk_alias, // typecode kind for typedefs
      64, // encapsulation length
        TAO_ENCAP_BYTE_ORDER, // byte order
        34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
        8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
        CORBA::tk_string, 
        0U, // string length


    0U,

};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_Name (CORBA::tk_alias, sizeof (_oc_CosNaming_Name), (char *) &_oc_CosNaming_Name, 0, sizeof (CosNaming::Name));
TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)
TAO_NAMESPACE_BEGIN (CosNaming)
TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_Name, &_tc_TAO_tc_CosNaming_Name)
TAO_NAMESPACE_END
static const CORBA::Long _oc_CosNaming_BindingType[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  38, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4269), ACE_NTOHL (0x6e64696e), ACE_NTOHL (0x67547970), ACE_NTOHL (0x653a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/BindingType:1.0
  12, ACE_NTOHL (0x42696e64), ACE_NTOHL (0x696e6754), ACE_NTOHL (0x79706500),  // name = BindingType
  2, // member count
  8, ACE_NTOHL (0x6e6f626a), ACE_NTOHL (0x65637400),  // name = nobject
  9, ACE_NTOHL (0x6e636f6e), ACE_NTOHL (0x74657874), ACE_NTOHL (0x0),  // name = ncontext
};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_BindingType (CORBA::tk_enum, sizeof (_oc_CosNaming_BindingType), (char *) &_oc_CosNaming_BindingType, 0, sizeof (CosNaming::BindingType));
TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)
TAO_NAMESPACE_BEGIN (CosNaming)
TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_BindingType, &_tc_TAO_tc_CosNaming_BindingType)
TAO_NAMESPACE_END
static const CORBA::Long _oc_CosNaming_Binding[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4269), ACE_NTOHL (0x6e64696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Binding:1.0
  8, ACE_NTOHL (0x42696e64), ACE_NTOHL (0x696e6700),  // name = Binding
  2, // member count
  13, ACE_NTOHL (0x62696e64), ACE_NTOHL (0x696e675f), ACE_NTOHL (0x6e616d65), ACE_NTOHL (0x0),  // name = binding_name
  CORBA::tk_alias, // typecode kind for typedefs
  312, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    31, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d653a31), ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/CosNaming/Name:1.0
    5, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x0),  // name = Name
    CORBA::tk_sequence, // typecode kind
    252, // encapsulation length
      TAO_ENCAP_BYTE_ORDER, // byte order
      CORBA::tk_struct, // typecode kind
      236, // encapsulation length
        TAO_ENCAP_BYTE_ORDER, // byte order
        40, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d65436f), ACE_NTOHL (0x6d706f6e), ACE_NTOHL (0x656e743a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosNaming/NameComponent:1.0
        14, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x436f6d70), ACE_NTOHL (0x6f6e656e), ACE_NTOHL (0x74000000),  // name = NameComponent
        2, // member count
        3, ACE_NTOHL (0x69640000),  // name = id
        CORBA::tk_alias, // typecode kind for typedefs
        64, // encapsulation length
          TAO_ENCAP_BYTE_ORDER, // byte order
          34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
          8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
          CORBA::tk_string, 
          0U, // string length

        5, ACE_NTOHL (0x6b696e64), ACE_NTOHL (0x0),  // name = kind
        CORBA::tk_alias, // typecode kind for typedefs
        64, // encapsulation length
          TAO_ENCAP_BYTE_ORDER, // byte order
          34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
          8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
          CORBA::tk_string, 
          0U, // string length


      0U,


  13, ACE_NTOHL (0x62696e64), ACE_NTOHL (0x696e675f), ACE_NTOHL (0x74797065), ACE_NTOHL (0x0),  // name = binding_type
  CORBA::tk_enum, // typecode kind
  96, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    38, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4269), ACE_NTOHL (0x6e64696e), ACE_NTOHL (0x67547970), ACE_NTOHL (0x653a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/BindingType:1.0
    12, ACE_NTOHL (0x42696e64), ACE_NTOHL (0x696e6754), ACE_NTOHL (0x79706500),  // name = BindingType
    2, // member count
    8, ACE_NTOHL (0x6e6f626a), ACE_NTOHL (0x65637400),  // name = nobject
    9, ACE_NTOHL (0x6e636f6e), ACE_NTOHL (0x74657874), ACE_NTOHL (0x0),  // name = ncontext

};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_Binding (CORBA::tk_struct, sizeof (_oc_CosNaming_Binding), (char *) &_oc_CosNaming_Binding, 0, sizeof (CosNaming::Binding));
TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)
TAO_NAMESPACE_BEGIN (CosNaming)
TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_Binding, &_tc_TAO_tc_CosNaming_Binding)
TAO_NAMESPACE_END

#if !defined (TAO_USE_SEQUENCE_TEMPLATES)
  
#if !defined (__TAO_UNBOUNDED_SEQUENCE_COSNAMING_BINDINGLIST_CS_)
#define __TAO_UNBOUNDED_SEQUENCE_COSNAMING_BINDINGLIST_CS_

  void
  CosNaming::_TAO_Unbounded_Sequence_CosNaming_BindingList::_allocate_buffer (CORBA::ULong length)
  {
    CosNaming::Binding* tmp = 0;
    tmp = _TAO_Unbounded_Sequence_CosNaming_BindingList::allocbuf (length);
    
    if (this->buffer_ != 0)
    {
      CosNaming::Binding *old = ACE_reinterpret_cast (CosNaming::Binding *,this->buffer_);
      
      for (CORBA::ULong i = 0; i < this->length_; ++i)
        tmp[i] = old[i];
      
      if (this->release_)
        _TAO_Unbounded_Sequence_CosNaming_BindingList::freebuf (old);
      
    }
    this->buffer_ = tmp;
  }
  
  void
  CosNaming::_TAO_Unbounded_Sequence_CosNaming_BindingList::_deallocate_buffer (void)
  {
    if (this->buffer_ == 0 || this->release_ == 0)
      return;
    
    CosNaming::Binding *tmp = ACE_reinterpret_cast (CosNaming::Binding *,this->buffer_);
    
    _TAO_Unbounded_Sequence_CosNaming_BindingList::freebuf (tmp);
    this->buffer_ = 0;
  } 
  
  CosNaming::_TAO_Unbounded_Sequence_CosNaming_BindingList::~_TAO_Unbounded_Sequence_CosNaming_BindingList (void) // Dtor.
  {
    this->_deallocate_buffer ();
  }
  
  
#endif /* end #if !defined */


#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ 

#if !defined (_COSNAMING_BINDINGLIST_CS_)
#define _COSNAMING_BINDINGLIST_CS_

// *************************************************************
// CosNaming::BindingList
// *************************************************************

CosNaming::BindingList::BindingList (void)
{}
CosNaming::BindingList::BindingList (CORBA::ULong max) // uses max size
  : 
#if !defined (TAO_USE_SEQUENCE_TEMPLATES)
  _TAO_Unbounded_Sequence_CosNaming_BindingList
#else /* TAO_USE_SEQUENCE_TEMPLATES */
  TAO_Unbounded_Sequence<CosNaming::Binding>
#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ 
 (max)
{}
CosNaming::BindingList::BindingList (CORBA::ULong max, CORBA::ULong length, CosNaming::Binding *buffer, CORBA::Boolean release)
  : 
#if !defined (TAO_USE_SEQUENCE_TEMPLATES)
  _TAO_Unbounded_Sequence_CosNaming_BindingList
#else /* TAO_USE_SEQUENCE_TEMPLATES */
  TAO_Unbounded_Sequence<CosNaming::Binding>
#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ 
 (max, length, buffer, release)
{}
CosNaming::BindingList::BindingList (const BindingList &seq) // copy ctor
  : 
#if !defined (TAO_USE_SEQUENCE_TEMPLATES)
  _TAO_Unbounded_Sequence_CosNaming_BindingList
#else /* TAO_USE_SEQUENCE_TEMPLATES */
  TAO_Unbounded_Sequence<CosNaming::Binding>
#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ 
 (seq)
{}
CosNaming::BindingList::~BindingList (void) // dtor
{}


#endif /* end #if !defined */

static const CORBA::Long _oc_CosNaming_BindingList[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  38, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4269), ACE_NTOHL (0x6e64696e), ACE_NTOHL (0x674c6973), ACE_NTOHL (0x743a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/BindingList:1.0
  12, ACE_NTOHL (0x42696e64), ACE_NTOHL (0x696e674c), ACE_NTOHL (0x69737400),  // name = BindingList
  CORBA::tk_sequence, // typecode kind
  540, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    CORBA::tk_struct, // typecode kind
    524, // encapsulation length
      TAO_ENCAP_BYTE_ORDER, // byte order
      34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4269), ACE_NTOHL (0x6e64696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Binding:1.0
      8, ACE_NTOHL (0x42696e64), ACE_NTOHL (0x696e6700),  // name = Binding
      2, // member count
      13, ACE_NTOHL (0x62696e64), ACE_NTOHL (0x696e675f), ACE_NTOHL (0x6e616d65), ACE_NTOHL (0x0),  // name = binding_name
      CORBA::tk_alias, // typecode kind for typedefs
      312, // encapsulation length
        TAO_ENCAP_BYTE_ORDER, // byte order
        31, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d653a31), ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/CosNaming/Name:1.0
        5, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x0),  // name = Name
        CORBA::tk_sequence, // typecode kind
        252, // encapsulation length
          TAO_ENCAP_BYTE_ORDER, // byte order
          CORBA::tk_struct, // typecode kind
          236, // encapsulation length
            TAO_ENCAP_BYTE_ORDER, // byte order
            40, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d65436f), ACE_NTOHL (0x6d706f6e), ACE_NTOHL (0x656e743a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosNaming/NameComponent:1.0
            14, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x436f6d70), ACE_NTOHL (0x6f6e656e), ACE_NTOHL (0x74000000),  // name = NameComponent
            2, // member count
            3, ACE_NTOHL (0x69640000),  // name = id
            CORBA::tk_alias, // typecode kind for typedefs
            64, // encapsulation length
              TAO_ENCAP_BYTE_ORDER, // byte order
              34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
              8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
              CORBA::tk_string, 
              0U, // string length

            5, ACE_NTOHL (0x6b696e64), ACE_NTOHL (0x0),  // name = kind
            CORBA::tk_alias, // typecode kind for typedefs
            64, // encapsulation length
              TAO_ENCAP_BYTE_ORDER, // byte order
              34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
              8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
              CORBA::tk_string, 
              0U, // string length


          0U,


      13, ACE_NTOHL (0x62696e64), ACE_NTOHL (0x696e675f), ACE_NTOHL (0x74797065), ACE_NTOHL (0x0),  // name = binding_type
      CORBA::tk_enum, // typecode kind
      96, // encapsulation length
        TAO_ENCAP_BYTE_ORDER, // byte order
        38, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4269), ACE_NTOHL (0x6e64696e), ACE_NTOHL (0x67547970), ACE_NTOHL (0x653a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/BindingType:1.0
        12, ACE_NTOHL (0x42696e64), ACE_NTOHL (0x696e6754), ACE_NTOHL (0x79706500),  // name = BindingType
        2, // member count
        8, ACE_NTOHL (0x6e6f626a), ACE_NTOHL (0x65637400),  // name = nobject
        9, ACE_NTOHL (0x6e636f6e), ACE_NTOHL (0x74657874), ACE_NTOHL (0x0),  // name = ncontext


    0U,

};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_BindingList (CORBA::tk_alias, sizeof (_oc_CosNaming_BindingList), (char *) &_oc_CosNaming_BindingList, 0, sizeof (CosNaming::BindingList));
TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)
TAO_NAMESPACE_BEGIN (CosNaming)
TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_BindingList, &_tc_TAO_tc_CosNaming_BindingList)
TAO_NAMESPACE_END
CosNaming::NamingContext_ptr CosNaming::NamingContext::_narrow (
    CORBA::Object_ptr obj,
    CORBA::Environment &ACE_TRY_ENV
  )
{
  if (CORBA::is_nil (obj))
    return NamingContext::_nil ();
  CORBA::Boolean is_a = obj->_is_a ("IDL:omg.org/CosNaming/NamingContext:1.0", ACE_TRY_ENV);
  ACE_CHECK_RETURN (NamingContext::_nil ());
  if (is_a == 0)
    return NamingContext::_nil ();
  return NamingContext::_unchecked_narrow (obj, ACE_TRY_ENV);
}

CosNaming::NamingContext_ptr CosNaming::NamingContext::_unchecked_narrow (
    CORBA::Object_ptr obj,
    CORBA::Environment &
  )
{
  if (CORBA::is_nil (obj))
    return NamingContext::_nil ();
  TAO_Stub* stub = obj->_stubobj ();
  stub->_incr_refcnt ();
  NamingContext_ptr default_proxy = NamingContext::_nil ();
  if (obj->_is_collocated () && _TAO_collocation_CosNaming_NamingContext_Stub_Factory_function_pointer != 0)
    {
      default_proxy = _TAO_collocation_CosNaming_NamingContext_Stub_Factory_function_pointer (obj);
    }
  if (CORBA::is_nil (default_proxy))
    ACE_NEW_RETURN (default_proxy, NamingContext (stub), NamingContext::_nil ());
  return TAO_CosNaming_NamingContext_PROXY_FACTORY_ADAPTER::instance ()->create_proxy (default_proxy);
}

CosNaming::NamingContext_ptr 
CosNaming::NamingContext::_duplicate (NamingContext_ptr obj)
{
  if (!CORBA::is_nil (obj))
    obj->_incr_refcnt ();
  return obj;
}

static const CORBA::Long _oc_CosNaming_NamingContext_NotFoundReason[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  55, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d696e67), ACE_NTOHL (0x436f6e74), ACE_NTOHL (0x6578742f), ACE_NTOHL (0x4e6f7446), ACE_NTOHL (0x6f756e64), ACE_NTOHL (0x52656173), ACE_NTOHL (0x6f6e3a31), ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/CosNaming/NamingContext/NotFoundReason:1.0
  15, ACE_NTOHL (0x4e6f7446), ACE_NTOHL (0x6f756e64), ACE_NTOHL (0x52656173), ACE_NTOHL (0x6f6e0000),  // name = NotFoundReason
  3, // member count
  13, ACE_NTOHL (0x6d697373), ACE_NTOHL (0x696e675f), ACE_NTOHL (0x6e6f6465), ACE_NTOHL (0x0),  // name = missing_node
  12, ACE_NTOHL (0x6e6f745f), ACE_NTOHL (0x636f6e74), ACE_NTOHL (0x65787400),  // name = not_context
  11, ACE_NTOHL (0x6e6f745f), ACE_NTOHL (0x6f626a65), ACE_NTOHL (0x63740000),  // name = not_object
};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_NamingContext_NotFoundReason (CORBA::tk_enum, sizeof (_oc_CosNaming_NamingContext_NotFoundReason), (char *) &_oc_CosNaming_NamingContext_NotFoundReason, 0, sizeof (CosNaming::NamingContext::NotFoundReason));
CORBA::TypeCode_ptr CosNaming::NamingContext::_tc_NotFoundReason = &_tc_TAO_tc_CosNaming_NamingContext_NotFoundReason;

// default constructor
CosNaming::NamingContext::NotFound::NotFound (void)
  : CORBA_UserException (::CosNaming::NamingContext::_tc_NotFound)
{
}

// destructor - all members are of self managing types
CosNaming::NamingContext::NotFound::~NotFound (void)
{
}

// copy constructor
CosNaming::NamingContext::NotFound::NotFound (const ::CosNaming::NamingContext::NotFound &_tao_excp)
  : CORBA_UserException (_tao_excp._type ())
{
    this->why = _tao_excp.why;
  this->rest_of_name = _tao_excp.rest_of_name;
}

// assignment operator
CosNaming::NamingContext::NotFound&
CosNaming::NamingContext::NotFound::operator= (const ::CosNaming::NamingContext::NotFound &_tao_excp)
{

  this->CORBA_UserException::operator= (_tao_excp);
  this->why = _tao_excp.why;
  this->rest_of_name = _tao_excp.rest_of_name;
  return *this;
}

// narrow
CosNaming::NamingContext::NotFound_ptr 
CosNaming::NamingContext::NotFound::_narrow (CORBA::Exception *exc)
{
  if (!ACE_OS::strcmp ("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0", exc->_id ())) // same type
    return ACE_dynamic_cast (NotFound_ptr, exc);
  else
    return 0;
}


void CosNaming::NamingContext::NotFound::_raise ()
{
  TAO_RAISE(*this);
}


void CosNaming::NamingContext::NotFound::_tao_encode (
    TAO_OutputCDR &cdr,
    CORBA::Environment &ACE_TRY_ENV) const
{
  if (cdr << *this)
    return;
  ACE_THROW (CORBA::MARSHAL ());
}


void CosNaming::NamingContext::NotFound::_tao_decode (
    TAO_InputCDR &cdr,
    CORBA::Environment &ACE_TRY_ENV)
{
  if (cdr >> *this)
    return;
  ACE_THROW (CORBA::MARSHAL ());
}

// TAO extension - the _alloc method
CORBA::Exception *CosNaming::NamingContext::NotFound::_alloc (void)
{
  CORBA::Exception *retval = 0;
  ACE_NEW_RETURN (retval, ::CosNaming::NamingContext::NotFound, 0);
  return retval;
}

CosNaming::NamingContext::NotFound::NotFound (
  CosNaming::NamingContext::NotFoundReason _tao_why,
  const CosNaming::Name & _tao_rest_of_name
)
  : CORBA_UserException  (CORBA::TypeCode::_duplicate (CosNaming::NamingContext::_tc_NotFound))
{
    this->why = _tao_why;
  this->rest_of_name = _tao_rest_of_name;
}

static const CORBA::Long _oc_CosNaming_NamingContext_NotFound[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  49, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d696e67), ACE_NTOHL (0x436f6e74), ACE_NTOHL (0x6578742f), ACE_NTOHL (0x4e6f7446), ACE_NTOHL (0x6f756e64), ACE_NTOHL (0x3a312e30), ACE_NTOHL (0x0),  // repository ID = IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
  9, ACE_NTOHL (0x4e6f7446), ACE_NTOHL (0x6f756e64), ACE_NTOHL (0x0),  // name = NotFound
  2, // member count
  4, ACE_NTOHL (0x77687900),  // name = why
  CORBA::tk_enum, // typecode kind
  140, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    55, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d696e67), ACE_NTOHL (0x436f6e74), ACE_NTOHL (0x6578742f), ACE_NTOHL (0x4e6f7446), ACE_NTOHL (0x6f756e64), ACE_NTOHL (0x52656173), ACE_NTOHL (0x6f6e3a31), ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/CosNaming/NamingContext/NotFoundReason:1.0
    15, ACE_NTOHL (0x4e6f7446), ACE_NTOHL (0x6f756e64), ACE_NTOHL (0x52656173), ACE_NTOHL (0x6f6e0000),  // name = NotFoundReason
    3, // member count
    13, ACE_NTOHL (0x6d697373), ACE_NTOHL (0x696e675f), ACE_NTOHL (0x6e6f6465), ACE_NTOHL (0x0),  // name = missing_node
    12, ACE_NTOHL (0x6e6f745f), ACE_NTOHL (0x636f6e74), ACE_NTOHL (0x65787400),  // name = not_context
    11, ACE_NTOHL (0x6e6f745f), ACE_NTOHL (0x6f626a65), ACE_NTOHL (0x63740000),  // name = not_object

  13, ACE_NTOHL (0x72657374), ACE_NTOHL (0x5f6f665f), ACE_NTOHL (0x6e616d65), ACE_NTOHL (0x0),  // name = rest_of_name
  CORBA::tk_alias, // typecode kind for typedefs
  312, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    31, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d653a31), ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/CosNaming/Name:1.0
    5, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x0),  // name = Name
    CORBA::tk_sequence, // typecode kind
    252, // encapsulation length
      TAO_ENCAP_BYTE_ORDER, // byte order
      CORBA::tk_struct, // typecode kind
      236, // encapsulation length
        TAO_ENCAP_BYTE_ORDER, // byte order
        40, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d65436f), ACE_NTOHL (0x6d706f6e), ACE_NTOHL (0x656e743a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosNaming/NameComponent:1.0
        14, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x436f6d70), ACE_NTOHL (0x6f6e656e), ACE_NTOHL (0x74000000),  // name = NameComponent
        2, // member count
        3, ACE_NTOHL (0x69640000),  // name = id
        CORBA::tk_alias, // typecode kind for typedefs
        64, // encapsulation length
          TAO_ENCAP_BYTE_ORDER, // byte order
          34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
          8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
          CORBA::tk_string, 
          0U, // string length

        5, ACE_NTOHL (0x6b696e64), ACE_NTOHL (0x0),  // name = kind
        CORBA::tk_alias, // typecode kind for typedefs
        64, // encapsulation length
          TAO_ENCAP_BYTE_ORDER, // byte order
          34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
          8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
          CORBA::tk_string, 
          0U, // string length


      0U,


};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_NamingContext_NotFound (CORBA::tk_except, sizeof (_oc_CosNaming_NamingContext_NotFound), (char *) &_oc_CosNaming_NamingContext_NotFound, 0, sizeof (CosNaming::NamingContext::NotFound));
CORBA::TypeCode_ptr CosNaming::NamingContext::_tc_NotFound = &_tc_TAO_tc_CosNaming_NamingContext_NotFound;

// default constructor
CosNaming::NamingContext::CannotProceed::CannotProceed (void)
  : CORBA_UserException (::CosNaming::NamingContext::_tc_CannotProceed)
{
}

// destructor - all members are of self managing types
CosNaming::NamingContext::CannotProceed::~CannotProceed (void)
{
}

// copy constructor
CosNaming::NamingContext::CannotProceed::CannotProceed (const ::CosNaming::NamingContext::CannotProceed &_tao_excp)
  : CORBA_UserException (_tao_excp._type ())
{
    this->cxt = CosNaming::NamingContext::_duplicate (_tao_excp.cxt.in ());
  this->rest_of_name = _tao_excp.rest_of_name;
}

// assignment operator
CosNaming::NamingContext::CannotProceed&
CosNaming::NamingContext::CannotProceed::operator= (const ::CosNaming::NamingContext::CannotProceed &_tao_excp)
{

  this->CORBA_UserException::operator= (_tao_excp);
  this->cxt = CosNaming::NamingContext::_duplicate (_tao_excp.cxt.in ());
  this->rest_of_name = _tao_excp.rest_of_name;
  return *this;
}

// narrow
CosNaming::NamingContext::CannotProceed_ptr 
CosNaming::NamingContext::CannotProceed::_narrow (CORBA::Exception *exc)
{
  if (!ACE_OS::strcmp ("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0", exc->_id ())) // same type
    return ACE_dynamic_cast (CannotProceed_ptr, exc);
  else
    return 0;
}


void CosNaming::NamingContext::CannotProceed::_raise ()
{
  TAO_RAISE(*this);
}


void CosNaming::NamingContext::CannotProceed::_tao_encode (
    TAO_OutputCDR &cdr,
    CORBA::Environment &ACE_TRY_ENV) const
{
  if (cdr << *this)
    return;
  ACE_THROW (CORBA::MARSHAL ());
}


void CosNaming::NamingContext::CannotProceed::_tao_decode (
    TAO_InputCDR &cdr,
    CORBA::Environment &ACE_TRY_ENV)
{
  if (cdr >> *this)
    return;
  ACE_THROW (CORBA::MARSHAL ());
}

// TAO extension - the _alloc method
CORBA::Exception *CosNaming::NamingContext::CannotProceed::_alloc (void)
{
  CORBA::Exception *retval = 0;
  ACE_NEW_RETURN (retval, ::CosNaming::NamingContext::CannotProceed, 0);
  return retval;
}

CosNaming::NamingContext::CannotProceed::CannotProceed (
  const CosNaming::NamingContext_ptr  _tao_cxt,
  const CosNaming::Name & _tao_rest_of_name
)
  : CORBA_UserException  (CORBA::TypeCode::_duplicate (CosNaming::NamingContext::_tc_CannotProceed))
{
    this->cxt = CosNaming::NamingContext::_duplicate (_tao_cxt);
  this->rest_of_name = _tao_rest_of_name;
}

static const CORBA::Long _oc_CosNaming_NamingContext_CannotProceed[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  54, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d696e67), ACE_NTOHL (0x436f6e74), ACE_NTOHL (0x6578742f), ACE_NTOHL (0x43616e6e), ACE_NTOHL (0x6f745072), ACE_NTOHL (0x6f636565), ACE_NTOHL (0x643a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0
  14, ACE_NTOHL (0x43616e6e), ACE_NTOHL (0x6f745072), ACE_NTOHL (0x6f636565), ACE_NTOHL (0x64000000),  // name = CannotProceed
  2, // member count
  4, ACE_NTOHL (0x63787400),  // name = cxt
  CORBA::tk_objref, // typecode kind
  68, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    40, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d696e67), ACE_NTOHL (0x436f6e74), ACE_NTOHL (0x6578743a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosNaming/NamingContext:1.0
    14, ACE_NTOHL (0x4e616d69), ACE_NTOHL (0x6e67436f), ACE_NTOHL (0x6e746578), ACE_NTOHL (0x74000000),  // name = NamingContext

  13, ACE_NTOHL (0x72657374), ACE_NTOHL (0x5f6f665f), ACE_NTOHL (0x6e616d65), ACE_NTOHL (0x0),  // name = rest_of_name
  CORBA::tk_alias, // typecode kind for typedefs
  312, // encapsulation length
    TAO_ENCAP_BYTE_ORDER, // byte order
    31, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d653a31), ACE_NTOHL (0x2e300000),  // repository ID = IDL:omg.org/CosNaming/Name:1.0
    5, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x0),  // name = Name
    CORBA::tk_sequence, // typecode kind
    252, // encapsulation length
      TAO_ENCAP_BYTE_ORDER, // byte order
      CORBA::tk_struct, // typecode kind
      236, // encapsulation length
        TAO_ENCAP_BYTE_ORDER, // byte order
        40, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d65436f), ACE_NTOHL (0x6d706f6e), ACE_NTOHL (0x656e743a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosNaming/NameComponent:1.0
        14, ACE_NTOHL (0x4e616d65), ACE_NTOHL (0x436f6d70), ACE_NTOHL (0x6f6e656e), ACE_NTOHL (0x74000000),  // name = NameComponent
        2, // member count
        3, ACE_NTOHL (0x69640000),  // name = id
        CORBA::tk_alias, // typecode kind for typedefs
        64, // encapsulation length
          TAO_ENCAP_BYTE_ORDER, // byte order
          34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
          8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
          CORBA::tk_string, 
          0U, // string length

        5, ACE_NTOHL (0x6b696e64), ACE_NTOHL (0x0),  // name = kind
        CORBA::tk_alias, // typecode kind for typedefs
        64, // encapsulation length
          TAO_ENCAP_BYTE_ORDER, // byte order
          34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4973), ACE_NTOHL (0x7472696e), ACE_NTOHL (0x673a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/Istring:1.0
          8, ACE_NTOHL (0x49737472), ACE_NTOHL (0x696e6700),  // name = Istring
          CORBA::tk_string, 
          0U, // string length


      0U,


};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_NamingContext_CannotProceed (CORBA::tk_except, sizeof (_oc_CosNaming_NamingContext_CannotProceed), (char *) &_oc_CosNaming_NamingContext_CannotProceed, 0, sizeof (CosNaming::NamingContext::CannotProceed));
CORBA::TypeCode_ptr CosNaming::NamingContext::_tc_CannotProceed = &_tc_TAO_tc_CosNaming_NamingContext_CannotProceed;

// default constructor
CosNaming::NamingContext::InvalidName::InvalidName (void)
  : CORBA_UserException (::CosNaming::NamingContext::_tc_InvalidName)
{
}

// destructor - all members are of self managing types
CosNaming::NamingContext::InvalidName::~InvalidName (void)
{
}

// copy constructor
CosNaming::NamingContext::InvalidName::InvalidName (const ::CosNaming::NamingContext::InvalidName &_tao_excp)
  : CORBA_UserException (_tao_excp._type ())
{
  }

// assignment operator
CosNaming::NamingContext::InvalidName&
CosNaming::NamingContext::InvalidName::operator= (const ::CosNaming::NamingContext::InvalidName &_tao_excp)
{

  this->CORBA_UserException::operator= (_tao_excp);
  return *this;
}

// narrow
CosNaming::NamingContext::InvalidName_ptr 
CosNaming::NamingContext::InvalidName::_narrow (CORBA::Exception *exc)
{
  if (!ACE_OS::strcmp ("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0", exc->_id ())) // same type
    return ACE_dynamic_cast (InvalidName_ptr, exc);
  else
    return 0;
}


void CosNaming::NamingContext::InvalidName::_raise ()
{
  TAO_RAISE(*this);
}


void CosNaming::NamingContext::InvalidName::_tao_encode (
    TAO_OutputCDR &cdr,
    CORBA::Environment &ACE_TRY_ENV) const
{
  if (cdr << *this)
    return;
  ACE_THROW (CORBA::MARSHAL ());
}


void CosNaming::NamingContext::InvalidName::_tao_decode (
    TAO_InputCDR &cdr,
    CORBA::Environment &ACE_TRY_ENV)
{
  if (cdr >> *this)
    return;
  ACE_THROW (CORBA::MARSHAL ());
}

// TAO extension - the _alloc method
CORBA::Exception *CosNaming::NamingContext::InvalidName::_alloc (void)
{
  CORBA::Exception *retval = 0;
  ACE_NEW_RETURN (retval, ::CosNaming::NamingContext::InvalidName, 0);
  return retval;
}

static const CORBA::Long _oc_CosNaming_NamingContext_InvalidName[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  52, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d696e67), ACE_NTOHL (0x436f6e74), ACE_NTOHL (0x6578742f), ACE_NTOHL (0x496e7661), ACE_NTOHL (0x6c69644e), ACE_NTOHL (0x616d653a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0
  12, ACE_NTOHL (0x496e7661), ACE_NTOHL (0x6c69644e), ACE_NTOHL (0x616d6500),  // name = InvalidName
  0, // member count
};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_NamingContext_InvalidName (CORBA::tk_except, sizeof (_oc_CosNaming_NamingContext_InvalidName), (char *) &_oc_CosNaming_NamingContext_InvalidName, 0, sizeof (CosNaming::NamingContext::InvalidName));
CORBA::TypeCode_ptr CosNaming::NamingContext::_tc_InvalidName = &_tc_TAO_tc_CosNaming_NamingContext_InvalidName;

// default constructor
CosNaming::NamingContext::AlreadyBound::AlreadyBound (void)
  : CORBA_UserException (::CosNaming::NamingContext::_tc_AlreadyBound)
{
}

// destructor - all members are of self managing types
CosNaming::NamingContext::AlreadyBound::~AlreadyBound (void)
{
}

// copy constructor
CosNaming::NamingContext::AlreadyBound::AlreadyBound (const ::CosNaming::NamingContext::AlreadyBound &_tao_excp)
  : CORBA_UserException (_tao_excp._type ())
{
  }

// assignment operator
CosNaming::NamingContext::AlreadyBound&
CosNaming::NamingContext::AlreadyBound::operator= (const ::CosNaming::NamingContext::AlreadyBound &_tao_excp)
{

  this->CORBA_UserException::operator= (_tao_excp);
  return *this;
}

// narrow
CosNaming::NamingContext::AlreadyBound_ptr 
CosNaming::NamingContext::AlreadyBound::_narrow (CORBA::Exception *exc)
{
  if (!ACE_OS::strcmp ("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0", exc->_id ())) // same type
    return ACE_dynamic_cast (AlreadyBound_ptr, exc);
  else
    return 0;
}


void CosNaming::NamingContext::AlreadyBound::_raise ()
{
  TAO_RAISE(*this);
}


void CosNaming::NamingContext::AlreadyBound::_tao_encode (
    TAO_OutputCDR &cdr,
    CORBA::Environment &ACE_TRY_ENV) const
{
  if (cdr << *this)
    return;
  ACE_THROW (CORBA::MARSHAL ());
}


void CosNaming::NamingContext::AlreadyBound::_tao_decode (
    TAO_InputCDR &cdr,
    CORBA::Environment &ACE_TRY_ENV)
{
  if (cdr >> *this)
    return;
  ACE_THROW (CORBA::MARSHAL ());
}

// TAO extension - the _alloc method
CORBA::Exception *CosNaming::NamingContext::AlreadyBound::_alloc (void)
{
  CORBA::Exception *retval = 0;
  ACE_NEW_RETURN (retval, ::CosNaming::NamingContext::AlreadyBound, 0);
  return retval;
}

static const CORBA::Long _oc_CosNaming_NamingContext_AlreadyBound[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  53, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d696e67), ACE_NTOHL (0x436f6e74), ACE_NTOHL (0x6578742f), ACE_NTOHL (0x416c7265), ACE_NTOHL (0x61647942), ACE_NTOHL (0x6f756e64), ACE_NTOHL (0x3a312e30), ACE_NTOHL (0x0),  // repository ID = IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0
  13, ACE_NTOHL (0x416c7265), ACE_NTOHL (0x61647942), ACE_NTOHL (0x6f756e64), ACE_NTOHL (0x0),  // name = AlreadyBound
  0, // member count
};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_NamingContext_AlreadyBound (CORBA::tk_except, sizeof (_oc_CosNaming_NamingContext_AlreadyBound), (char *) &_oc_CosNaming_NamingContext_AlreadyBound, 0, sizeof (CosNaming::NamingContext::AlreadyBound));
CORBA::TypeCode_ptr CosNaming::NamingContext::_tc_AlreadyBound = &_tc_TAO_tc_CosNaming_NamingContext_AlreadyBound;

// default constructor
CosNaming::NamingContext::NotEmpty::NotEmpty (void)
  : CORBA_UserException (::CosNaming::NamingContext::_tc_NotEmpty)
{
}

// destructor - all members are of self managing types
CosNaming::NamingContext::NotEmpty::~NotEmpty (void)
{
}

// copy constructor
CosNaming::NamingContext::NotEmpty::NotEmpty (const ::CosNaming::NamingContext::NotEmpty &_tao_excp)
  : CORBA_UserException (_tao_excp._type ())
{
  }

// assignment operator
CosNaming::NamingContext::NotEmpty&
CosNaming::NamingContext::NotEmpty::operator= (const ::CosNaming::NamingContext::NotEmpty &_tao_excp)
{

  this->CORBA_UserException::operator= (_tao_excp);
  return *this;
}

// narrow
CosNaming::NamingContext::NotEmpty_ptr 
CosNaming::NamingContext::NotEmpty::_narrow (CORBA::Exception *exc)
{
  if (!ACE_OS::strcmp ("IDL:omg.org/CosNaming/NamingContext/NotEmpty:1.0", exc->_id ())) // same type
    return ACE_dynamic_cast (NotEmpty_ptr, exc);
  else
    return 0;
}


void CosNaming::NamingContext::NotEmpty::_raise ()
{
  TAO_RAISE(*this);
}


void CosNaming::NamingContext::NotEmpty::_tao_encode (
    TAO_OutputCDR &cdr,
    CORBA::Environment &ACE_TRY_ENV) const
{
  if (cdr << *this)
    return;
  ACE_THROW (CORBA::MARSHAL ());
}


void CosNaming::NamingContext::NotEmpty::_tao_decode (
    TAO_InputCDR &cdr,
    CORBA::Environment &ACE_TRY_ENV)
{
  if (cdr >> *this)
    return;
  ACE_THROW (CORBA::MARSHAL ());
}

// TAO extension - the _alloc method
CORBA::Exception *CosNaming::NamingContext::NotEmpty::_alloc (void)
{
  CORBA::Exception *retval = 0;
  ACE_NEW_RETURN (retval, ::CosNaming::NamingContext::NotEmpty, 0);
  return retval;
}

static const CORBA::Long _oc_CosNaming_NamingContext_NotEmpty[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  49, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d696e67), ACE_NTOHL (0x436f6e74), ACE_NTOHL (0x6578742f), ACE_NTOHL (0x4e6f7445), ACE_NTOHL (0x6d707479), ACE_NTOHL (0x3a312e30), ACE_NTOHL (0x0),  // repository ID = IDL:omg.org/CosNaming/NamingContext/NotEmpty:1.0
  9, ACE_NTOHL (0x4e6f7445), ACE_NTOHL (0x6d707479), ACE_NTOHL (0x0),  // name = NotEmpty
  0, // member count
};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_NamingContext_NotEmpty (CORBA::tk_except, sizeof (_oc_CosNaming_NamingContext_NotEmpty), (char *) &_oc_CosNaming_NamingContext_NotEmpty, 0, sizeof (CosNaming::NamingContext::NotEmpty));
CORBA::TypeCode_ptr CosNaming::NamingContext::_tc_NotEmpty = &_tc_TAO_tc_CosNaming_NamingContext_NotEmpty;

void CosNaming::NamingContext::bind (
    const CosNaming::Name & n,
    CORBA::Object_ptr obj,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName,
    CosNaming::NamingContext::AlreadyBound
  ))
{
  
  static TAO_Exception_Data _tao_CosNaming_NamingContext_bind_exceptiondata [] = 
  {
    {CosNaming::NamingContext::_tc_NotFound, CosNaming::NamingContext::NotFound::_alloc},
    {CosNaming::NamingContext::_tc_CannotProceed, CosNaming::NamingContext::CannotProceed::_alloc},
    {CosNaming::NamingContext::_tc_InvalidName, CosNaming::NamingContext::InvalidName::_alloc},
    {CosNaming::NamingContext::_tc_AlreadyBound, CosNaming::NamingContext::AlreadyBound::_alloc}
  };


  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW (CORBA::INTERNAL ());

  
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "bind",
      4,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK;
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK;
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "bind",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_OutputCDR &_tao_out = _tao_call.out_stream ();
        if (!(
              (_tao_out << n) &&
              (_tao_out << obj)
          ))
          TAO_INTERCEPTOR_THROW (CORBA::MARSHAL ());
        int _invoke_status =
          _tao_call.invoke (_tao_CosNaming_NamingContext_bind_exceptiondata, 4, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK;

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
        }
        
        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "bind",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "bind",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK;
#endif /* TAO_HAS_INTERCEPTORS */

}

void CosNaming::NamingContext::rebind (
    const CosNaming::Name & n,
    CORBA::Object_ptr obj,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName
  ))
{
  
  static TAO_Exception_Data _tao_CosNaming_NamingContext_rebind_exceptiondata [] = 
  {
    {CosNaming::NamingContext::_tc_NotFound, CosNaming::NamingContext::NotFound::_alloc},
    {CosNaming::NamingContext::_tc_CannotProceed, CosNaming::NamingContext::CannotProceed::_alloc},
    {CosNaming::NamingContext::_tc_InvalidName, CosNaming::NamingContext::InvalidName::_alloc}
  };


  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW (CORBA::INTERNAL ());

  
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "rebind",
      6,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK;
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK;
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "rebind",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_OutputCDR &_tao_out = _tao_call.out_stream ();
        if (!(
              (_tao_out << n) &&
              (_tao_out << obj)
          ))
          TAO_INTERCEPTOR_THROW (CORBA::MARSHAL ());
        int _invoke_status =
          _tao_call.invoke (_tao_CosNaming_NamingContext_rebind_exceptiondata, 3, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK;

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
        }
        
        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "rebind",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "rebind",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK;
#endif /* TAO_HAS_INTERCEPTORS */

}

void CosNaming::NamingContext::bind_context (
    const CosNaming::Name & n,
    CosNaming::NamingContext_ptr nc,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName,
    CosNaming::NamingContext::AlreadyBound
  ))
{
  
  static TAO_Exception_Data _tao_CosNaming_NamingContext_bind_context_exceptiondata [] = 
  {
    {CosNaming::NamingContext::_tc_NotFound, CosNaming::NamingContext::NotFound::_alloc},
    {CosNaming::NamingContext::_tc_CannotProceed, CosNaming::NamingContext::CannotProceed::_alloc},
    {CosNaming::NamingContext::_tc_InvalidName, CosNaming::NamingContext::InvalidName::_alloc},
    {CosNaming::NamingContext::_tc_AlreadyBound, CosNaming::NamingContext::AlreadyBound::_alloc}
  };


  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW (CORBA::INTERNAL ());

  
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "bind_context",
      12,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK;
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK;
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "bind_context",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_OutputCDR &_tao_out = _tao_call.out_stream ();
        if (!(
              (_tao_out << n) &&
              (_tao_out << nc)
          ))
          TAO_INTERCEPTOR_THROW (CORBA::MARSHAL ());
        int _invoke_status =
          _tao_call.invoke (_tao_CosNaming_NamingContext_bind_context_exceptiondata, 4, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK;

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
        }
        
        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "bind_context",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "bind_context",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK;
#endif /* TAO_HAS_INTERCEPTORS */

}

void CosNaming::NamingContext::rebind_context (
    const CosNaming::Name & n,
    CosNaming::NamingContext_ptr nc,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName
  ))
{
  
  static TAO_Exception_Data _tao_CosNaming_NamingContext_rebind_context_exceptiondata [] = 
  {
    {CosNaming::NamingContext::_tc_NotFound, CosNaming::NamingContext::NotFound::_alloc},
    {CosNaming::NamingContext::_tc_CannotProceed, CosNaming::NamingContext::CannotProceed::_alloc},
    {CosNaming::NamingContext::_tc_InvalidName, CosNaming::NamingContext::InvalidName::_alloc}
  };


  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW (CORBA::INTERNAL ());

  
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "rebind_context",
      14,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK;
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK;
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "rebind_context",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_OutputCDR &_tao_out = _tao_call.out_stream ();
        if (!(
              (_tao_out << n) &&
              (_tao_out << nc)
          ))
          TAO_INTERCEPTOR_THROW (CORBA::MARSHAL ());
        int _invoke_status =
          _tao_call.invoke (_tao_CosNaming_NamingContext_rebind_context_exceptiondata, 3, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK;

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
        }
        
        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "rebind_context",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "rebind_context",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK;
#endif /* TAO_HAS_INTERCEPTORS */

}

CORBA::Object_ptr CosNaming::NamingContext::resolve (
    const CosNaming::Name & n,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName
  ))
{
  
  static TAO_Exception_Data _tao_CosNaming_NamingContext_resolve_exceptiondata [] = 
  {
    {CosNaming::NamingContext::_tc_NotFound, CosNaming::NamingContext::NotFound::_alloc},
    {CosNaming::NamingContext::_tc_CannotProceed, CosNaming::NamingContext::CannotProceed::_alloc},
    {CosNaming::NamingContext::_tc_InvalidName, CosNaming::NamingContext::InvalidName::_alloc}
  };

  CORBA::Object_ptr _tao_retval = CORBA::Object::_nil ();
  CORBA::Object_var _tao_safe_retval (_tao_retval);
  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW_RETURN (CORBA::INTERNAL (), 0);

  
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "resolve",
      7,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK_RETURN (0);
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK_RETURN (0);
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK_RETURN (0);

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "resolve",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK_RETURN (0);
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK_RETURN (0);

        TAO_OutputCDR &_tao_out = _tao_call.out_stream ();
        if (!(
              (_tao_out << n)
          ))
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::MARSHAL (), 0);

        int _invoke_status =
          _tao_call.invoke (_tao_CosNaming_NamingContext_resolve_exceptiondata, 3, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK_RETURN (0);

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), 0);

        }
        TAO_InputCDR &_tao_in = _tao_call.inp_stream ();
        if (!(
              (_tao_in >> _tao_safe_retval.inout ())
          ))
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), 0);

        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "resolve",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK_RETURN (0);
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "resolve",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK_RETURN (0);
#endif /* TAO_HAS_INTERCEPTORS */
  return _tao_safe_retval._retn ();
}

void CosNaming::NamingContext::unbind (
    const CosNaming::Name & n,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName
  ))
{
  
  static TAO_Exception_Data _tao_CosNaming_NamingContext_unbind_exceptiondata [] = 
  {
    {CosNaming::NamingContext::_tc_NotFound, CosNaming::NamingContext::NotFound::_alloc},
    {CosNaming::NamingContext::_tc_CannotProceed, CosNaming::NamingContext::CannotProceed::_alloc},
    {CosNaming::NamingContext::_tc_InvalidName, CosNaming::NamingContext::InvalidName::_alloc}
  };


  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW (CORBA::INTERNAL ());

  
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "unbind",
      6,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK;
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK;
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "unbind",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_OutputCDR &_tao_out = _tao_call.out_stream ();
        if (!(
              (_tao_out << n)
          ))
          TAO_INTERCEPTOR_THROW (CORBA::MARSHAL ());
        int _invoke_status =
          _tao_call.invoke (_tao_CosNaming_NamingContext_unbind_exceptiondata, 3, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK;

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
        }
        
        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "unbind",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "unbind",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK;
#endif /* TAO_HAS_INTERCEPTORS */

}

CosNaming::NamingContext_ptr CosNaming::NamingContext::new_context (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  
  CosNaming::NamingContext_ptr _tao_retval = CosNaming::NamingContext::_nil ();
  CosNaming::NamingContext_var _tao_safe_retval (_tao_retval);
  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW_RETURN (CORBA::INTERNAL (), 0);

  
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "new_context",
      11,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK_RETURN (0);
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK_RETURN (0);
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK_RETURN (0);

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "new_context",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK_RETURN (0);
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK_RETURN (0);

        int _invoke_status =
          _tao_call.invoke (0, 0, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK_RETURN (0);

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), 0);

        }
        TAO_InputCDR &_tao_in = _tao_call.inp_stream ();
        if (!(
              (_tao_in >> _tao_safe_retval.inout ())
          ))
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), 0);

        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "new_context",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK_RETURN (0);
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "new_context",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK_RETURN (0);
#endif /* TAO_HAS_INTERCEPTORS */
  return _tao_safe_retval._retn ();
}

CosNaming::NamingContext_ptr CosNaming::NamingContext::bind_new_context (
    const CosNaming::Name & n,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::AlreadyBound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName
  ))
{
  
  static TAO_Exception_Data _tao_CosNaming_NamingContext_bind_new_context_exceptiondata [] = 
  {
    {CosNaming::NamingContext::_tc_NotFound, CosNaming::NamingContext::NotFound::_alloc},
    {CosNaming::NamingContext::_tc_AlreadyBound, CosNaming::NamingContext::AlreadyBound::_alloc},
    {CosNaming::NamingContext::_tc_CannotProceed, CosNaming::NamingContext::CannotProceed::_alloc},
    {CosNaming::NamingContext::_tc_InvalidName, CosNaming::NamingContext::InvalidName::_alloc}
  };

  CosNaming::NamingContext_ptr _tao_retval = CosNaming::NamingContext::_nil ();
  CosNaming::NamingContext_var _tao_safe_retval (_tao_retval);
  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW_RETURN (CORBA::INTERNAL (), 0);

  
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "bind_new_context",
      16,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK_RETURN (0);
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK_RETURN (0);
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK_RETURN (0);

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "bind_new_context",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK_RETURN (0);
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK_RETURN (0);

        TAO_OutputCDR &_tao_out = _tao_call.out_stream ();
        if (!(
              (_tao_out << n)
          ))
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::MARSHAL (), 0);

        int _invoke_status =
          _tao_call.invoke (_tao_CosNaming_NamingContext_bind_new_context_exceptiondata, 4, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK_RETURN (0);

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), 0);

        }
        TAO_InputCDR &_tao_in = _tao_call.inp_stream ();
        if (!(
              (_tao_in >> _tao_safe_retval.inout ())
          ))
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), 0);

        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "bind_new_context",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK_RETURN (0);
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "bind_new_context",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK_RETURN (0);
#endif /* TAO_HAS_INTERCEPTORS */
  return _tao_safe_retval._retn ();
}

void CosNaming::NamingContext::destroy (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotEmpty
  ))
{
  
  static TAO_Exception_Data _tao_CosNaming_NamingContext_destroy_exceptiondata [] = 
  {
    {CosNaming::NamingContext::_tc_NotEmpty, CosNaming::NamingContext::NotEmpty::_alloc}
  };


  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW (CORBA::INTERNAL ());

  
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "destroy",
      7,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK;
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK;
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "destroy",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        int _invoke_status =
          _tao_call.invoke (_tao_CosNaming_NamingContext_destroy_exceptiondata, 1, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK;

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
        }
        
        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "destroy",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "destroy",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK;
#endif /* TAO_HAS_INTERCEPTORS */

}

void CosNaming::NamingContext::list (
    CORBA::ULong how_many,
    CosNaming::BindingList_out bl,
    CosNaming::BindingIterator_out bi,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  

  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW (CORBA::INTERNAL ());

  
  ACE_NEW (bl.ptr (), CosNaming::BindingList);
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "list",
      4,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK;
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK;
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "list",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_OutputCDR &_tao_out = _tao_call.out_stream ();
        if (!(
              (_tao_out << how_many)                            
          ))
          TAO_INTERCEPTOR_THROW (CORBA::MARSHAL ());
        int _invoke_status =
          _tao_call.invoke (0, 0, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK;

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
        }
        TAO_InputCDR &_tao_in = _tao_call.inp_stream ();
        if (!(
                            (_tao_in >> *bl.ptr ()) &&
              (_tao_in >> bi.ptr ())
          ))
          TAO_INTERCEPTOR_THROW (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "list",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "list",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK;
#endif /* TAO_HAS_INTERCEPTORS */

}

CORBA::Boolean CosNaming::NamingContext::_is_a (const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV)
{
  if (
    (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CosNaming/NamingContext:1.0")) ||
    (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0")))
  return 1; // success using local knowledge
  else
    return this->CORBA_Object::_is_a (value, ACE_TRY_ENV);
}

const char* CosNaming::NamingContext::_interface_repository_id (void) const
{
  return "IDL:omg.org/CosNaming/NamingContext:1.0";
}

CosNaming::TAO_CosNaming_NamingContext_Default_Proxy_Factory::TAO_CosNaming_NamingContext_Default_Proxy_Factory (int register_proxy_factory)
{
  if (register_proxy_factory)
    {
      TAO_CosNaming_NamingContext_PROXY_FACTORY_ADAPTER::instance ()->register_proxy_factory (this);
    }
}

CosNaming::TAO_CosNaming_NamingContext_Default_Proxy_Factory::~TAO_CosNaming_NamingContext_Default_Proxy_Factory (void)
{
}

CosNaming::NamingContext_ptr
CosNaming::TAO_CosNaming_NamingContext_Default_Proxy_Factory::create_proxy (
    ::CosNaming::NamingContext_ptr proxy,
    CORBA::Environment &
  )
{
  return proxy;
}

CosNaming::TAO_CosNaming_NamingContext_Proxy_Factory_Adapter::TAO_CosNaming_NamingContext_Proxy_Factory_Adapter (void)
   : proxy_factory_ (0),
     delete_proxy_factory_ (0)
{
}

CosNaming::TAO_CosNaming_NamingContext_Proxy_Factory_Adapter::~TAO_CosNaming_NamingContext_Proxy_Factory_Adapter (void)
{
  // Making sure the factory which the adapter has is destroyed with it.
  if (this->proxy_factory_ != 0)
    delete this->proxy_factory_;
}

int
CosNaming::TAO_CosNaming_NamingContext_Proxy_Factory_Adapter::register_proxy_factory (
  TAO_CosNaming_NamingContext_Default_Proxy_Factory *df,
     CORBA::Environment &ACE_TRY_ENV
      )
{
  ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
    this->lock_, 0));
  // Remove any existing <proxy_factory_> and replace with the new one.
  this->unregister_proxy_factory (ACE_TRY_ENV);
  this->proxy_factory_ = df;
  this->delete_proxy_factory_ = 0;
return 0;
}

int
CosNaming::TAO_CosNaming_NamingContext_Proxy_Factory_Adapter::unregister_proxy_factory (
  CORBA::Environment &
    )
{
  ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
    this->lock_, 0));
  if (this->delete_proxy_factory_ == 0 && this->proxy_factory_ != 0)
    {
      // Its necessary to set <delete_proxy_factory_> to 1 to make sure that it
      // doesnt get into an infinite loop in <unregister_proxy_factory> as it is 
      // invoked in the destructor of the class too.
      this->delete_proxy_factory_ = 1;
      delete this->proxy_factory_;
      this->proxy_factory_ = 0;
    }
return 0;
}

CosNaming::NamingContext_ptr
CosNaming::TAO_CosNaming_NamingContext_Proxy_Factory_Adapter::create_proxy (
    ::CosNaming::NamingContext_ptr proxy,
    CORBA::Environment &
  )
{
  ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
    this->lock_, 0));
  // Verify that an <proxy_factory_> is available else make one.
  if (this->proxy_factory_ == 0)
    ACE_NEW_RETURN (this->proxy_factory_,
        TAO_CosNaming_NamingContext_Default_Proxy_Factory (1), 
         0);
      
    
  return this->proxy_factory_->create_proxy (proxy);
}

CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::TAO_CosNaming_NamingContext_Smart_Proxy_Base (::CosNaming::NamingContext_ptr proxy)
: base_proxy_ (proxy)
{
}

CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::~TAO_CosNaming_NamingContext_Smart_Proxy_Base (void)
{
}

void CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::bind  (
    const CosNaming::Name & n,
    CORBA::Object_ptr obj,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName,
    CosNaming::NamingContext::AlreadyBound
  ))
{
  this->base_proxy_->bind (
      n,
      obj,
      ACE_TRY_ENV
    );

}

void CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::rebind  (
    const CosNaming::Name & n,
    CORBA::Object_ptr obj,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName
  ))
{
  this->base_proxy_->rebind (
      n,
      obj,
      ACE_TRY_ENV
    );

}

void CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::bind_context  (
    const CosNaming::Name & n,
    CosNaming::NamingContext_ptr nc,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName,
    CosNaming::NamingContext::AlreadyBound
  ))
{
  this->base_proxy_->bind_context (
      n,
      nc,
      ACE_TRY_ENV
    );

}

void CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::rebind_context  (
    const CosNaming::Name & n,
    CosNaming::NamingContext_ptr nc,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName
  ))
{
  this->base_proxy_->rebind_context (
      n,
      nc,
      ACE_TRY_ENV
    );

}

CORBA::Object_ptr CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::resolve  (
    const CosNaming::Name & n,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName
  ))
{
  return this->base_proxy_->resolve (
      n,
      ACE_TRY_ENV
    );

}

void CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::unbind  (
    const CosNaming::Name & n,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName
  ))
{
  this->base_proxy_->unbind (
      n,
      ACE_TRY_ENV
    );

}

CosNaming::NamingContext_ptr CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::new_context  (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  return this->base_proxy_->new_context (
      ACE_TRY_ENV
    );

}

CosNaming::NamingContext_ptr CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::bind_new_context  (
    const CosNaming::Name & n,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotFound,
    CosNaming::NamingContext::AlreadyBound,
    CosNaming::NamingContext::CannotProceed,
    CosNaming::NamingContext::InvalidName
  ))
{
  return this->base_proxy_->bind_new_context (
      n,
      ACE_TRY_ENV
    );

}

void CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::destroy  (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException,
    CosNaming::NamingContext::NotEmpty
  ))
{
  this->base_proxy_->destroy (
      ACE_TRY_ENV
    );

}

void CosNaming::TAO_CosNaming_NamingContext_Smart_Proxy_Base::list  (
    CORBA::ULong how_many,
    CosNaming::BindingList_out bl,
    CosNaming::BindingIterator_out bi,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  this->base_proxy_->list (
      how_many,
      bl,
      bi,
      ACE_TRY_ENV
    );

}

#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \
  defined (ACE_HAS_GNU_REPO)
template class ACE_Singleton<CosNaming::TAO_CosNaming_NamingContext_Proxy_Factory_Adapter, ACE_SYNCH_RECURSIVE_MUTEX >;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate ACE_Singleton<CosNaming::TAO_CosNaming_NamingContext_Proxy_Factory_Adapter, ACE_SYNCH_RECURSIVE_MUTEX>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */

static const CORBA::Long _oc_CosNaming_NamingContext[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  40, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4e61), ACE_NTOHL (0x6d696e67), ACE_NTOHL (0x436f6e74), ACE_NTOHL (0x6578743a), ACE_NTOHL (0x312e3000),  // repository ID = IDL:omg.org/CosNaming/NamingContext:1.0
  14, ACE_NTOHL (0x4e616d69), ACE_NTOHL (0x6e67436f), ACE_NTOHL (0x6e746578), ACE_NTOHL (0x74000000),  // name = NamingContext
};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_NamingContext (CORBA::tk_objref, sizeof (_oc_CosNaming_NamingContext), (char *) &_oc_CosNaming_NamingContext, 0, sizeof (CosNaming::NamingContext));
TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)
TAO_NAMESPACE_BEGIN (CosNaming)
TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_NamingContext, &_tc_TAO_tc_CosNaming_NamingContext)
TAO_NAMESPACE_END
CosNaming::BindingIterator_ptr CosNaming::BindingIterator::_narrow (
    CORBA::Object_ptr obj,
    CORBA::Environment &ACE_TRY_ENV
  )
{
  if (CORBA::is_nil (obj))
    return BindingIterator::_nil ();
  CORBA::Boolean is_a = obj->_is_a ("IDL:omg.org/CosNaming/BindingIterator:1.0", ACE_TRY_ENV);
  ACE_CHECK_RETURN (BindingIterator::_nil ());
  if (is_a == 0)
    return BindingIterator::_nil ();
  return BindingIterator::_unchecked_narrow (obj, ACE_TRY_ENV);
}

CosNaming::BindingIterator_ptr CosNaming::BindingIterator::_unchecked_narrow (
    CORBA::Object_ptr obj,
    CORBA::Environment &
  )
{
  if (CORBA::is_nil (obj))
    return BindingIterator::_nil ();
  TAO_Stub* stub = obj->_stubobj ();
  stub->_incr_refcnt ();
  BindingIterator_ptr default_proxy = BindingIterator::_nil ();
  if (obj->_is_collocated () && _TAO_collocation_CosNaming_BindingIterator_Stub_Factory_function_pointer != 0)
    {
      default_proxy = _TAO_collocation_CosNaming_BindingIterator_Stub_Factory_function_pointer (obj);
    }
  if (CORBA::is_nil (default_proxy))
    ACE_NEW_RETURN (default_proxy, BindingIterator (stub), BindingIterator::_nil ());
  return TAO_CosNaming_BindingIterator_PROXY_FACTORY_ADAPTER::instance ()->create_proxy (default_proxy);
}

CosNaming::BindingIterator_ptr 
CosNaming::BindingIterator::_duplicate (BindingIterator_ptr obj)
{
  if (!CORBA::is_nil (obj))
    obj->_incr_refcnt ();
  return obj;
}

CORBA::Boolean CosNaming::BindingIterator::next_one (
    CosNaming::Binding_out b,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  
  CORBA::Boolean _tao_retval = 0;
  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW_RETURN (CORBA::INTERNAL (), _tao_retval);

  
  ACE_NEW_RETURN (b.ptr (), CosNaming::Binding, _tao_retval);
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "next_one",
      8,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK_RETURN  (_tao_retval);
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK_RETURN  (_tao_retval);
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK_RETURN  (_tao_retval);

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "next_one",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK_RETURN  (_tao_retval);
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK_RETURN  (_tao_retval);

        int _invoke_status =
          _tao_call.invoke (0, 0, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK_RETURN  (_tao_retval);

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), _tao_retval);

        }
        TAO_InputCDR &_tao_in = _tao_call.inp_stream ();
        if (!(
              (_tao_in >> CORBA::Any::to_boolean (_tao_retval)) &&
              (_tao_in >> *b.ptr ())
          ))
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), _tao_retval);

        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "next_one",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK_RETURN  (_tao_retval);
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "next_one",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK_RETURN  (_tao_retval);
#endif /* TAO_HAS_INTERCEPTORS */
  return _tao_retval;
}

CORBA::Boolean CosNaming::BindingIterator::next_n (
    CORBA::ULong how_many,
    CosNaming::BindingList_out bl,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  
  CORBA::Boolean _tao_retval = 0;
  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW_RETURN (CORBA::INTERNAL (), _tao_retval);

  
  ACE_NEW_RETURN (bl.ptr (), CosNaming::BindingList, _tao_retval);
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "next_n",
      6,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK_RETURN  (_tao_retval);
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK_RETURN  (_tao_retval);
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK_RETURN  (_tao_retval);

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "next_n",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK_RETURN  (_tao_retval);
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK_RETURN  (_tao_retval);

        TAO_OutputCDR &_tao_out = _tao_call.out_stream ();
        if (!(
              (_tao_out << how_many)              
          ))
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::MARSHAL (), _tao_retval);

        int _invoke_status =
          _tao_call.invoke (0, 0, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK_RETURN  (_tao_retval);

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), _tao_retval);

        }
        TAO_InputCDR &_tao_in = _tao_call.inp_stream ();
        if (!(
              (_tao_in >> CORBA::Any::to_boolean (_tao_retval)) &&
                            (_tao_in >> *bl.ptr ())
          ))
          TAO_INTERCEPTOR_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), _tao_retval);

        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "next_n",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK_RETURN  (_tao_retval);
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "next_n",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK_RETURN  (_tao_retval);
#endif /* TAO_HAS_INTERCEPTORS */
  return _tao_retval;
}

void CosNaming::BindingIterator::destroy (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  

  
  
  TAO_Stub *istub = this->_stubobj ();
  if (istub == 0)
    ACE_THROW (CORBA::INTERNAL ());

  
  TAO_GIOP_Twoway_Invocation _tao_call (
      istub,
      "destroy",
      7,
      istub->orb_core ()
    );

#if defined (TAO_HAS_INTERCEPTORS)
    TAO_ClientRequestInterceptor_Adapter
      _tao_vfr (istub->orb_core ()->orb ()->_get_client_interceptor (ACE_TRY_ENV));
    ACE_CHECK;
    PortableInterceptor::Cookies _tao_cookies;
    CORBA::NVList_var _tao_interceptor_args;
    if (_tao_vfr.valid ())
      {
        istub->orb_core ()->orb ()->create_list (0, _tao_interceptor_args.inout (), ACE_TRY_ENV);
        ACE_CHECK;
      }

    ACE_TRY
      {
#endif /* TAO_HAS_INTERCEPTORS */

      for (;;)
      {
        _tao_call.start (ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        TAO_INTERCEPTOR (
            _tao_vfr.preinvoke (
                _tao_call.request_id (),
                1,
                this,
                "destroy",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        CORBA::Short flag = 131;
        // Tremporary hack until GIOP 1.2 is implemented.
        
        _tao_call.prepare_header (ACE_static_cast (CORBA::Octet, flag), ACE_TRY_ENV);
        TAO_INTERCEPTOR_CHECK;

        int _invoke_status =
          _tao_call.invoke (0, 0, ACE_TRY_ENV);
                TAO_INTERCEPTOR_CHECK;

        if (_invoke_status == TAO_INVOKE_RESTART)
          continue;
        if (_invoke_status != TAO_INVOKE_OK)
        {
          TAO_INTERCEPTOR_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES));
        }
        
        TAO_INTERCEPTOR (
            _tao_vfr.postinvoke (
                _tao_call.request_id (),
                1,
                this,
                "destroy",
                _tao_call.service_info (),
                _tao_interceptor_args.inout (),
                _tao_cookies,
                ACE_TRY_ENV
              )
          );
        TAO_INTERCEPTOR_CHECK;
        break;
        
      }
#if defined (TAO_HAS_INTERCEPTORS)
      
    }
  ACE_CATCHANY
    {
      _tao_vfr.exception_occurred (
          _tao_call.request_id (),
          1,
          this,
          "destroy",
          _tao_cookies,
          ACE_TRY_ENV
        );
      ACE_RETHROW;
    }
  ACE_ENDTRY;
  ACE_CHECK;
#endif /* TAO_HAS_INTERCEPTORS */

}

CORBA::Boolean CosNaming::BindingIterator::_is_a (const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV)
{
  if (
    (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CosNaming/BindingIterator:1.0")) ||
    (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0")))
  return 1; // success using local knowledge
  else
    return this->CORBA_Object::_is_a (value, ACE_TRY_ENV);
}

const char* CosNaming::BindingIterator::_interface_repository_id (void) const
{
  return "IDL:omg.org/CosNaming/BindingIterator:1.0";
}

CosNaming::TAO_CosNaming_BindingIterator_Default_Proxy_Factory::TAO_CosNaming_BindingIterator_Default_Proxy_Factory (int register_proxy_factory)
{
  if (register_proxy_factory)
    {
      TAO_CosNaming_BindingIterator_PROXY_FACTORY_ADAPTER::instance ()->register_proxy_factory (this);
    }
}

CosNaming::TAO_CosNaming_BindingIterator_Default_Proxy_Factory::~TAO_CosNaming_BindingIterator_Default_Proxy_Factory (void)
{
}

CosNaming::BindingIterator_ptr
CosNaming::TAO_CosNaming_BindingIterator_Default_Proxy_Factory::create_proxy (
    ::CosNaming::BindingIterator_ptr proxy,
    CORBA::Environment &
  )
{
  return proxy;
}

CosNaming::TAO_CosNaming_BindingIterator_Proxy_Factory_Adapter::TAO_CosNaming_BindingIterator_Proxy_Factory_Adapter (void)
   : proxy_factory_ (0),
     delete_proxy_factory_ (0)
{
}

CosNaming::TAO_CosNaming_BindingIterator_Proxy_Factory_Adapter::~TAO_CosNaming_BindingIterator_Proxy_Factory_Adapter (void)
{
  // Making sure the factory which the adapter has is destroyed with it.
  if (this->proxy_factory_ != 0)
    delete this->proxy_factory_;
}

int
CosNaming::TAO_CosNaming_BindingIterator_Proxy_Factory_Adapter::register_proxy_factory (
  TAO_CosNaming_BindingIterator_Default_Proxy_Factory *df,
     CORBA::Environment &ACE_TRY_ENV
      )
{
  ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
    this->lock_, 0));
  // Remove any existing <proxy_factory_> and replace with the new one.
  this->unregister_proxy_factory (ACE_TRY_ENV);
  this->proxy_factory_ = df;
  this->delete_proxy_factory_ = 0;
return 0;
}

int
CosNaming::TAO_CosNaming_BindingIterator_Proxy_Factory_Adapter::unregister_proxy_factory (
  CORBA::Environment &
    )
{
  ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
    this->lock_, 0));
  if (this->delete_proxy_factory_ == 0 && this->proxy_factory_ != 0)
    {
      // Its necessary to set <delete_proxy_factory_> to 1 to make sure that it
      // doesnt get into an infinite loop in <unregister_proxy_factory> as it is 
      // invoked in the destructor of the class too.
      this->delete_proxy_factory_ = 1;
      delete this->proxy_factory_;
      this->proxy_factory_ = 0;
    }
return 0;
}

CosNaming::BindingIterator_ptr
CosNaming::TAO_CosNaming_BindingIterator_Proxy_Factory_Adapter::create_proxy (
    ::CosNaming::BindingIterator_ptr proxy,
    CORBA::Environment &
  )
{
  ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
    this->lock_, 0));
  // Verify that an <proxy_factory_> is available else make one.
  if (this->proxy_factory_ == 0)
    ACE_NEW_RETURN (this->proxy_factory_,
        TAO_CosNaming_BindingIterator_Default_Proxy_Factory (1), 
         0);
      
    
  return this->proxy_factory_->create_proxy (proxy);
}

CosNaming::TAO_CosNaming_BindingIterator_Smart_Proxy_Base::TAO_CosNaming_BindingIterator_Smart_Proxy_Base (::CosNaming::BindingIterator_ptr proxy)
: base_proxy_ (proxy)
{
}

CosNaming::TAO_CosNaming_BindingIterator_Smart_Proxy_Base::~TAO_CosNaming_BindingIterator_Smart_Proxy_Base (void)
{
}

CORBA::Boolean CosNaming::TAO_CosNaming_BindingIterator_Smart_Proxy_Base::next_one  (
    CosNaming::Binding_out b,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  return this->base_proxy_->next_one (
      b,
      ACE_TRY_ENV
    );

}

CORBA::Boolean CosNaming::TAO_CosNaming_BindingIterator_Smart_Proxy_Base::next_n  (
    CORBA::ULong how_many,
    CosNaming::BindingList_out bl,
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  return this->base_proxy_->next_n (
      how_many,
      bl,
      ACE_TRY_ENV
    );

}

void CosNaming::TAO_CosNaming_BindingIterator_Smart_Proxy_Base::destroy  (
    CORBA::Environment &ACE_TRY_ENV
  )
  ACE_THROW_SPEC ((
    CORBA::SystemException
  ))
{
  this->base_proxy_->destroy (
      ACE_TRY_ENV
    );

}

#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \
  defined (ACE_HAS_GNU_REPO)
template class ACE_Singleton<CosNaming::TAO_CosNaming_BindingIterator_Proxy_Factory_Adapter, ACE_SYNCH_RECURSIVE_MUTEX >;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate ACE_Singleton<CosNaming::TAO_CosNaming_BindingIterator_Proxy_Factory_Adapter, ACE_SYNCH_RECURSIVE_MUTEX>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */

static const CORBA::Long _oc_CosNaming_BindingIterator[] =
{
  TAO_ENCAP_BYTE_ORDER, // byte order
  42, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x6f6d672e), ACE_NTOHL (0x6f72672f), ACE_NTOHL (0x436f734e), ACE_NTOHL (0x616d696e), ACE_NTOHL (0x672f4269), ACE_NTOHL (0x6e64696e), ACE_NTOHL (0x67497465), ACE_NTOHL (0x7261746f), ACE_NTOHL (0x723a312e), ACE_NTOHL (0x30000000),  // repository ID = IDL:omg.org/CosNaming/BindingIterator:1.0
  16, ACE_NTOHL (0x42696e64), ACE_NTOHL (0x696e6749), ACE_NTOHL (0x74657261), ACE_NTOHL (0x746f7200),  // name = BindingIterator
};
static CORBA::TypeCode _tc_TAO_tc_CosNaming_BindingIterator (CORBA::tk_objref, sizeof (_oc_CosNaming_BindingIterator), (char *) &_oc_CosNaming_BindingIterator, 0, sizeof (CosNaming::BindingIterator));
TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)
TAO_NAMESPACE_BEGIN (CosNaming)
TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_BindingIterator, &_tc_TAO_tc_CosNaming_BindingIterator)
TAO_NAMESPACE_END
void operator<<= (CORBA::Any &_tao_any, const CosNaming::NameComponent &_tao_elem) // copying
{
  CosNaming::NameComponent *_any_val = 0;
  ACE_NEW (_any_val, CosNaming::NameComponent (_tao_elem));
  if (!_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_any_val;
    _tao_any._tao_replace (
        CosNaming::_tc_NameComponent,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _any_val,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _any_val;
  }
  ACE_ENDTRY;
}

void operator<<= (CORBA::Any &_tao_any, CosNaming::NameComponent *_tao_elem) // non copying
{
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_elem;
    _tao_any._tao_replace (
        CosNaming::_tc_NameComponent,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_elem,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::NameComponent *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_NameComponent, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NameComponent *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NameComponent, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::_tc_NameComponent,
            1,
            ACE_reinterpret_cast (void *, _tao_elem),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete _tao_elem;
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const CosNaming::NameComponent *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_NameComponent, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NameComponent *)_tao_any.value ();
      return 1;
      }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NameComponent, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *(CosNaming::NameComponent *)_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::_tc_NameComponent,
            1,
            ACE_reinterpret_cast (void *, ACE_const_cast (CosNaming::NameComponent *&, _tao_elem)),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete ACE_const_cast (CosNaming::NameComponent *&, _tao_elem);
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete ACE_const_cast (CosNaming::NameComponent *&, _tao_elem);
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

void operator<<= (
    CORBA::Any &_tao_any,
    const CosNaming::Name &_tao_elem
  ) // copying
{
  CosNaming::Name *_tao_any_val;
  ACE_NEW (_tao_any_val, CosNaming::Name (_tao_elem));
  if (!_tao_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    if (stream << *_tao_any_val)
    {
      _tao_any._tao_replace (
          CosNaming::_tc_Name,
          TAO_ENCAP_BYTE_ORDER,
          stream.begin (),
          1,
          _tao_any_val,
          ACE_TRY_ENV
        );
      ACE_TRY_CHECK; 
    }
    else
    {
      delete _tao_any_val;
    }
  }
  ACE_CATCHANY
  {
    delete _tao_any_val;
  }
  ACE_ENDTRY;
}

void operator<<= (CORBA::Any &_tao_any, CosNaming::Name *_tao_elem) // non copying
{
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_elem;
    _tao_any._tao_replace (
        CosNaming::_tc_Name,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_elem,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::Name *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_Name, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::Name *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::Name, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::_tc_Name,
            1,
            ACE_reinterpret_cast (void *, _tao_elem),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete _tao_elem;
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const CosNaming::Name *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_Name, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::Name *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::Name, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *(CosNaming::Name *)_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::_tc_Name,
            1,
            ACE_reinterpret_cast (void *, ACE_const_cast (CosNaming::Name *&, _tao_elem)),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete ACE_const_cast (CosNaming::Name *&, _tao_elem);
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete ACE_const_cast (CosNaming::Name *&, _tao_elem);
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

void operator<<= (CORBA::Any &_tao_any, CosNaming::BindingType _tao_elem)
{
  CosNaming::BindingType *_tao_any_val;
  ACE_NEW (_tao_any_val, CosNaming::BindingType (_tao_elem));
  if (!_tao_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_any_val;
    _tao_any._tao_replace (
        CosNaming::_tc_BindingType,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_any_val,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    // free allocated storage
    delete _tao_any_val;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::BindingType &_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_BindingType, ACE_TRY_ENV)) // not equal
      {
        return 0;
      }
    ACE_TRY_CHECK;
    TAO_InputCDR stream (
        _tao_any._tao_get_cdr (),
        _tao_any._tao_byte_order ()
      );
    if (stream >> _tao_elem)
    {
      return 1;
    }
  }
  ACE_CATCHANY
  {
    return 0;
  }
  ACE_ENDTRY;
  return 0;
}

void operator<<= (CORBA::Any &_tao_any, const CosNaming::Binding &_tao_elem) // copying
{
  CosNaming::Binding *_any_val = 0;
  ACE_NEW (_any_val, CosNaming::Binding (_tao_elem));
  if (!_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_any_val;
    _tao_any._tao_replace (
        CosNaming::_tc_Binding,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _any_val,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _any_val;
  }
  ACE_ENDTRY;
}

void operator<<= (CORBA::Any &_tao_any, CosNaming::Binding *_tao_elem) // non copying
{
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_elem;
    _tao_any._tao_replace (
        CosNaming::_tc_Binding,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_elem,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::Binding *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_Binding, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::Binding *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::Binding, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::_tc_Binding,
            1,
            ACE_reinterpret_cast (void *, _tao_elem),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete _tao_elem;
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const CosNaming::Binding *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_Binding, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::Binding *)_tao_any.value ();
      return 1;
      }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::Binding, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *(CosNaming::Binding *)_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::_tc_Binding,
            1,
            ACE_reinterpret_cast (void *, ACE_const_cast (CosNaming::Binding *&, _tao_elem)),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete ACE_const_cast (CosNaming::Binding *&, _tao_elem);
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete ACE_const_cast (CosNaming::Binding *&, _tao_elem);
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

void operator<<= (
    CORBA::Any &_tao_any,
    const CosNaming::BindingList &_tao_elem
  ) // copying
{
  CosNaming::BindingList *_tao_any_val;
  ACE_NEW (_tao_any_val, CosNaming::BindingList (_tao_elem));
  if (!_tao_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    if (stream << *_tao_any_val)
    {
      _tao_any._tao_replace (
          CosNaming::_tc_BindingList,
          TAO_ENCAP_BYTE_ORDER,
          stream.begin (),
          1,
          _tao_any_val,
          ACE_TRY_ENV
        );
      ACE_TRY_CHECK; 
    }
    else
    {
      delete _tao_any_val;
    }
  }
  ACE_CATCHANY
  {
    delete _tao_any_val;
  }
  ACE_ENDTRY;
}

void operator<<= (CORBA::Any &_tao_any, CosNaming::BindingList *_tao_elem) // non copying
{
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_elem;
    _tao_any._tao_replace (
        CosNaming::_tc_BindingList,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_elem,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::BindingList *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_BindingList, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::BindingList *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::BindingList, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::_tc_BindingList,
            1,
            ACE_reinterpret_cast (void *, _tao_elem),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete _tao_elem;
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const CosNaming::BindingList *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_BindingList, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::BindingList *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::BindingList, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *(CosNaming::BindingList *)_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::_tc_BindingList,
            1,
            ACE_reinterpret_cast (void *, ACE_const_cast (CosNaming::BindingList *&, _tao_elem)),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete ACE_const_cast (CosNaming::BindingList *&, _tao_elem);
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete ACE_const_cast (CosNaming::BindingList *&, _tao_elem);
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CosNaming::NamingContext_ptr (*_TAO_collocation_CosNaming_NamingContext_Stub_Factory_function_pointer) (
    CORBA::Object_ptr obj
  ) = 0;
void operator<<= (CORBA::Any &_tao_any, CosNaming::NamingContext_ptr _tao_elem)
{
  CORBA::Object_ptr *_tao_obj_ptr = 0;
  ACE_TRY_NEW_ENV
  {
    ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr);
    *_tao_obj_ptr = CosNaming::NamingContext::_duplicate (_tao_elem);
    TAO_OutputCDR stream;
    if (stream << *_tao_obj_ptr)
    {
      _tao_any._tao_replace (
          CosNaming::_tc_NamingContext, 
          TAO_ENCAP_BYTE_ORDER,
          stream.begin (),
          1,
          _tao_obj_ptr,
          ACE_TRY_ENV
        );
      ACE_TRY_CHECK;
    }
    else
    {
      delete _tao_obj_ptr;
    }
  }
  ACE_CATCHANY
  {
    delete _tao_obj_ptr;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::NamingContext_ptr &_tao_elem)
{
  CORBA::Object_ptr *tmp = 0;
  ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0);
  ACE_TRY_NEW_ENV
  {
    _tao_elem = CosNaming::NamingContext::_nil ();
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_NamingContext, ACE_TRY_ENV)) // not equal
      {
        delete tmp;
        return 0;
      }
    ACE_TRY_CHECK;
    TAO_InputCDR stream (
        _tao_any._tao_get_cdr (),
        _tao_any._tao_byte_order ()
      );
    CORBA::Object_var _tao_obj_var;
    if (stream >> _tao_obj_var.out ())
    {
      _tao_elem = CosNaming::NamingContext::_narrow (_tao_obj_var.in (), ACE_TRY_ENV);
      ACE_TRY_CHECK;
      *tmp = (CORBA::Object_ptr) _tao_elem;  // any owns the object
      ((CORBA::Any *)&_tao_any)->_tao_replace (
          CosNaming::_tc_NamingContext,
          1,
          tmp,
          ACE_TRY_ENV
        );
      ACE_TRY_CHECK;
      return 1;
    }
    else    // failure
    {
      delete tmp;
    }
  }
  ACE_CATCHANY
  {
    delete tmp;
    _tao_elem = CosNaming::NamingContext::_nil ();
    return 0;
  }
  ACE_ENDTRY;
  _tao_elem = CosNaming::NamingContext::_nil ();
  return 0;
}

#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)  || \
    defined (ACE_HAS_GNU_REPO)
    template class TAO_Object_Field_T<CosNaming::NamingContext,CosNaming::NamingContext_var>;
  template class TAO_Object_Manager<CosNaming::NamingContext,CosNaming::NamingContext_var>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#  pragma instantiate TAO_Object_Field_T<CosNaming::NamingContext,CosNaming::NamingContext_var>
#  pragma instantiate TAO_Object_Manager<CosNaming::NamingContext,CosNaming::NamingContext_var>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */

void operator<<= (CORBA::Any &_tao_any, CosNaming::NamingContext::NotFoundReason _tao_elem)
{
  CosNaming::NamingContext::NotFoundReason *_tao_any_val;
  ACE_NEW (_tao_any_val, CosNaming::NamingContext::NotFoundReason (_tao_elem));
  if (!_tao_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_any_val;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_NotFoundReason,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_any_val,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    // free allocated storage
    delete _tao_any_val;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::NamingContext::NotFoundReason &_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_NotFoundReason, ACE_TRY_ENV)) // not equal
      {
        return 0;
      }
    ACE_TRY_CHECK;
    TAO_InputCDR stream (
        _tao_any._tao_get_cdr (),
        _tao_any._tao_byte_order ()
      );
    if (stream >> _tao_elem)
    {
      return 1;
    }
  }
  ACE_CATCHANY
  {
    return 0;
  }
  ACE_ENDTRY;
  return 0;
}

void operator<<= (CORBA::Any &_tao_any, const CosNaming::NamingContext::NotFound &_tao_elem) // copying
{
  CosNaming::NamingContext::NotFound *_tao_any_val = 0;
  ACE_NEW (_tao_any_val, CosNaming::NamingContext::NotFound (_tao_elem));
  if (!_tao_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_any_val;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_NotFound,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_any_val,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY 
  {
    delete _tao_any_val;
  }
  ACE_ENDTRY;
}

void operator<<= (CORBA::Any &_tao_any, CosNaming::NamingContext::NotFound *_tao_elem) // non copying
{
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_elem;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_NotFound,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_elem,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::NamingContext::NotFound *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_NotFound, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NamingContext::NotFound *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NamingContext::NotFound, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::NamingContext::_tc_NotFound,
            1,
            ACE_reinterpret_cast (void *, _tao_elem),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete _tao_elem;
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const CosNaming::NamingContext::NotFound *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_NotFound, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NamingContext::NotFound *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NamingContext::NotFound, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *(CosNaming::NamingContext::NotFound *)_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::NamingContext::_tc_NotFound,
            1,
            ACE_reinterpret_cast (void *, ACE_const_cast (CosNaming::NamingContext::NotFound *&, _tao_elem)),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete ACE_const_cast (CosNaming::NamingContext::NotFound *&, _tao_elem);
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete ACE_const_cast (CosNaming::NamingContext::NotFound *&, _tao_elem);
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

void operator<<= (CORBA::Any &_tao_any, const CosNaming::NamingContext::CannotProceed &_tao_elem) // copying
{
  CosNaming::NamingContext::CannotProceed *_tao_any_val = 0;
  ACE_NEW (_tao_any_val, CosNaming::NamingContext::CannotProceed (_tao_elem));
  if (!_tao_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_any_val;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_CannotProceed,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_any_val,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY 
  {
    delete _tao_any_val;
  }
  ACE_ENDTRY;
}

void operator<<= (CORBA::Any &_tao_any, CosNaming::NamingContext::CannotProceed *_tao_elem) // non copying
{
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_elem;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_CannotProceed,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_elem,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::NamingContext::CannotProceed *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_CannotProceed, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NamingContext::CannotProceed *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NamingContext::CannotProceed, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::NamingContext::_tc_CannotProceed,
            1,
            ACE_reinterpret_cast (void *, _tao_elem),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete _tao_elem;
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const CosNaming::NamingContext::CannotProceed *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_CannotProceed, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NamingContext::CannotProceed *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NamingContext::CannotProceed, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *(CosNaming::NamingContext::CannotProceed *)_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::NamingContext::_tc_CannotProceed,
            1,
            ACE_reinterpret_cast (void *, ACE_const_cast (CosNaming::NamingContext::CannotProceed *&, _tao_elem)),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete ACE_const_cast (CosNaming::NamingContext::CannotProceed *&, _tao_elem);
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete ACE_const_cast (CosNaming::NamingContext::CannotProceed *&, _tao_elem);
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

void operator<<= (CORBA::Any &_tao_any, const CosNaming::NamingContext::InvalidName &_tao_elem) // copying
{
  CosNaming::NamingContext::InvalidName *_tao_any_val = 0;
  ACE_NEW (_tao_any_val, CosNaming::NamingContext::InvalidName (_tao_elem));
  if (!_tao_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_any_val;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_InvalidName,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_any_val,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY 
  {
    delete _tao_any_val;
  }
  ACE_ENDTRY;
}

void operator<<= (CORBA::Any &_tao_any, CosNaming::NamingContext::InvalidName *_tao_elem) // non copying
{
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_elem;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_InvalidName,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_elem,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::NamingContext::InvalidName *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_InvalidName, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NamingContext::InvalidName *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NamingContext::InvalidName, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::NamingContext::_tc_InvalidName,
            1,
            ACE_reinterpret_cast (void *, _tao_elem),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete _tao_elem;
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const CosNaming::NamingContext::InvalidName *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_InvalidName, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NamingContext::InvalidName *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NamingContext::InvalidName, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *(CosNaming::NamingContext::InvalidName *)_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::NamingContext::_tc_InvalidName,
            1,
            ACE_reinterpret_cast (void *, ACE_const_cast (CosNaming::NamingContext::InvalidName *&, _tao_elem)),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete ACE_const_cast (CosNaming::NamingContext::InvalidName *&, _tao_elem);
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete ACE_const_cast (CosNaming::NamingContext::InvalidName *&, _tao_elem);
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

void operator<<= (CORBA::Any &_tao_any, const CosNaming::NamingContext::AlreadyBound &_tao_elem) // copying
{
  CosNaming::NamingContext::AlreadyBound *_tao_any_val = 0;
  ACE_NEW (_tao_any_val, CosNaming::NamingContext::AlreadyBound (_tao_elem));
  if (!_tao_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_any_val;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_AlreadyBound,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_any_val,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY 
  {
    delete _tao_any_val;
  }
  ACE_ENDTRY;
}

void operator<<= (CORBA::Any &_tao_any, CosNaming::NamingContext::AlreadyBound *_tao_elem) // non copying
{
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_elem;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_AlreadyBound,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_elem,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::NamingContext::AlreadyBound *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_AlreadyBound, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NamingContext::AlreadyBound *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NamingContext::AlreadyBound, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::NamingContext::_tc_AlreadyBound,
            1,
            ACE_reinterpret_cast (void *, _tao_elem),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete _tao_elem;
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const CosNaming::NamingContext::AlreadyBound *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_AlreadyBound, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NamingContext::AlreadyBound *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NamingContext::AlreadyBound, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *(CosNaming::NamingContext::AlreadyBound *)_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::NamingContext::_tc_AlreadyBound,
            1,
            ACE_reinterpret_cast (void *, ACE_const_cast (CosNaming::NamingContext::AlreadyBound *&, _tao_elem)),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete ACE_const_cast (CosNaming::NamingContext::AlreadyBound *&, _tao_elem);
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete ACE_const_cast (CosNaming::NamingContext::AlreadyBound *&, _tao_elem);
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

void operator<<= (CORBA::Any &_tao_any, const CosNaming::NamingContext::NotEmpty &_tao_elem) // copying
{
  CosNaming::NamingContext::NotEmpty *_tao_any_val = 0;
  ACE_NEW (_tao_any_val, CosNaming::NamingContext::NotEmpty (_tao_elem));
  if (!_tao_any_val) return;
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_any_val;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_NotEmpty,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_any_val,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY 
  {
    delete _tao_any_val;
  }
  ACE_ENDTRY;
}

void operator<<= (CORBA::Any &_tao_any, CosNaming::NamingContext::NotEmpty *_tao_elem) // non copying
{
  ACE_TRY_NEW_ENV
  {
    TAO_OutputCDR stream;
    stream << *_tao_elem;
    _tao_any._tao_replace (
        CosNaming::NamingContext::_tc_NotEmpty,
        TAO_ENCAP_BYTE_ORDER,
        stream.begin (),
        1,
        _tao_elem,
        ACE_TRY_ENV
      );
    ACE_TRY_CHECK;
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::NamingContext::NotEmpty *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_NotEmpty, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NamingContext::NotEmpty *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NamingContext::NotEmpty, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::NamingContext::_tc_NotEmpty,
            1,
            ACE_reinterpret_cast (void *, _tao_elem),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete _tao_elem;
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete _tao_elem;
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const CosNaming::NamingContext::NotEmpty *&_tao_elem)
{
  ACE_TRY_NEW_ENV
  {
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::NamingContext::_tc_NotEmpty, ACE_TRY_ENV)) // not equal
      {
        _tao_elem = 0;
        return 0;
      }
    ACE_TRY_CHECK;
    if (_tao_any.any_owns_data ())
    {
      _tao_elem = (CosNaming::NamingContext::NotEmpty *)_tao_any.value ();
      return 1;
    }
    else
    {
      ACE_NEW_RETURN (_tao_elem, CosNaming::NamingContext::NotEmpty, 0);
      TAO_InputCDR stream (
          _tao_any._tao_get_cdr (),
          _tao_any._tao_byte_order ()
        );
      if (stream >> *(CosNaming::NamingContext::NotEmpty *)_tao_elem)
      {
        ((CORBA::Any *)&_tao_any)->_tao_replace (
            CosNaming::NamingContext::_tc_NotEmpty,
            1,
            ACE_reinterpret_cast (void *, ACE_const_cast (CosNaming::NamingContext::NotEmpty *&, _tao_elem)),
            ACE_TRY_ENV
          );
        ACE_TRY_CHECK;
        return 1;
      }
      else
      {
        delete ACE_const_cast (CosNaming::NamingContext::NotEmpty *&, _tao_elem);
        _tao_elem = 0;
      }
    }
  }
  ACE_CATCHANY
  {
    delete ACE_const_cast (CosNaming::NamingContext::NotEmpty *&, _tao_elem);
    _tao_elem = 0;
    return 0; 
  }
  ACE_ENDTRY;
  return 0;
}

CosNaming::BindingIterator_ptr (*_TAO_collocation_CosNaming_BindingIterator_Stub_Factory_function_pointer) (
    CORBA::Object_ptr obj
  ) = 0;
void operator<<= (CORBA::Any &_tao_any, CosNaming::BindingIterator_ptr _tao_elem)
{
  CORBA::Object_ptr *_tao_obj_ptr = 0;
  ACE_TRY_NEW_ENV
  {
    ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr);
    *_tao_obj_ptr = CosNaming::BindingIterator::_duplicate (_tao_elem);
    TAO_OutputCDR stream;
    if (stream << *_tao_obj_ptr)
    {
      _tao_any._tao_replace (
          CosNaming::_tc_BindingIterator, 
          TAO_ENCAP_BYTE_ORDER,
          stream.begin (),
          1,
          _tao_obj_ptr,
          ACE_TRY_ENV
        );
      ACE_TRY_CHECK;
    }
    else
    {
      delete _tao_obj_ptr;
    }
  }
  ACE_CATCHANY
  {
    delete _tao_obj_ptr;
  }
  ACE_ENDTRY;
}

CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CosNaming::BindingIterator_ptr &_tao_elem)
{
  CORBA::Object_ptr *tmp = 0;
  ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0);
  ACE_TRY_NEW_ENV
  {
    _tao_elem = CosNaming::BindingIterator::_nil ();
    CORBA::TypeCode_var type = _tao_any.type ();
    if (!type->equivalent (CosNaming::_tc_BindingIterator, ACE_TRY_ENV)) // not equal
      {
        delete tmp;
        return 0;
      }
    ACE_TRY_CHECK;
    TAO_InputCDR stream (
        _tao_any._tao_get_cdr (),
        _tao_any._tao_byte_order ()
      );
    CORBA::Object_var _tao_obj_var;
    if (stream >> _tao_obj_var.out ())
    {
      _tao_elem = CosNaming::BindingIterator::_narrow (_tao_obj_var.in (), ACE_TRY_ENV);
      ACE_TRY_CHECK;
      *tmp = (CORBA::Object_ptr) _tao_elem;  // any owns the object
      ((CORBA::Any *)&_tao_any)->_tao_replace (
          CosNaming::_tc_BindingIterator,
          1,
          tmp,
          ACE_TRY_ENV
        );
      ACE_TRY_CHECK;
      return 1;
    }
    else    // failure
    {
      delete tmp;
    }
  }
  ACE_CATCHANY
  {
    delete tmp;
    _tao_elem = CosNaming::BindingIterator::_nil ();
    return 0;
  }
  ACE_ENDTRY;
  _tao_elem = CosNaming::BindingIterator::_nil ();
  return 0;
}

#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)  || \
    defined (ACE_HAS_GNU_REPO)
    template class TAO_Object_Field_T<CosNaming::BindingIterator,CosNaming::BindingIterator_var>;
  template class TAO_Object_Manager<CosNaming::BindingIterator,CosNaming::BindingIterator_var>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#  pragma instantiate TAO_Object_Field_T<CosNaming::BindingIterator,CosNaming::BindingIterator_var>
#  pragma instantiate TAO_Object_Manager<CosNaming::BindingIterator,CosNaming::BindingIterator_var>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */

CORBA::Boolean operator<< (
    TAO_OutputCDR &strm,
    const CosNaming::Name &_tao_sequence
  )
{
  if (strm << _tao_sequence.length ())
  {
    // encode all elements
    CORBA::Boolean _tao_marshal_flag = 1;
    for (CORBA::ULong i = 0; i < _tao_sequence.length () && _tao_marshal_flag; i++)
    {
      _tao_marshal_flag = (strm << _tao_sequence[i]);
    }
    return _tao_marshal_flag;
  }
  return 0; // error
}

CORBA::Boolean operator>> (
    TAO_InputCDR &strm,
    CosNaming::Name &_tao_sequence
  )
{
  CORBA::ULong _tao_seq_len;
  if (strm >> _tao_seq_len)
  {
    // set the length of the sequence
    _tao_sequence.length (_tao_seq_len);
    // If length is 0 we return true.
    if (0 >= _tao_seq_len) 
      return 1;
    // retrieve all the elements
    CORBA::Boolean _tao_marshal_flag = 1;
    for (CORBA::ULong i = 0; i < _tao_sequence.length () && _tao_marshal_flag; i++)
    {
      _tao_marshal_flag = (strm >> _tao_sequence[i]);
    }
    return _tao_marshal_flag;
  }
  return 0; // error
}

CORBA::Boolean operator<< (
    TAO_OutputCDR &strm,
    const CosNaming::BindingList &_tao_sequence
  )
{
  if (strm << _tao_sequence.length ())
  {
    // encode all elements
    CORBA::Boolean _tao_marshal_flag = 1;
    for (CORBA::ULong i = 0; i < _tao_sequence.length () && _tao_marshal_flag; i++)
    {
      _tao_marshal_flag = (strm << _tao_sequence[i]);
    }
    return _tao_marshal_flag;
  }
  return 0; // error
}

CORBA::Boolean operator>> (
    TAO_InputCDR &strm,
    CosNaming::BindingList &_tao_sequence
  )
{
  CORBA::ULong _tao_seq_len;
  if (strm >> _tao_seq_len)
  {
    // set the length of the sequence
    _tao_sequence.length (_tao_seq_len);
    // If length is 0 we return true.
    if (0 >= _tao_seq_len) 
      return 1;
    // retrieve all the elements
    CORBA::Boolean _tao_marshal_flag = 1;
    for (CORBA::ULong i = 0; i < _tao_sequence.length () && _tao_marshal_flag; i++)
    {
      _tao_marshal_flag = (strm >> _tao_sequence[i]);
    }
    return _tao_marshal_flag;
  }
  return 0; // error
}

