// **********************************************************************
//
// Generated by the ORBacus IDL-to-C++ Translator
//
// Copyright (c) 2003
// IONA Technologies, Inc.
// Waltham, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

// Version: 4.1.3

#ifndef __OB_OBNaming_h__
#define __OB_OBNaming_h__

#ifndef OB_NAMING_IMPORT
#   ifdef OB_DLL
#      define OB_NAMING_IMPORT __declspec(dllimport)
#   else
#      define OB_NAMING_IMPORT /**/
#   endif
#endif


#include <OB/CosNaming.h>
#include <OB/BindingListener.h>

#ifndef OB_INTEGER_VERSION
#   error No ORBacus version defined! Is <OB/CORBA.h> included?
#endif

#ifndef OB_NO_VERSION_CHECK
#   if (OB_INTEGER_VERSION != 4010300L)
#       error ORBacus version mismatch!
#   endif
#endif

namespace CosNaming
{

class OBNamingContext;
typedef OBNamingContext* OBNamingContext_ptr;
typedef OBNamingContext* OBNamingContextRef;

OB_NAMING_IMPORT extern OB::TypeCodeConst _tc_OBNamingContext;

} // End of namespace CosNaming

void OBDuplicate(CosNaming::OBNamingContext_ptr);
void OBRelease(CosNaming::OBNamingContext_ptr);

void OBMarshal(CosNaming::OBNamingContext_ptr, OB::OutputStreamImpl*);
void OBUnmarshal(CosNaming::OBNamingContext_ptr&, OB::InputStreamImpl*);

namespace CosNaming
{

typedef OB::ObjVar< OBNamingContext > OBNamingContext_var;
typedef OB::ObjOut< OBNamingContext > OBNamingContext_out;

} // End of namespace CosNaming

namespace OBStubImpl_CosNaming
{

class OBNamingContext;
typedef OBNamingContext* OBNamingContext_ptr;

} // End of namespace OBStubImpl_CosNaming

void OBDuplicate(OBStubImpl_CosNaming::OBNamingContext_ptr);
void OBRelease(OBStubImpl_CosNaming::OBNamingContext_ptr);

namespace OBStubImpl_CosNaming
{

typedef OB::ObjVar< OBNamingContext > OBNamingContext_var;

} // End of namespace OBStubImpl_CosNaming

//
// IDL:omg.org/CosNaming:1.0
//
namespace CosNaming
{

//
// IDL:ooc.com/CosNaming/OBNamingContext:1.0
//
class OBNamingContext : virtual public ::CosNaming::NamingContextExt
{
    OBNamingContext(const OBNamingContext&);
    void operator=(const OBNamingContext&);

protected:

    static OB_NAMING_IMPORT const char* ids_[];

public:

    OBNamingContext() { }
    virtual ~OBNamingContext() { }

    typedef OBNamingContext_ptr _ptr_type;
    typedef OBNamingContext_var _var_type;

    static inline OBNamingContext_ptr
    _duplicate(OBNamingContext_ptr p)
    {
        if(p)
            p -> _add_ref();
        return p;
    }

    static inline OBNamingContext_ptr
    _nil()
    {
        return 0;
    }

    static OBNamingContext_ptr _narrow(::CORBA::Object_ptr);
    static OBNamingContext_ptr _unchecked_narrow(::CORBA::Object_ptr);

    static OBNamingContext_ptr _narrow(::CORBA::AbstractBase_ptr);
    static OBNamingContext_ptr _unchecked_narrow(::CORBA::AbstractBase_ptr);

    static const char** _OB_staticIds();

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/BindingUnion:1.0
    //
    struct BindingUnion;
    typedef OB::VarVar< BindingUnion > BindingUnion_var;
    typedef OB::VarOut< BindingUnion > BindingUnion_out;

    struct BindingUnion
    {
    private:

        union
        {
            NamingContext_ptr nc;
            ::CORBA::Object_ptr obj;
        } _ob_v_;

        bool _ob_i_;
        BindingType _ob_d_;

