/*
 *  MICO --- a free CORBA implementation
 *  Copyright (C) 1997-98 Kay Roemer & Arno Puder
 *
 *  This file was automatically generated. DO NOT EDIT!
 */

#if !defined(__COSNAMING_H__) || defined(MICO_NO_TOPLEVEL_MODULES)
#define __COSNAMING_H__

#ifndef MICO_NO_TOPLEVEL_MODULES
#include <CORBA.h>
#include <mico/throw.h>
#endif

#ifndef MICO_NO_TOPLEVEL_MODULES
MICO_NAMESPACE_DECL CosNaming {
#endif

#if !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE_CosNaming)


typedef char* Istring;
typedef CORBA::String_var Istring_var;
typedef CORBA::String_out Istring_out;

struct NameComponent;
typedef TVarVar<NameComponent> NameComponent_var;
typedef NameComponent_var NameComponent_out;

struct NameComponent {
  #ifdef HAVE_TYPEDEF_OVERLOAD
  typedef NameComponent_var _var_type;
  #endif
  #ifdef HAVE_EXPLICIT_STRUCT_OPS
  NameComponent();
  ~NameComponent();
  NameComponent( const NameComponent& s );
  NameComponent& operator=( const NameComponent& s );
  #endif //HAVE_EXPLICIT_STRUCT_OPS

  Istring_var id;
  Istring_var kind;
};

typedef SequenceTmpl<NameComponent,MICO_TID_DEF> Name;
#ifdef _WINDOWS
static Name _dummy_Name;
#endif
typedef TSeqVar<SequenceTmpl<NameComponent,MICO_TID_DEF> > Name_var;
typedef Name_var Name_out;

enum BindingType {
  nobject = 0,
  ncontext
};

typedef BindingType& BindingType_out;

struct Binding;
typedef TVarVar<Binding> Binding_var;
typedef Binding_var Binding_out;

struct Binding {
  #ifdef HAVE_TYPEDEF_OVERLOAD
  typedef Binding_var _var_type;
  #endif
  #ifdef HAVE_EXPLICIT_STRUCT_OPS
  Binding();
  ~Binding();
  Binding( const Binding& s );
  Binding& operator=( const Binding& s );
  #endif //HAVE_EXPLICIT_STRUCT_OPS

  Name binding_name;
  BindingType binding_type;
};

typedef SequenceTmpl<Binding,MICO_TID_DEF> BindingList;
#ifdef _WINDOWS
static BindingList _dummy_BindingList;
#endif
typedef TSeqVar<SequenceTmpl<Binding,MICO_TID_DEF> > BindingList_var;
typedef BindingList_var BindingList_out;

class NamingContext;
typedef NamingContext *NamingContext_ptr;
typedef NamingContext_ptr NamingContextRef;
typedef ObjVar<NamingContext> NamingContext_var;
typedef NamingContext_var NamingContext_out;

class BindingIterator;
typedef BindingIterator *BindingIterator_ptr;
typedef BindingIterator_ptr BindingIteratorRef;
typedef ObjVar<BindingIterator> BindingIterator_var;
typedef BindingIterator_var BindingIterator_out;


// Common definitions for interface NamingContext
class NamingContext : 
  virtual public CORBA::Object
{
  public:
    virtual ~NamingContext();

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef NamingContext_ptr _ptr_type;
    typedef NamingContext_var _var_type;
    #endif

    static NamingContext_ptr _narrow( CORBA::Object_ptr obj );
    static NamingContext_ptr _narrow( CORBA::AbstractBase_ptr obj );
    static NamingContext_ptr _duplicate( NamingContext_ptr _obj )
    {
      CORBA::Object::_duplicate (_obj);
      return _obj;
    }

    static NamingContext_ptr _nil()
    {
      return 0;
    }

    virtual void *_narrow_helper( const char *repoid );
    static vector<CORBA::Narrow_proto> *_narrow_helpers;
    static bool _narrow_helper2( CORBA::Object_ptr obj );

    enum NotFoundReason {
      missing_node = 0,
      not_context,
      not_object
    };

    typedef NotFoundReason& NotFoundReason_out;

    struct NotFound : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      NotFound();
      ~NotFound();
      NotFound( const NotFound& s );
      NotFound& operator=( const NotFound& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      #ifndef HAVE_EXPLICIT_STRUCT_OPS
      NotFound();
      #endif //HAVE_EXPLICIT_STRUCT_OPS
      NotFound( NotFoundReason _m0, const Name& _m1 );

      #ifdef HAVE_STD_EH
      NotFound *operator->() { return this; }
      NotFound& operator*() { return *this; }
      operator NotFound*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static NotFound *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const NotFound *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
      NotFoundReason why;
      Name rest_of_name;
    };

    #ifdef HAVE_STD_EH
    typedef NotFound NotFound_catch;
    #else
    typedef ExceptVar<NotFound> NotFound_var;
    typedef NotFound_var NotFound_out;
    typedef NotFound_var NotFound_catch;
    #endif // HAVE_STD_EH

    struct CannotProceed : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      CannotProceed();
      ~CannotProceed();
      CannotProceed( const CannotProceed& s );
      CannotProceed& operator=( const CannotProceed& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS

      #ifndef HAVE_EXPLICIT_STRUCT_OPS
      CannotProceed();
      #endif //HAVE_EXPLICIT_STRUCT_OPS
      CannotProceed( NamingContext_ptr _m0, const Name& _m1 );

      #ifdef HAVE_STD_EH
      CannotProceed *operator->() { return this; }
      CannotProceed& operator*() { return *this; }
      operator CannotProceed*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static CannotProceed *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const CannotProceed *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
      NamingContext_var cxt;
      Name rest_of_name;
    };

    #ifdef HAVE_STD_EH
    typedef CannotProceed CannotProceed_catch;
    #else
    typedef ExceptVar<CannotProceed> CannotProceed_var;
    typedef CannotProceed_var CannotProceed_out;
    typedef CannotProceed_var CannotProceed_catch;
    #endif // HAVE_STD_EH

    struct InvalidName : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      InvalidName();
      ~InvalidName();
      InvalidName( const InvalidName& s );
      InvalidName& operator=( const InvalidName& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS


      #ifdef HAVE_STD_EH
      InvalidName *operator->() { return this; }
      InvalidName& operator*() { return *this; }
      operator InvalidName*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static InvalidName *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const InvalidName *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
    };

    #ifdef HAVE_STD_EH
    typedef InvalidName InvalidName_catch;
    #else
    typedef ExceptVar<InvalidName> InvalidName_var;
    typedef InvalidName_var InvalidName_out;
    typedef InvalidName_var InvalidName_catch;
    #endif // HAVE_STD_EH

    struct AlreadyBound : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      AlreadyBound();
      ~AlreadyBound();
      AlreadyBound( const AlreadyBound& s );
      AlreadyBound& operator=( const AlreadyBound& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS


      #ifdef HAVE_STD_EH
      AlreadyBound *operator->() { return this; }
      AlreadyBound& operator*() { return *this; }
      operator AlreadyBound*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static AlreadyBound *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const AlreadyBound *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
    };

    #ifdef HAVE_STD_EH
    typedef AlreadyBound AlreadyBound_catch;
    #else
    typedef ExceptVar<AlreadyBound> AlreadyBound_var;
    typedef AlreadyBound_var AlreadyBound_out;
    typedef AlreadyBound_var AlreadyBound_catch;
    #endif // HAVE_STD_EH

    struct NotEmpty : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      NotEmpty();
      ~NotEmpty();
      NotEmpty( const NotEmpty& s );
      NotEmpty& operator=( const NotEmpty& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS


      #ifdef HAVE_STD_EH
      NotEmpty *operator->() { return this; }
      NotEmpty& operator*() { return *this; }
      operator NotEmpty*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static NotEmpty *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const NotEmpty *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
    };

    #ifdef HAVE_STD_EH
    typedef NotEmpty NotEmpty_catch;
    #else
    typedef ExceptVar<NotEmpty> NotEmpty_var;
    typedef NotEmpty_var NotEmpty_out;
    typedef NotEmpty_var NotEmpty_catch;
    #endif // HAVE_STD_EH

    virtual void bind( const Name& n, CORBA::Object_ptr obj ) = 0;
    virtual void rebind( const Name& n, CORBA::Object_ptr obj ) = 0;
    virtual void bind_context( const Name& n, NamingContext_ptr nc ) = 0;
    virtual void rebind_context( const Name& n, NamingContext_ptr nc ) = 0;
    virtual CORBA::Object_ptr resolve( const Name& n ) = 0;
    virtual void unbind( const Name& n ) = 0;
    virtual NamingContext_ptr new_context() = 0;
    virtual NamingContext_ptr bind_new_context( const Name& n ) = 0;
    virtual void destroy() = 0;
    virtual void list( CORBA::ULong how_many, BindingList*& bl, BindingIterator_ptr& bi ) = 0;

  protected:
    NamingContext() {};
  private:
    NamingContext( const NamingContext& );
    void operator=( const NamingContext& );
};

// Stub for interface NamingContext
class NamingContext_stub:
  virtual public NamingContext
{
  public:
    virtual ~NamingContext_stub();
    void bind( const Name& n, CORBA::Object_ptr obj );
    void rebind( const Name& n, CORBA::Object_ptr obj );
    void bind_context( const Name& n, NamingContext_ptr nc );
    void rebind_context( const Name& n, NamingContext_ptr nc );
    CORBA::Object_ptr resolve( const Name& n );
    void unbind( const Name& n );
    NamingContext_ptr new_context();
    NamingContext_ptr bind_new_context( const Name& n );
    void destroy();
    void list( CORBA::ULong how_many, BindingList*& bl, BindingIterator_ptr& bi );

  private:
    void operator=( const NamingContext_stub& );
};

#ifndef MICO_CONF_NO_POA

class NamingContext_stub_clp :
  virtual public NamingContext_stub,
  virtual public PortableServer::StubBase
{
  public:
    NamingContext_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~NamingContext_stub_clp ();
    void bind( const Name& n, CORBA::Object_ptr obj );
    void rebind( const Name& n, CORBA::Object_ptr obj );
    void bind_context( const Name& n, NamingContext_ptr nc );
    void rebind_context( const Name& n, NamingContext_ptr nc );
    CORBA::Object_ptr resolve( const Name& n );
    void unbind( const Name& n );
    NamingContext_ptr new_context();
    NamingContext_ptr bind_new_context( const Name& n );
    void destroy();
    void list( CORBA::ULong how_many, BindingList*& bl, BindingIterator_ptr& bi );

  protected:
    NamingContext_stub_clp ();
  private:
    void operator=( const NamingContext_stub_clp & );
};

#endif // MICO_CONF_NO_POA


// Common definitions for interface BindingIterator
class BindingIterator : 
  virtual public CORBA::Object
{
  public:
    virtual ~BindingIterator();

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef BindingIterator_ptr _ptr_type;
    typedef BindingIterator_var _var_type;
    #endif

    static BindingIterator_ptr _narrow( CORBA::Object_ptr obj );
    static BindingIterator_ptr _narrow( CORBA::AbstractBase_ptr obj );
    static BindingIterator_ptr _duplicate( BindingIterator_ptr _obj )
    {
      CORBA::Object::_duplicate (_obj);
      return _obj;
    }

    static BindingIterator_ptr _nil()
    {
      return 0;
    }

    virtual void *_narrow_helper( const char *repoid );
    static vector<CORBA::Narrow_proto> *_narrow_helpers;
    static bool _narrow_helper2( CORBA::Object_ptr obj );

    virtual CORBA::Boolean next_one( Binding*& b ) = 0;
    virtual CORBA::Boolean next_n( CORBA::ULong how_many, BindingList*& bl ) = 0;
    virtual void destroy() = 0;

  protected:
    BindingIterator() {};
  private:
    BindingIterator( const BindingIterator& );
    void operator=( const BindingIterator& );
};

// Stub for interface BindingIterator
class BindingIterator_stub:
  virtual public BindingIterator
{
  public:
    virtual ~BindingIterator_stub();
    CORBA::Boolean next_one( Binding*& b );
    CORBA::Boolean next_n( CORBA::ULong how_many, BindingList*& bl );
    void destroy();

  private:
    void operator=( const BindingIterator_stub& );
};

#ifndef MICO_CONF_NO_POA

class BindingIterator_stub_clp :
  virtual public BindingIterator_stub,
  virtual public PortableServer::StubBase
{
  public:
    BindingIterator_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~BindingIterator_stub_clp ();
    CORBA::Boolean next_one( Binding*& b );
    CORBA::Boolean next_n( CORBA::ULong how_many, BindingList*& bl );
    void destroy();

  protected:
    BindingIterator_stub_clp ();
  private:
    void operator=( const BindingIterator_stub_clp & );
};

#endif // MICO_CONF_NO_POA

class NamingContextExt;
typedef NamingContextExt *NamingContextExt_ptr;
typedef NamingContextExt_ptr NamingContextExtRef;
typedef ObjVar<NamingContextExt> NamingContextExt_var;
typedef NamingContextExt_var NamingContextExt_out;


// Common definitions for interface NamingContextExt
class NamingContextExt : 
  virtual public ::CosNaming::NamingContext
{
  public:
    virtual ~NamingContextExt();

    #ifdef HAVE_TYPEDEF_OVERLOAD
    typedef NamingContextExt_ptr _ptr_type;
    typedef NamingContextExt_var _var_type;
    #endif

    static NamingContextExt_ptr _narrow( CORBA::Object_ptr obj );
    static NamingContextExt_ptr _narrow( CORBA::AbstractBase_ptr obj );
    static NamingContextExt_ptr _duplicate( NamingContextExt_ptr _obj )
    {
      CORBA::Object::_duplicate (_obj);
      return _obj;
    }

    static NamingContextExt_ptr _nil()
    {
      return 0;
    }

    virtual void *_narrow_helper( const char *repoid );
    static vector<CORBA::Narrow_proto> *_narrow_helpers;
    static bool _narrow_helper2( CORBA::Object_ptr obj );

    typedef char* StringName;
    typedef CORBA::String_var StringName_var;
    typedef CORBA::String_out StringName_out;

    typedef char* Address;
    typedef CORBA::String_var Address_var;
    typedef CORBA::String_out Address_out;

    typedef char* URLString;
    typedef CORBA::String_var URLString_var;
    typedef CORBA::String_out URLString_out;

    struct InvalidAddress : public CORBA::UserException {
      #ifdef HAVE_EXPLICIT_STRUCT_OPS
      InvalidAddress();
      ~InvalidAddress();
      InvalidAddress( const InvalidAddress& s );
      InvalidAddress& operator=( const InvalidAddress& s );
      #endif //HAVE_EXPLICIT_STRUCT_OPS


      #ifdef HAVE_STD_EH
      InvalidAddress *operator->() { return this; }
      InvalidAddress& operator*() { return *this; }
      operator InvalidAddress*() { return this; }
      #endif // HAVE_STD_EH

      void _throwit() const;
      const char *_repoid() const;
      void _encode( CORBA::DataEncoder &en ) const;
      void _encode_any( CORBA::Any &a ) const;
      CORBA::Exception *_clone() const;
      static InvalidAddress *EXCEPTION_DOWNCAST( CORBA::Exception *ex );
      static const InvalidAddress *EXCEPTION_DOWNCAST( const CORBA::Exception *ex );
    };

    #ifdef HAVE_STD_EH
    typedef InvalidAddress InvalidAddress_catch;
    #else
    typedef ExceptVar<InvalidAddress> InvalidAddress_var;
    typedef InvalidAddress_var InvalidAddress_out;
    typedef InvalidAddress_var InvalidAddress_catch;
    #endif // HAVE_STD_EH

    virtual char* to_string( const Name& n ) = 0;
    virtual Name* to_name( const char* sn ) = 0;
    virtual char* to_url( const char* addr, const char* sn ) = 0;
    virtual CORBA::Object_ptr resolve_str( const char* n ) = 0;

  protected:
    NamingContextExt() {};
  private:
    NamingContextExt( const NamingContextExt& );
    void operator=( const NamingContextExt& );
};

// Stub for interface NamingContextExt
class NamingContextExt_stub:
  virtual public NamingContextExt,
  virtual public ::CosNaming::NamingContext_stub
{
  public:
    virtual ~NamingContextExt_stub();
    char* to_string( const Name& n );
    Name* to_name( const char* sn );
    char* to_url( const char* addr, const char* sn );
    CORBA::Object_ptr resolve_str( const char* n );

  private:
    void operator=( const NamingContextExt_stub& );
};

#ifndef MICO_CONF_NO_POA

class NamingContextExt_stub_clp :
  virtual public NamingContextExt_stub,
  virtual public ::CosNaming::NamingContext_stub_clp
{
  public:
    NamingContextExt_stub_clp (PortableServer::POA_ptr, CORBA::Object_ptr);
    virtual ~NamingContextExt_stub_clp ();
    char* to_string( const Name& n );
    Name* to_name( const char* sn );
    char* to_url( const char* addr, const char* sn );
    CORBA::Object_ptr resolve_str( const char* n );

  protected:
    NamingContextExt_stub_clp ();
  private:
    void operator=( const NamingContextExt_stub_clp & );
};

#endif // MICO_CONF_NO_POA

#endif // !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE_CosNaming)

#ifndef MICO_NO_TOPLEVEL_MODULES

};
#endif



