// **********************************************************************
//
// Generated by the ORBacus IDL-to-C++ Translator
//
// Copyright (c) 1999
// Object Oriented Concepts, Inc.
// Billerica, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

// Version: 3.2.1
// License: non-commercial

#ifndef __OBNaming_h__
#define __OBNaming_h__

#include <OB/CosNaming.h>

#ifndef OB_INTEGER_VERSION
#   error No ORBacus version defined!
#endif

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

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

//
// IDL:omg.org/CosNaming/NamingContext:1.0
//
class CosNaming_NamingContext;
typedef CosNaming_NamingContext* CosNaming_NamingContext_ptr;
typedef CosNaming_NamingContext* CosNaming_NamingContextRef;
void OBDuplicate(CosNaming_NamingContext_ptr);
void OBRelease(CosNaming_NamingContext_ptr);
typedef OBObjVar< CosNaming_NamingContext > CosNaming_NamingContext_var;

//
// IDL:omg.org/CosNaming/BindingIterator:1.0
//
class CosNaming_BindingIterator;
typedef CosNaming_BindingIterator* CosNaming_BindingIterator_ptr;
typedef CosNaming_BindingIterator* CosNaming_BindingIteratorRef;
void OBDuplicate(CosNaming_BindingIterator_ptr);
void OBRelease(CosNaming_BindingIterator_ptr);
typedef OBObjVar< CosNaming_BindingIterator > CosNaming_BindingIterator_var;

//
// IDL:omg.org/CosNaming/NamingContextExt:1.0
//
class CosNaming_NamingContextExt;
typedef CosNaming_NamingContextExt* CosNaming_NamingContextExt_ptr;
typedef CosNaming_NamingContextExt* CosNaming_NamingContextExtRef;
void OBDuplicate(CosNaming_NamingContextExt_ptr);
void OBRelease(CosNaming_NamingContextExt_ptr);
typedef OBObjVar< CosNaming_NamingContextExt > CosNaming_NamingContextExt_var;

//
// IDL:ooc.com/CosNaming/BindingListener:1.0
//
class CosNaming_BindingListener;
typedef CosNaming_BindingListener* CosNaming_BindingListener_ptr;
typedef CosNaming_BindingListener* CosNaming_BindingListenerRef;
void OBDuplicate(CosNaming_BindingListener_ptr);
void OBRelease(CosNaming_BindingListener_ptr);
typedef OBObjVar< CosNaming_BindingListener > CosNaming_BindingListener_var;

//
// IDL:ooc.com/CosNaming/OBNamingContext:1.0
//
class CosNaming_OBNamingContext;
typedef CosNaming_OBNamingContext* CosNaming_OBNamingContext_ptr;
typedef CosNaming_OBNamingContext* CosNaming_OBNamingContextRef;
void OBDuplicate(CosNaming_OBNamingContext_ptr);
void OBRelease(CosNaming_OBNamingContext_ptr);
typedef OBObjVar< CosNaming_OBNamingContext > CosNaming_OBNamingContext_var;

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

protected:

    CosNaming_BindingListener() { }