        void _OB_remove();
        bool _OB_check(BindingType) const;

    public:

        typedef BindingUnion_var _var_type;

#ifdef OB_CLEAR_MEM
        BindingUnion();
#else
        BindingUnion() : _ob_i_(false) { }
#endif
        BindingUnion(const BindingUnion&);
        ~BindingUnion() { _OB_remove(); }

        BindingUnion& operator=(const BindingUnion&);

        void _d(BindingType);
        BindingType _d() const;

        void nc(NamingContext_ptr);
        NamingContext_ptr nc() const;

        void obj(::CORBA::Object_ptr);
        ::CORBA::Object_ptr obj() const;

        void _OB_marshal(OB::OutputStreamImpl*) const;
        static void _OB_unmarshal(BindingUnion&, OB::InputStreamImpl*);
    };

    OB_NAMING_IMPORT static OB::TypeCodeConst _tc_BindingUnion;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/ExtendedBinding:1.0
    //
    struct ExtendedBinding;
    typedef OB::VarVar< ExtendedBinding > ExtendedBinding_var;
    typedef OB::VarOut< ExtendedBinding > ExtendedBinding_out;

    struct ExtendedBinding
    {
#ifdef OB_CLEAR_MEM
        ExtendedBinding();
#else
        ExtendedBinding() { }
#endif
        ExtendedBinding(const ExtendedBinding&);
        ExtendedBinding& operator=(const ExtendedBinding&);

        typedef ExtendedBinding_var _var_type;

        Name binding_name;
        BindingUnion bound_obj;
        ::CORBA::Long timestamp;

        void _OB_marshal(OB::OutputStreamImpl*) const;
        static void _OB_unmarshal(ExtendedBinding&, OB::InputStreamImpl*);
    };

    OB_NAMING_IMPORT static OB::TypeCodeConst _tc_ExtendedBinding;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/ExtendedBindingList:1.0
    //
    class OBUnique_ExtendedBindingList { };

    typedef OB::VarSeq< ExtendedBinding, OBUnique_ExtendedBindingList > ExtendedBindingList;
    typedef OB::SeqVar< OB::VarSeq< ExtendedBinding, OBUnique_ExtendedBindingList > > ExtendedBindingList_var;
    typedef OB::SeqOut< OB::VarSeq< ExtendedBinding, OBUnique_ExtendedBindingList > > ExtendedBindingList_out;
    OB_NAMING_IMPORT static OB::TypeCodeConst _tc_ExtendedBindingList;

    struct OBInfo_ExtendedBindingList : public OB::ConstructedInfo
    {
        OBInfo_ExtendedBindingList() { }

        virtual void free(void* p) const
        {
            delete (ExtendedBindingList*)p;
        }

        virtual void* dup(const void* p) const
        {
            return new ExtendedBindingList(*(const ExtendedBindingList*)p);
        }

        virtual void marshal(const void*, OB::OutputStreamImpl*) const;
        virtual void unmarshal(void*, OB::InputStreamImpl*) const;
    };

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/list_extended:1.0
    //
    virtual ExtendedBindingList* list_extended() = 0;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/rename:1.0
    //
    virtual void rename(const Name& old_name,
                        const Name& new_name) = 0;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/add_listener:1.0
    //
    virtual ::CORBA::Boolean add_listener(BindingListener_ptr listener) = 0;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/remove_listener:1.0
    //
    virtual ::CORBA::Boolean remove_listener(BindingListener_ptr listener) = 0;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/callbacks_active:1.0
    //
    virtual ::CORBA::Boolean callbacks_active() = 0;
};

} // End of namespace CosNaming