#ifndef MICO_CONF_NO_POA

#ifndef MICO_NO_TOPLEVEL_MODULES
MICO_NAMESPACE_DECL POA_CosNaming {
#endif

#if !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE_POA_CosNaming)


class NamingContext : virtual public PortableServer::StaticImplementation
{
  public:
    virtual ~NamingContext ();
    CosNaming::NamingContext_ptr _this ();
    bool dispatch (CORBA::StaticServerRequest_ptr);
    virtual void invoke (CORBA::StaticServerRequest_ptr);
    virtual CORBA::Boolean _is_a (const char *);
    virtual CORBA::InterfaceDef_ptr _get_interface ();
    virtual CORBA::RepositoryId _primary_interface (const PortableServer::ObjectId &, PortableServer::POA_ptr);

    virtual void * _narrow_helper (const char *);
    static NamingContext * _narrow (PortableServer::Servant);
    virtual CORBA::Object_ptr _make_stub (PortableServer::POA_ptr, CORBA::Object_ptr);

    virtual void bind( const CosNaming::Name& n, CORBA::Object_ptr obj ) = 0;
    virtual void rebind( const CosNaming::Name& n, CORBA::Object_ptr obj ) = 0;
    virtual void bind_context( const CosNaming::Name& n, CosNaming::NamingContext_ptr nc ) = 0;
    virtual void rebind_context( const CosNaming::Name& n, CosNaming::NamingContext_ptr nc ) = 0;
    virtual CORBA::Object_ptr resolve( const CosNaming::Name& n ) = 0;
    virtual void unbind( const CosNaming::Name& n ) = 0;
    virtual CosNaming::NamingContext_ptr new_context() = 0;
    virtual CosNaming::NamingContext_ptr bind_new_context( const CosNaming::Name& n ) = 0;
    virtual void destroy() = 0;
    virtual void list( CORBA::ULong how_many, CosNaming::BindingList*& bl, CosNaming::BindingIterator_ptr& bi ) = 0;

  protected:
    NamingContext () {};

  private:
    NamingContext (const NamingContext &);
    void operator= (const NamingContext &);
};

#ifdef HAVE_NAMESPACE

template<class T>
class NamingContext_tie : 
  virtual public POA_Tie_Base<T>,
  virtual public NamingContext
{
  public:
    NamingContext_tie (T &t)
      : POA_Tie_Base<T> (&t, PortableServer::POA::_nil(), FALSE)
    {}
    NamingContext_tie (T &t, PortableServer::POA_ptr _poa)
      : POA_Tie_Base<T> (&t, _poa, FALSE)
    {}
    NamingContext_tie (T *t, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, PortableServer::POA::_nil(), _rel)
    {}
    NamingContext_tie (T *t, PortableServer::POA_ptr _poa, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, _poa, _rel)
    {}
    virtual ~NamingContext_tie ();

    PortableServer::POA_ptr _default_POA ();

    void bind( const CosNaming::Name& n, CORBA::Object_ptr obj );
    void rebind( const CosNaming::Name& n, CORBA::Object_ptr obj );
    void bind_context( const CosNaming::Name& n, CosNaming::NamingContext_ptr nc );
    void rebind_context( const CosNaming::Name& n, CosNaming::NamingContext_ptr nc );
    CORBA::Object_ptr resolve( const CosNaming::Name& n );
    void unbind( const CosNaming::Name& n );
    CosNaming::NamingContext_ptr new_context();
    CosNaming::NamingContext_ptr bind_new_context( const CosNaming::Name& n );
    void destroy();
    void list( CORBA::ULong how_many, CosNaming::BindingList*& bl, CosNaming::BindingIterator_ptr& bi );

  protected:
    NamingContext_tie () {};

  private:
    NamingContext_tie (const NamingContext_tie<T> &);
    void operator= (const NamingContext_tie<T> &);
};

template<class T>
NamingContext_tie<T>::~NamingContext_tie ()
{
}

template<class T>
PortableServer::POA_ptr
NamingContext_tie<T>::_default_POA ()
{
  if (!CORBA::is_nil (POA_Tie_Base<T>::poa)) {
    return PortableServer::POA::_duplicate (POA_Tie_Base<T>::poa);
  }
  return PortableServer::ServantBase::_default_POA ();
}

template<class T>
void
NamingContext_tie<T>::bind (const CosNaming::Name& n, CORBA::Object_ptr obj)
{
  POA_Tie_Base<T>::ptr->bind (n, obj);
}

template<class T>
void
NamingContext_tie<T>::rebind (const CosNaming::Name& n, CORBA::Object_ptr obj)
{
  POA_Tie_Base<T>::ptr->rebind (n, obj);
}

template<class T>
void
NamingContext_tie<T>::bind_context (const CosNaming::Name& n, CosNaming::NamingContext_ptr nc)
{
  POA_Tie_Base<T>::ptr->bind_context (n, nc);
}

template<class T>
void
NamingContext_tie<T>::rebind_context (const CosNaming::Name& n, CosNaming::NamingContext_ptr nc)
{
  POA_Tie_Base<T>::ptr->rebind_context (n, nc);
}

template<class T>
CORBA::Object_ptr
NamingContext_tie<T>::resolve (const CosNaming::Name& n)
{
  return POA_Tie_Base<T>::ptr->resolve (n);
}

template<class T>
void
NamingContext_tie<T>::unbind (const CosNaming::Name& n)
{
  POA_Tie_Base<T>::ptr->unbind (n);
}

template<class T>
CosNaming::NamingContext_ptr
NamingContext_tie<T>::new_context ()
{
  return POA_Tie_Base<T>::ptr->new_context ();
}

template<class T>
CosNaming::NamingContext_ptr
NamingContext_tie<T>::bind_new_context (const CosNaming::Name& n)
{
  return POA_Tie_Base<T>::ptr->bind_new_context (n);
}

template<class T>
void
NamingContext_tie<T>::destroy ()
{
  POA_Tie_Base<T>::ptr->destroy ();
}

template<class T>
void
NamingContext_tie<T>::list (CORBA::ULong how_many, CosNaming::BindingList*& bl, CosNaming::BindingIterator_ptr& bi)
{
  POA_Tie_Base<T>::ptr->list (how_many, bl, bi);
}

#endif

class BindingIterator : virtual public PortableServer::StaticImplementation
{
  public:
    virtual ~BindingIterator ();
    CosNaming::BindingIterator_ptr _this ();
    bool dispatch (CORBA::StaticServerRequest_ptr);
    virtual void invoke (CORBA::StaticServerRequest_ptr);
    virtual CORBA::Boolean _is_a (const char *);
    virtual CORBA::InterfaceDef_ptr _get_interface ();
    virtual CORBA::RepositoryId _primary_interface (const PortableServer::ObjectId &, PortableServer::POA_ptr);

    virtual void * _narrow_helper (const char *);
    static BindingIterator * _narrow (PortableServer::Servant);
    virtual CORBA::Object_ptr _make_stub (PortableServer::POA_ptr, CORBA::Object_ptr);

    virtual CORBA::Boolean next_one( CosNaming::Binding*& b ) = 0;
    virtual CORBA::Boolean next_n( CORBA::ULong how_many, CosNaming::BindingList*& bl ) = 0;
    virtual void destroy() = 0;

  protected:
    BindingIterator () {};

  private:
    BindingIterator (const BindingIterator &);
    void operator= (const BindingIterator &);
};

#ifdef HAVE_NAMESPACE

template<class T>
class BindingIterator_tie : 
  virtual public POA_Tie_Base<T>,
  virtual public BindingIterator
{
  public:
    BindingIterator_tie (T &t)
      : POA_Tie_Base<T> (&t, PortableServer::POA::_nil(), FALSE)
    {}
    BindingIterator_tie (T &t, PortableServer::POA_ptr _poa)
      : POA_Tie_Base<T> (&t, _poa, FALSE)
    {}
    BindingIterator_tie (T *t, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, PortableServer::POA::_nil(), _rel)
    {}
    BindingIterator_tie (T *t, PortableServer::POA_ptr _poa, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, _poa, _rel)
    {}
    virtual ~BindingIterator_tie ();

    PortableServer::POA_ptr _default_POA ();

    CORBA::Boolean next_one( CosNaming::Binding*& b );
    CORBA::Boolean next_n( CORBA::ULong how_many, CosNaming::BindingList*& bl );
    void destroy();

  protected:
    BindingIterator_tie () {};

  private:
    BindingIterator_tie (const BindingIterator_tie<T> &);
    void operator= (const BindingIterator_tie<T> &);
};

template<class T>
BindingIterator_tie<T>::~BindingIterator_tie ()
{
}

template<class T>
PortableServer::POA_ptr
BindingIterator_tie<T>::_default_POA ()
{
  if (!CORBA::is_nil (POA_Tie_Base<T>::poa)) {
    return PortableServer::POA::_duplicate (POA_Tie_Base<T>::poa);
  }
  return PortableServer::ServantBase::_default_POA ();
}

template<class T>
CORBA::Boolean
BindingIterator_tie<T>::next_one (CosNaming::Binding*& b)
{
  return POA_Tie_Base<T>::ptr->next_one (b);
}

template<class T>
CORBA::Boolean
BindingIterator_tie<T>::next_n (CORBA::ULong how_many, CosNaming::BindingList*& bl)
{
  return POA_Tie_Base<T>::ptr->next_n (how_many, bl);
}

template<class T>
void
BindingIterator_tie<T>::destroy ()
{
  POA_Tie_Base<T>::ptr->destroy ();
}

#endif

class NamingContextExt : 
  virtual public POA_CosNaming::NamingContext
{
  public:
    virtual ~NamingContextExt ();
    CosNaming::NamingContextExt_ptr _this ();
    bool dispatch (CORBA::StaticServerRequest_ptr);
    virtual void invoke (CORBA::StaticServerRequest_ptr);
    virtual CORBA::Boolean _is_a (const char *);
    virtual CORBA::InterfaceDef_ptr _get_interface ();
    virtual CORBA::RepositoryId _primary_interface (const PortableServer::ObjectId &, PortableServer::POA_ptr);

    virtual void * _narrow_helper (const char *);
    static NamingContextExt * _narrow (PortableServer::Servant);
    virtual CORBA::Object_ptr _make_stub (PortableServer::POA_ptr, CORBA::Object_ptr);

    virtual char* to_string( const CosNaming::Name& n ) = 0;
    virtual CosNaming::Name* to_name( const char* sn ) = 0;
    virtual char* to_url( const char* addr, const char* sn ) = 0;
    virtual CORBA::Object_ptr resolve_str( const char* n ) = 0;

  protected:
    NamingContextExt () {};

  private:
    NamingContextExt (const NamingContextExt &);
    void operator= (const NamingContextExt &);
};

#ifdef HAVE_NAMESPACE

template<class T>
class NamingContextExt_tie : 
  virtual public POA_CosNaming::NamingContext_tie<T>,
  virtual public NamingContextExt
{
  public:
    NamingContextExt_tie (T &t)
      : POA_Tie_Base<T> (&t, PortableServer::POA::_nil(), FALSE)
    {}
    NamingContextExt_tie (T &t, PortableServer::POA_ptr _poa)
      : POA_Tie_Base<T> (&t, _poa, FALSE)
    {}
    NamingContextExt_tie (T *t, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, PortableServer::POA::_nil(), _rel)
    {}
    NamingContextExt_tie (T *t, PortableServer::POA_ptr _poa, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, _poa, _rel)
    {}
    virtual ~NamingContextExt_tie ();

    PortableServer::POA_ptr _default_POA ();

    char* to_string( const CosNaming::Name& n );
    CosNaming::Name* to_name( const char* sn );
    char* to_url( const char* addr, const char* sn );
    CORBA::Object_ptr resolve_str( const char* n );

  protected:
    NamingContextExt_tie () {};

  private:
    NamingContextExt_tie (const NamingContextExt_tie<T> &);
    void operator= (const NamingContextExt_tie<T> &);
};

template<class T>
NamingContextExt_tie<T>::~NamingContextExt_tie ()
{
}

template<class T>
PortableServer::POA_ptr
NamingContextExt_tie<T>::_default_POA ()
{
  if (!CORBA::is_nil (POA_Tie_Base<T>::poa)) {
    return PortableServer::POA::_duplicate (POA_Tie_Base<T>::poa);
  }
  return PortableServer::ServantBase::_default_POA ();
}

template<class T>
char*
NamingContextExt_tie<T>::to_string (const CosNaming::Name& n)
{
  return POA_Tie_Base<T>::ptr->to_string (n);
}

template<class T>
CosNaming::Name*
NamingContextExt_tie<T>::to_name (const char* sn)
{
  return POA_Tie_Base<T>::ptr->to_name (sn);
}

template<class T>
char*
NamingContextExt_tie<T>::to_url (const char* addr, const char* sn)
{
  return POA_Tie_Base<T>::ptr->to_url (addr, sn);
}

template<class T>
CORBA::Object_ptr
NamingContextExt_tie<T>::resolve_str (const char* n)
{
  return POA_Tie_Base<T>::ptr->resolve_str (n);
}

#endif

#endif // !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE_POA_CosNaming)

#ifndef MICO_NO_TOPLEVEL_MODULES

};
#endif