public:

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

    static inline CosNaming_BindingListener_ptr
    _nil()
    {
        return 0;
    }

    static CosNaming_BindingListener_ptr _narrow(CORBA_Object_ptr);
    virtual void* _OB_narrowHelp(const char*) const;
    virtual const char* _OB_typeId() const;

    friend void OBUnmarshal(CosNaming_BindingListener_ptr&, const CORBA_Octet*&, bool);

    friend CORBA_Boolean operator>>=(const CORBA_Any&, CosNaming_BindingListener_ptr&);

    //
    // IDL:ooc.com/CosNaming/BindingListener/context_added:1.0
    //
    virtual void context_added(CosNaming_NamingContext_ptr parent_ctx,
                               CosNaming_NamingContext_ptr child_ctx,
                               const CosNaming_NameComponent& name);

    //
    // IDL:ooc.com/CosNaming/BindingListener/context_removed:1.0
    //
    virtual void context_removed(CosNaming_NamingContext_ptr parent_ctx,
                                 const CosNaming_NameComponent& name);

    //
    // IDL:ooc.com/CosNaming/BindingListener/context_changed:1.0
    //
    virtual void context_changed(CosNaming_NamingContext_ptr parent_ctx,
                                 CosNaming_NamingContext_ptr child_ctx,
                                 const CosNaming_NameComponent& old_name,
                                 const CosNaming_NameComponent& new_name);

    //
    // IDL:ooc.com/CosNaming/BindingListener/object_added:1.0
    //
    virtual void object_added(CosNaming_NamingContext_ptr parent_ctx,
                              CORBA_Object_ptr child_obj,
                              const CosNaming_NameComponent& name);

    //
    // IDL:ooc.com/CosNaming/BindingListener/object_removed:1.0
    //
    virtual void object_removed(CosNaming_NamingContext_ptr parent_ctx,
                                const CosNaming_NameComponent& name);

    //
    // IDL:ooc.com/CosNaming/BindingListener/object_changed:1.0
    //
    virtual void object_changed(CosNaming_NamingContext_ptr parent_ctx,
                                CORBA_Object_ptr child,
                                const CosNaming_NameComponent& old_name,
                                const CosNaming_NameComponent& new_name);
};

extern OBTypeCodeConst CosNaming__tc_BindingListener;

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

protected:

    CosNaming_OBNamingContext() { }

public:

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

    static inline CosNaming_OBNamingContext_ptr
    _nil()
    {
        return 0;
    }

    static CosNaming_OBNamingContext_ptr _narrow(CORBA_Object_ptr);
    virtual void* _OB_narrowHelp(const char*) const;
    virtual const char* _OB_typeId() const;

    friend void OBUnmarshal(CosNaming_OBNamingContext_ptr&, const CORBA_Octet*&, bool);

    friend CORBA_Boolean operator>>=(const CORBA_Any&, CosNaming_OBNamingContext_ptr&);

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/NcOrObj:1.0
    //
    class NcOrObj
    {
        union
        {
            CosNaming_NamingContext_ptr nc;
            CORBA_Object_ptr obj;
        } _ob_v_;

        bool _ob_i_;
        CosNaming_BindingType _ob_d_;

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

    public:

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

        NcOrObj& operator=(const NcOrObj&);

        void _d(CosNaming_BindingType);
        CosNaming_BindingType _d() const;

        void nc(CosNaming_NamingContext_ptr);
        CosNaming_NamingContext_ptr nc() const;

        void obj(CORBA_Object_ptr);
        CORBA_Object_ptr obj() const;

        friend void OBMarshal(const NcOrObj&, CORBA_Octet*&);
        friend void OBMarshalCount(const NcOrObj&, CORBA_ULong&);
        friend void OBUnmarshal(NcOrObj&, const CORBA_Octet*&, bool);
    };

    typedef OBVarVar< NcOrObj > NcOrObj_var;

    static OBTypeCodeConst _tc_NcOrObj;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/ExtendedBinding:1.0
    //
    struct ExtendedBinding
    {
#ifdef OB_CLEAR_MEM
        ExtendedBinding();
#else
        ExtendedBinding() { }
#endif
        ExtendedBinding(const ExtendedBinding&);
        ~ExtendedBinding() { }
        ExtendedBinding& operator=(const ExtendedBinding&);

        CosNaming_Name binding_name;
        NcOrObj ncOrObj;
        CORBA_Long timestamp;
    };

    typedef OBVarVar< ExtendedBinding > ExtendedBinding_var;

    static OBTypeCodeConst _tc_ExtendedBinding;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/ExtendedBindingList:1.0
    //
    typedef OBVarSeq< ExtendedBinding > ExtendedBindingList;
    typedef OBSeqVar< OBVarSeq< ExtendedBinding > > ExtendedBindingList_var;
    static OBTypeCodeConst _tc_ExtendedBindingList;

    //
    // IDL:ooc.com/CosNaming/OBNamingContext/list_extended:1.0
    //
    virtual 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();
};