//
// IDL:omg.org/CosNaming:1.0
//
namespace OBProxy_CosNaming
{

//
// IDL:ooc.com/CosNaming/OBNamingContext:1.0
//
class OBNamingContext : virtual public ::CosNaming::OBNamingContext,
                        virtual public OBProxy_CosNaming::NamingContextExt
{
    OBNamingContext(const OBNamingContext&);
    void operator=(const OBNamingContext&);

protected:

    virtual OB::MarshalStubImpl_ptr _OB_createMarshalStubImpl();

public:

    OBNamingContext() { }
    virtual ~OBNamingContext() { }

    virtual const char** _OB_ids() const;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/list_extended:1.0
    //
    ::CosNaming::OBNamingContext::ExtendedBindingList* list_extended();

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/rename:1.0
    //
    void rename(const ::CosNaming::Name& old_name,
                const ::CosNaming::Name& new_name);

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/add_listener:1.0
    //
    ::CORBA::Boolean add_listener(::CosNaming::BindingListener_ptr listener);

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/remove_listener:1.0
    //
    ::CORBA::Boolean remove_listener(::CosNaming::BindingListener_ptr listener);

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/callbacks_active:1.0
    //
    ::CORBA::Boolean callbacks_active();
};

} // End of namespace OBProxy_CosNaming

//
// IDL:omg.org/CosNaming:1.0
//
namespace OBStubImpl_CosNaming
{

//
// IDL:ooc.com/CosNaming/OBNamingContext:1.0
//
class OBNamingContext : virtual public OBStubImpl_CosNaming::NamingContextExt
{
    OBNamingContext(const OBNamingContext&);
    void operator=(const OBNamingContext&);

protected:

    OBNamingContext() { }

public:

    static inline OBNamingContext_ptr
    _duplicate(OBNamingContext_ptr p)
    {
        if(p)
            p -> _OB_incRef();
        return p;
    }

    static inline OBNamingContext_ptr
    _nil()
    {
        return 0;
    }

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/list_extended:1.0
    //
    virtual ::CosNaming::OBNamingContext::ExtendedBindingList* list_extended() = 0;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/rename:1.0
    //
    virtual void rename(const ::CosNaming::Name& old_name,
                        const ::CosNaming::Name& new_name) = 0;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/add_listener:1.0
    //
    virtual ::CORBA::Boolean add_listener(::CosNaming::BindingListener_ptr listener) = 0;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/remove_listener:1.0
    //
    virtual ::CORBA::Boolean remove_listener(::CosNaming::BindingListener_ptr listener) = 0;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/callbacks_active:1.0
    //
    virtual ::CORBA::Boolean callbacks_active() = 0;
};

} // End of namespace OBStubImpl_CosNaming

//
// IDL:omg.org/CosNaming:1.0
//
namespace OBMarshalStubImpl_CosNaming
{

//
// IDL:ooc.com/CosNaming/OBNamingContext:1.0
//
class OBNamingContext : virtual public OBStubImpl_CosNaming::OBNamingContext,
                        virtual public OBMarshalStubImpl_CosNaming::NamingContextExt
{
    OBNamingContext(const OBNamingContext&);
    void operator=(const OBNamingContext&);

protected:

    OBNamingContext() { }
    friend class OBProxy_CosNaming::OBNamingContext;

public:

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/list_extended:1.0
    //
    virtual ::CosNaming::OBNamingContext::ExtendedBindingList* list_extended();

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/rename:1.0
    //
    virtual void rename(const ::CosNaming::Name& old_name,
                        const ::CosNaming::Name& new_name);

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/add_listener:1.0
    //
    virtual ::CORBA::Boolean add_listener(::CosNaming::BindingListener_ptr listener);

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/remove_listener:1.0
    //
    virtual ::CORBA::Boolean remove_listener(::CosNaming::BindingListener_ptr listener);

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/callbacks_active:1.0
    //
    virtual ::CORBA::Boolean callbacks_active();
};

} // End of namespace OBMarshalStubImpl_CosNaming

//
// IDL:omg.org/CosNaming:1.0
//
namespace OBV_CosNaming
{

} // End of namespace OBV_CosNaming

//
// IDL:ooc.com/CosNaming/OBNamingContext:1.0
//
namespace CORBA
{

inline void
release(::CosNaming::OBNamingContext_ptr p)
{
    if(p)
        p -> _remove_ref();
}

inline Boolean
is_nil(::CosNaming::OBNamingContext_ptr p)
{
    return p == 0;
}

inline void
release(OBStubImpl_CosNaming::OBNamingContext_ptr p)
{
    if(p)
        p -> _OB_decRef();
}

inline Boolean
is_nil(OBStubImpl_CosNaming::OBNamingContext_ptr p)
{
    return p == 0;
}

} // End of namespace CORBA