#ifndef HAVE_NAMESPACE

template<class T>
class POA_CosNaming_NamingContext_tie : 
  virtual public POA_Tie_Base<T>,
  virtual public POA_CosNaming::NamingContext
{
  public:
    POA_CosNaming_NamingContext_tie (T &t)
      : POA_Tie_Base<T> (&t, PortableServer::POA::_nil(), FALSE)
    {}
    POA_CosNaming_NamingContext_tie (T &t, PortableServer::POA_ptr _poa)
      : POA_Tie_Base<T> (&t, _poa, FALSE)
    {}
    POA_CosNaming_NamingContext_tie (T *t, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, PortableServer::POA::_nil(), _rel)
    {}
    POA_CosNaming_NamingContext_tie (T *t, PortableServer::POA_ptr _poa, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, _poa, _rel)
    {}
    virtual ~POA_CosNaming_NamingContext_tie ();

    PortableServer::POA_ptr _default_POA ();

    void bind( const CosNaming::Name& n, CORBA::Object_ptr obj );
    void rebind( const CosNaming::Name& n, CORBA::Object_ptr obj );
    void bind_context( const CosNaming::Name& n, CosNaming::NamingContext_ptr nc );
    void rebind_context( const CosNaming::Name& n, CosNaming::NamingContext_ptr nc );
    CORBA::Object_ptr resolve( const CosNaming::Name& n );
    void unbind( const CosNaming::Name& n );
    CosNaming::NamingContext_ptr new_context();
    CosNaming::NamingContext_ptr bind_new_context( const CosNaming::Name& n );
    void destroy();
    void list( CORBA::ULong how_many, CosNaming::BindingList*& bl, CosNaming::BindingIterator_ptr& bi );

  protected:
    POA_CosNaming_NamingContext_tie () {};

  private:
    POA_CosNaming_NamingContext_tie (const POA_CosNaming_NamingContext_tie<T> &);
    void operator= (const POA_CosNaming_NamingContext_tie<T> &);
};