extern OBTypeCodeConst CosNaming__tc_OBNamingContext;

//
// IDL:ooc.com/CosNaming/BindingListener:1.0
//
inline void
CORBA_release(CosNaming_BindingListener_ptr p)
{
    if(p)
        p -> _OB_decRef();
}

inline CORBA_Boolean
CORBA_is_nil(CosNaming_BindingListener_ptr p)
{
    return p == 0;
}

inline void
OBMarshal(CosNaming_BindingListener_ptr p, CORBA_Octet*& oct)
{
    OBMarshal((CORBA_Object_ptr)p, oct);
}

inline void
OBMarshalCount(CosNaming_BindingListener_ptr p, CORBA_ULong& count)
{
    OBMarshalCount((CORBA_Object_ptr)p, count);
}

void OBUnmarshal(CosNaming_BindingListener_ptr&, const CORBA_Octet*&, bool);

void operator<<=(CORBA_Any&, CosNaming_BindingListener_ptr);
void operator<<=(CORBA_Any&, CosNaming_BindingListener_ptr*);
CORBA_Boolean operator>>=(const CORBA_Any&, CosNaming_BindingListener_ptr&);

inline void
operator<<=(CORBA_Any_var& any, CosNaming_BindingListener_ptr val)
{
    any.inout() <<= val;
}

inline void
operator<<=(CORBA_Any_var& any, CosNaming_BindingListener_ptr* val)
{
    any.inout() <<= val;
}

inline CORBA_Boolean
operator>>=(const CORBA_Any_var& any, CosNaming_BindingListener_ptr& val)
{
    return any.in() >>= val;
}

//
// IDL:ooc.com/CosNaming/OBNamingContext:1.0
//
inline void
CORBA_release(CosNaming_OBNamingContext_ptr p)
{
    if(p)
        p -> _OB_decRef();
}

inline CORBA_Boolean
CORBA_is_nil(CosNaming_OBNamingContext_ptr p)
{
    return p == 0;
}

inline void
OBMarshal(CosNaming_OBNamingContext_ptr p, CORBA_Octet*& oct)
{
    OBMarshal((CORBA_Object_ptr)p, oct);
}

inline void
OBMarshalCount(CosNaming_OBNamingContext_ptr p, CORBA_ULong& count)
{
    OBMarshalCount((CORBA_Object_ptr)p, count);
}

void OBUnmarshal(CosNaming_OBNamingContext_ptr&, const CORBA_Octet*&, bool);

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/NcOrObj:1.0
//
void OBMarshal(const CosNaming_OBNamingContext::NcOrObj&, CORBA_Octet*&);
void OBMarshalCount(const CosNaming_OBNamingContext::NcOrObj&, CORBA_ULong&);
void OBUnmarshal(CosNaming_OBNamingContext::NcOrObj&, const CORBA_Octet*&, bool);

void operator<<=(CORBA_Any&, CosNaming_OBNamingContext::NcOrObj*);
void operator<<=(CORBA_Any&, const CosNaming_OBNamingContext::NcOrObj&);
CORBA_Boolean operator>>=(const CORBA_Any&, CosNaming_OBNamingContext::NcOrObj*&);

inline void
operator<<=(CORBA_Any_var& any, CosNaming_OBNamingContext::NcOrObj* val)
{
    any.inout() <<= val;
}

inline void
operator<<=(CORBA_Any_var& any, const CosNaming_OBNamingContext::NcOrObj& val)
{
    any.inout() <<= val;
}

inline CORBA_Boolean
operator>>=(const CORBA_Any_var& any, CosNaming_OBNamingContext::NcOrObj*& val)
{
    return any.in() >>= val;
}