void operator<<=(::CORBA::Any&, CosNaming::OBNamingContext_ptr*);
void operator<<=(::CORBA::Any&, CosNaming::OBNamingContext_ptr);
CORBA::Boolean operator>>=(const ::CORBA::Any&, CosNaming::OBNamingContext_ptr&);

inline void
operator<<=(::CORBA::Any_var& any, CosNaming::OBNamingContext_ptr* val)
{
    any.inout() <<= val;
}

inline void
operator<<=(::CORBA::Any_var& any, CosNaming::OBNamingContext_ptr val)
{
    any.inout() <<= val;
}

inline CORBA::Boolean
operator>>=(const ::CORBA::Any_var& any, CosNaming::OBNamingContext_ptr& val)
{
    return any.in() >>= val;
}

//
// IDL:ooc.com/CosNaming/OBNamingContext/BindingUnion:1.0
//
void operator<<=(::CORBA::Any&, CosNaming::OBNamingContext::BindingUnion*);
void operator<<=(::CORBA::Any&, const CosNaming::OBNamingContext::BindingUnion&);
CORBA::Boolean operator>>=(const ::CORBA::Any&, const CosNaming::OBNamingContext::BindingUnion*&);

inline void
operator<<=(::CORBA::Any_var& any, CosNaming::OBNamingContext::BindingUnion* val)
{
    any.inout() <<= val;
}

inline void
operator<<=(::CORBA::Any_var& any, const CosNaming::OBNamingContext::BindingUnion& val)
{
    any.inout() <<= val;
}

inline ::CORBA::Boolean
operator>>=(const ::CORBA::Any_var& any, const CosNaming::OBNamingContext::BindingUnion*& val)
{
    return any.in() >>= val;
}

//
// IDL:ooc.com/CosNaming/OBNamingContext/ExtendedBinding:1.0
//
void operator<<=(::CORBA::Any&, CosNaming::OBNamingContext::ExtendedBinding*);
void operator<<=(::CORBA::Any&, const CosNaming::OBNamingContext::ExtendedBinding&);
CORBA::Boolean operator>>=(const ::CORBA::Any&, const CosNaming::OBNamingContext::ExtendedBinding*&);

inline void
operator<<=(::CORBA::Any_var& any, CosNaming::OBNamingContext::ExtendedBinding* val)
{
    any.inout() <<= val;
}

inline void
operator<<=(::CORBA::Any_var& any, const CosNaming::OBNamingContext::ExtendedBinding& val)
{
    any.inout() <<= val;
}

inline ::CORBA::Boolean
operator>>=(const ::CORBA::Any_var& any, const CosNaming::OBNamingContext::ExtendedBinding*& val)
{
    return any.in() >>= val;
}

//
// IDL:ooc.com/CosNaming/OBNamingContext/ExtendedBindingList:1.0
//
void operator<<=(::CORBA::Any&, CosNaming::OBNamingContext::ExtendedBindingList*);
void operator<<=(::CORBA::Any&, const CosNaming::OBNamingContext::ExtendedBindingList&);
CORBA::Boolean operator>>=(const ::CORBA::Any&, const CosNaming::OBNamingContext::ExtendedBindingList*&);

inline void
operator<<=(::CORBA::Any_var& any, CosNaming::OBNamingContext::ExtendedBindingList* val)
{
    any.inout() <<= val;
}

inline void
operator<<=(::CORBA::Any_var& any, const CosNaming::OBNamingContext::ExtendedBindingList& val)
{
    any.inout() <<= val;
}

inline ::CORBA::Boolean
operator>>=(const ::CORBA::Any_var& any, const CosNaming::OBNamingContext::ExtendedBindingList*& val)
{
    return any.in() >>= val;
}

#endif