template<class T>
POA_CosNaming_NamingContext_tie<T>::~POA_CosNaming_NamingContext_tie ()
{
}

template<class T>
PortableServer::POA_ptr
POA_CosNaming_NamingContext_tie<T>::_default_POA ()
{
  if (!CORBA::is_nil (POA_Tie_Base<T>::poa)) {
    return PortableServer::POA::_duplicate (POA_Tie_Base<T>::poa);
  }
  return PortableServer::ServantBase::_default_POA ();
}

template<class T>
void
POA_CosNaming_NamingContext_tie<T>::bind (const CosNaming::Name& n, CORBA::Object_ptr obj)
{
  POA_Tie_Base<T>::ptr->bind (n, obj);
}

template<class T>
void
POA_CosNaming_NamingContext_tie<T>::rebind (const CosNaming::Name& n, CORBA::Object_ptr obj)
{
  POA_Tie_Base<T>::ptr->rebind (n, obj);
}

template<class T>
void
POA_CosNaming_NamingContext_tie<T>::bind_context (const CosNaming::Name& n, CosNaming::NamingContext_ptr nc)
{
  POA_Tie_Base<T>::ptr->bind_context (n, nc);
}

template<class T>
void
POA_CosNaming_NamingContext_tie<T>::rebind_context (const CosNaming::Name& n, CosNaming::NamingContext_ptr nc)
{
  POA_Tie_Base<T>::ptr->rebind_context (n, nc);
}