//
// IDL:ooc.com/CosNaming/OBNamingContext/ExtendedBinding:1.0
//
void OBMarshal(const CosNaming_OBNamingContext::ExtendedBinding&, CORBA_Octet*&);
void OBMarshalCount(const CosNaming_OBNamingContext::ExtendedBinding&, CORBA_ULong&);
void OBUnmarshal(CosNaming_OBNamingContext::ExtendedBinding&, const CORBA_Octet*&, bool);

void operator<<=(CORBA_Any&, CosNaming_OBNamingContext::ExtendedBinding*);
void operator<<=(CORBA_Any&, const CosNaming_OBNamingContext::ExtendedBinding&);
CORBA_Boolean operator>>=(const CORBA_Any&, 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, CosNaming_OBNamingContext::ExtendedBinding*& val)
{
    return any.in() >>= val;
}

//
// OBVarSeq< CosNaming_NameComponent >
//
#ifndef OB_use_OBVarSeq_CosNaming__NameComponent
#define OB_use_OBVarSeq_CosNaming__NameComponent
#define OB_use_OBVarSeq_CosNaming__NameComponent_from_OBNaming_h

void OBMarshal(const OBVarSeq< CosNaming_NameComponent >&, CORBA_Octet*&);
void OBMarshalCount(const OBVarSeq< CosNaming_NameComponent >&, CORBA_ULong&);
void OBUnmarshal(OBVarSeq< CosNaming_NameComponent >&, const CORBA_Octet*&, bool);

void operator<<=(CORBA_Any&, OBVarSeq< CosNaming_NameComponent >*);
void operator<<=(CORBA_Any&, const OBVarSeq< CosNaming_NameComponent >&);
CORBA_Boolean operator>>=(const CORBA_Any&, OBVarSeq< CosNaming_NameComponent >*&);

inline void
operator<<=(CORBA_Any_var& any, OBVarSeq< CosNaming_NameComponent >* val)
{
    any.inout() <<= val;
}

inline void
operator<<=(CORBA_Any_var& any, const OBVarSeq< CosNaming_NameComponent >& val)
{
    any.inout() <<= val;
}

inline CORBA_Boolean
operator>>=(const CORBA_Any_var& any, OBVarSeq< CosNaming_NameComponent >*& val)
{
    return any.in() >>= val;
}

#endif

//
// OBVarSeq< CosNaming_OBNamingContext::ExtendedBinding >
//
#ifndef OB_use_OBVarSeq_CosNaming__OBNamingContext_ExtendedBinding
#define OB_use_OBVarSeq_CosNaming__OBNamingContext_ExtendedBinding
#define OB_use_OBVarSeq_CosNaming__OBNamingContext_ExtendedBinding_from_OBNaming_h

void OBMarshal(const OBVarSeq< CosNaming_OBNamingContext::ExtendedBinding >&, CORBA_Octet*&);
void OBMarshalCount(const OBVarSeq< CosNaming_OBNamingContext::ExtendedBinding >&, CORBA_ULong&);
void OBUnmarshal(OBVarSeq< CosNaming_OBNamingContext::ExtendedBinding >&, const CORBA_Octet*&, bool);

void operator<<=(CORBA_Any&, OBVarSeq< CosNaming_OBNamingContext::ExtendedBinding >*);
void operator<<=(CORBA_Any&, const OBVarSeq< CosNaming_OBNamingContext::ExtendedBinding >&);
CORBA_Boolean operator>>=(const CORBA_Any&, OBVarSeq< CosNaming_OBNamingContext::ExtendedBinding >*&);

inline void
operator<<=(CORBA_Any_var& any, OBVarSeq< CosNaming_OBNamingContext::ExtendedBinding >* val)
{
    any.inout() <<= val;
}

inline void
operator<<=(CORBA_Any_var& any, const OBVarSeq< CosNaming_OBNamingContext::ExtendedBinding >& val)
{
    any.inout() <<= val;
}

inline CORBA_Boolean
operator>>=(const CORBA_Any_var& any, OBVarSeq< CosNaming_OBNamingContext::ExtendedBinding >*& val)
{
    return any.in() >>= val;
}

#endif

#endif