template<class T>
CORBA::Object_ptr
POA_CosNaming_NamingContext_tie<T>::resolve (const CosNaming::Name& n)
{
  return POA_Tie_Base<T>::ptr->resolve (n);
}

template<class T>
void
POA_CosNaming_NamingContext_tie<T>::unbind (const CosNaming::Name& n)
{
  POA_Tie_Base<T>::ptr->unbind (n);
}

template<class T>
CosNaming::NamingContext_ptr
POA_CosNaming_NamingContext_tie<T>::new_context ()
{
  return POA_Tie_Base<T>::ptr->new_context ();
}

template<class T>
CosNaming::NamingContext_ptr
POA_CosNaming_NamingContext_tie<T>::bind_new_context (const CosNaming::Name& n)
{
  return POA_Tie_Base<T>::ptr->bind_new_context (n);
}

template<class T>
void
POA_CosNaming_NamingContext_tie<T>::destroy ()
{
  POA_Tie_Base<T>::ptr->destroy ();
}

template<class T>
void
POA_CosNaming_NamingContext_tie<T>::list (CORBA::ULong how_many, CosNaming::BindingList*& bl, CosNaming::BindingIterator_ptr& bi)
{
  POA_Tie_Base<T>::ptr->list (how_many, bl, bi);
}

#endif

#ifndef HAVE_NAMESPACE

template<class T>
class POA_CosNaming_BindingIterator_tie : 
  virtual public POA_Tie_Base<T>,
  virtual public POA_CosNaming::BindingIterator
{
  public:
    POA_CosNaming_BindingIterator_tie (T &t)
      : POA_Tie_Base<T> (&t, PortableServer::POA::_nil(), FALSE)
    {}
    POA_CosNaming_BindingIterator_tie (T &t, PortableServer::POA_ptr _poa)
      : POA_Tie_Base<T> (&t, _poa, FALSE)
    {}
    POA_CosNaming_BindingIterator_tie (T *t, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, PortableServer::POA::_nil(), _rel)
    {}
    POA_CosNaming_BindingIterator_tie (T *t, PortableServer::POA_ptr _poa, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, _poa, _rel)
    {}
    virtual ~POA_CosNaming_BindingIterator_tie ();

    PortableServer::POA_ptr _default_POA ();

    CORBA::Boolean next_one( CosNaming::Binding*& b );
    CORBA::Boolean next_n( CORBA::ULong how_many, CosNaming::BindingList*& bl );
    void destroy();

  protected:
    POA_CosNaming_BindingIterator_tie () {};

  private:
    POA_CosNaming_BindingIterator_tie (const POA_CosNaming_BindingIterator_tie<T> &);
    void operator= (const POA_CosNaming_BindingIterator_tie<T> &);
};

template<class T>
POA_CosNaming_BindingIterator_tie<T>::~POA_CosNaming_BindingIterator_tie ()
{
}

template<class T>
PortableServer::POA_ptr
POA_CosNaming_BindingIterator_tie<T>::_default_POA ()
{
  if (!CORBA::is_nil (POA_Tie_Base<T>::poa)) {
    return PortableServer::POA::_duplicate (POA_Tie_Base<T>::poa);
  }
  return PortableServer::ServantBase::_default_POA ();
}

template<class T>
CORBA::Boolean
POA_CosNaming_BindingIterator_tie<T>::next_one (CosNaming::Binding*& b)
{
  return POA_Tie_Base<T>::ptr->next_one (b);
}

template<class T>
CORBA::Boolean
POA_CosNaming_BindingIterator_tie<T>::next_n (CORBA::ULong how_many, CosNaming::BindingList*& bl)
{
  return POA_Tie_Base<T>::ptr->next_n (how_many, bl);
}

template<class T>
void
POA_CosNaming_BindingIterator_tie<T>::destroy ()
{
  POA_Tie_Base<T>::ptr->destroy ();
}

#endif

#ifndef HAVE_NAMESPACE

template<class T>
class POA_CosNaming_NamingContextExt_tie : 
  virtual public POA_CosNaming_NamingContext_tie<T>,
  virtual public POA_CosNaming::NamingContextExt
{
  public:
    POA_CosNaming_NamingContextExt_tie (T &t)
      : POA_Tie_Base<T> (&t, PortableServer::POA::_nil(), FALSE)
    {}
    POA_CosNaming_NamingContextExt_tie (T &t, PortableServer::POA_ptr _poa)
      : POA_Tie_Base<T> (&t, _poa, FALSE)
    {}
    POA_CosNaming_NamingContextExt_tie (T *t, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, PortableServer::POA::_nil(), _rel)
    {}
    POA_CosNaming_NamingContextExt_tie (T *t, PortableServer::POA_ptr _poa, CORBA::Boolean _rel = TRUE)
      : POA_Tie_Base<T> (t, _poa, _rel)
    {}
    virtual ~POA_CosNaming_NamingContextExt_tie ();

    PortableServer::POA_ptr _default_POA ();

    char* to_string( const CosNaming::Name& n );
    CosNaming::Name* to_name( const char* sn );
    char* to_url( const char* addr, const char* sn );
    CORBA::Object_ptr resolve_str( const char* n );

  protected:
    POA_CosNaming_NamingContextExt_tie () {};

  private:
    POA_CosNaming_NamingContextExt_tie (const POA_CosNaming_NamingContextExt_tie<T> &);
    void operator= (const POA_CosNaming_NamingContextExt_tie<T> &);
};

template<class T>
POA_CosNaming_NamingContextExt_tie<T>::~POA_CosNaming_NamingContextExt_tie ()
{
}

template<class T>
PortableServer::POA_ptr
POA_CosNaming_NamingContextExt_tie<T>::_default_POA ()
{
  if (!CORBA::is_nil (POA_Tie_Base<T>::poa)) {
    return PortableServer::POA::_duplicate (POA_Tie_Base<T>::poa);
  }
  return PortableServer::ServantBase::_default_POA ();
}

template<class T>
char*
POA_CosNaming_NamingContextExt_tie<T>::to_string (const CosNaming::Name& n)
{
  return POA_Tie_Base<T>::ptr->to_string (n);
}

template<class T>
CosNaming::Name*
POA_CosNaming_NamingContextExt_tie<T>::to_name (const char* sn)
{
  return POA_Tie_Base<T>::ptr->to_name (sn);
}

template<class T>
char*
POA_CosNaming_NamingContextExt_tie<T>::to_url (const char* addr, const char* sn)
{
  return POA_Tie_Base<T>::ptr->to_url (addr, sn);
}

template<class T>
CORBA::Object_ptr
POA_CosNaming_NamingContextExt_tie<T>::resolve_str (const char* n)
{
  return POA_Tie_Base<T>::ptr->resolve_str (n);
}

#endif

#endif // MICO_CONF_NO_POA

#if !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE__GLOBAL)

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_NameComponent;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_BindingType;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_Binding;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_NamingContext_NotFoundReason;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_NamingContext_NotFound;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_NamingContext_CannotProceed;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_NamingContext_InvalidName;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_NamingContext_AlreadyBound;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_NamingContext_NotEmpty;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_NamingContext;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_BindingIterator;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_NamingContextExt_InvalidAddress;

extern CORBA::StaticTypeInfo *_marshaller_CosNaming_NamingContextExt;

extern CORBA::StaticTypeInfo *_marshaller__seq_CosNaming_NameComponent;

extern CORBA::StaticTypeInfo *_marshaller__seq_CosNaming_Binding;

#endif // !defined(MICO_NO_TOPLEVEL_MODULES) || defined(MICO_MODULE__GLOBAL)


#if !defined(MICO_NO_TOPLEVEL_MODULES) && !defined(MICO_IN_GENERATED_CODE)
#include <mico/template_impl.h>
#endif

#endif
