// **********************************************************************
//
// 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_PICommon_h__
#define __OB_PICommon_h__

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


#include <OB/Types.h>
#include <OB/PICommon_fwd.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 OBStubImpl_PortableInterceptor
{

} // End of namespace OBStubImpl_PortableInterceptor

namespace OBStubImpl_PortableInterceptor
{

} // End of namespace OBStubImpl_PortableInterceptor

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

//
// IDL:omg.org/PortableInterceptor/Interceptor:1.0
//
class Interceptor : virtual public ::CORBA::Object
{
    Interceptor(const Interceptor&);
    void operator=(const Interceptor&);

protected:

    static OB_IMPORT const char* ids_[];

public:

    Interceptor() { }
    virtual ~Interceptor() { }

    typedef Interceptor_ptr _ptr_type;
    typedef Interceptor_var _var_type;

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

    static inline Interceptor_ptr
    _nil()
    {
        return 0;
    }

    static Interceptor_ptr _narrow(::CORBA::Object_ptr);

    static Interceptor_ptr _narrow(::CORBA::AbstractBase_ptr);


    //
    // IDL:omg.org/PortableInterceptor/Interceptor/name:1.0
    //
    virtual char* name() = 0;

    //
    // IDL:omg.org/PortableInterceptor/Interceptor/destroy:1.0
    //
    virtual void destroy() = 0;
};

//
// IDL:omg.org/PortableInterceptor/ForwardRequest:1.0
//
struct ForwardRequest : public ::CORBA::UserException
{
#ifdef OB_CLEAR_MEM
    ForwardRequest();
#else
    ForwardRequest() { }
#endif
    ForwardRequest(const ForwardRequest&);
    ForwardRequest& operator=(const ForwardRequest&);

    static ForwardRequest* _downcast(::CORBA::Exception*);
    static const ForwardRequest* _downcast(const ::CORBA::Exception*);
    virtual const char* _name() const;
    virtual void _raise() const { throw *this; }
    virtual const char* _rep_id() const;
    virtual char* _to_string() const;

    virtual ::CORBA::Exception* _OB_clone() const;
    virtual void _OB_insertInAny(::CORBA::Any&);

    ::CORBA::Object_var forward;
    ::CORBA::Boolean permanent;

    ForwardRequest(::CORBA::Object_ptr,
                   ::CORBA::Boolean);

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

OB_IMPORT extern OB::TypeCodeConst _tc_ForwardRequest;

//
// IDL:omg.org/PortableInterceptor/ReplyStatus:1.0
//
typedef ::CORBA::Short ReplyStatus;
typedef ::CORBA::Short_out ReplyStatus_out;
OB_IMPORT extern OB::TypeCodeConst _tc_ReplyStatus;

//
// IDL:omg.org/PortableInterceptor/SUCCESSFUL:1.0
//
const ReplyStatus SUCCESSFUL = 0;

//
// IDL:omg.org/PortableInterceptor/SYSTEM_EXCEPTION:1.0
//
const ReplyStatus SYSTEM_EXCEPTION = 1;

//
// IDL:omg.org/PortableInterceptor/USER_EXCEPTION:1.0
//
const ReplyStatus USER_EXCEPTION = 2;

//
// IDL:omg.org/PortableInterceptor/LOCATION_FORWARD:1.0
//
const ReplyStatus LOCATION_FORWARD = 3;

//
// IDL:omg.org/PortableInterceptor/TRANSPORT_RETRY:1.0
//
const ReplyStatus TRANSPORT_RETRY = 4;

//
// IDL:omg.org/PortableInterceptor/UNKNOWN:1.0
//
const ReplyStatus UNKNOWN = 5;

//
// IDL:omg.org/PortableInterceptor/SlotId:1.0
//
typedef ::CORBA::ULong SlotId;
typedef ::CORBA::ULong_out SlotId_out;
OB_IMPORT extern OB::TypeCodeConst _tc_SlotId;

//
// IDL:omg.org/PortableInterceptor/InvalidSlot:1.0
//
struct InvalidSlot : public ::CORBA::UserException
{
    InvalidSlot() { }
    InvalidSlot(const InvalidSlot&);
    InvalidSlot& operator=(const InvalidSlot&);

    static InvalidSlot* _downcast(::CORBA::Exception*);
    static const InvalidSlot* _downcast(const ::CORBA::Exception*);
    virtual const char* _name() const;
    virtual void _raise() const { throw *this; }
    virtual const char* _rep_id() const;
    virtual char* _to_string() const;

    virtual ::CORBA::Exception* _OB_clone() const;
    virtual void _OB_insertInAny(::CORBA::Any&);

    static void _OB_unmarshal(InvalidSlot&, OB::InputStreamImpl*);
};

OB_IMPORT extern OB::TypeCodeConst _tc_InvalidSlot;

//
// IDL:omg.org/PortableInterceptor/ServerId:1.0
//
typedef char* ServerId;
typedef ::CORBA::String_var ServerId_var;
typedef ::CORBA::String_out ServerId_out;
OB_IMPORT extern OB::TypeCodeConst _tc_ServerId;

//
// IDL:omg.org/PortableInterceptor/ORBId:1.0
//
typedef char* ORBId;
typedef ::CORBA::String_var ORBId_var;
typedef ::CORBA::String_out ORBId_out;
OB_IMPORT extern OB::TypeCodeConst _tc_ORBId;

//
// IDL:omg.org/PortableInterceptor/AdapterName:1.0
//
typedef OB::StrSeq< CORBA::OBUnique_StringSeq > AdapterName;
typedef OB::SeqVar< OB::StrSeq< CORBA::OBUnique_StringSeq > > AdapterName_var;
typedef OB::SeqOut< OB::StrSeq< CORBA::OBUnique_StringSeq > > AdapterName_out;
OB_IMPORT extern OB::TypeCodeConst _tc_AdapterName;

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

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

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

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

//
// IDL:omg.org/PortableInterceptor/ObjectId:1.0
//
typedef OB::FixSeq< ::CORBA::Octet, CORBA::OBUnique_OctetSeq > ObjectId;
typedef OB::SeqVar< OB::FixSeq< ::CORBA::Octet, CORBA::OBUnique_OctetSeq > > ObjectId_var;
typedef OB::SeqOut< OB::FixSeq< ::CORBA::Octet, CORBA::OBUnique_OctetSeq > > ObjectId_out;
OB_IMPORT extern OB::TypeCodeConst _tc_ObjectId;

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

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

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

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

//
// IDL:omg.org/PortableInterceptor/AdapterManagerId:1.0
//
typedef ::CORBA::Long AdapterManagerId;
typedef ::CORBA::Long_out AdapterManagerId_out;
OB_IMPORT extern OB::TypeCodeConst _tc_AdapterManagerId;

//
// IDL:omg.org/PortableInterceptor/HOLDING:1.0
//
const ::CORBA::Short HOLDING = 0;

//
// IDL:omg.org/PortableInterceptor/ACTIVE:1.0
//
const ::CORBA::Short ACTIVE = 1;

//
// IDL:omg.org/PortableInterceptor/DISCARDING:1.0
//
const ::CORBA::Short DISCARDING = 2;

//
// IDL:omg.org/PortableInterceptor/INACTIVE:1.0
//
const ::CORBA::Short INACTIVE = 3;

//
// IDL:omg.org/PortableInterceptor/NON_EXISTENT:1.0
//
const ::CORBA::Short NON_EXISTENT = 4;

//
// IDL:omg.org/PortableInterceptor/AdapterState:1.0
//
typedef ::CORBA::Short AdapterState;
typedef ::CORBA::Short_out AdapterState_out;
OB_IMPORT extern OB::TypeCodeConst _tc_AdapterState;

} // End of namespace PortableInterceptor

//
// IDL:omg.org/PortableInterceptor:1.0
//
namespace OBProxy_PortableInterceptor
{

} // End of namespace OBProxy_PortableInterceptor

//
// IDL:omg.org/PortableInterceptor:1.0
//
namespace OBStubImpl_PortableInterceptor
{

} // End of namespace OBStubImpl_PortableInterceptor

//
// IDL:omg.org/PortableInterceptor:1.0
//
namespace OBMarshalStubImpl_PortableInterceptor
{

} // End of namespace OBMarshalStubImpl_PortableInterceptor

//
// IDL:omg.org/PortableInterceptor:1.0
//
namespace OBV_PortableInterceptor
{

} // End of namespace OBV_PortableInterceptor

//
// IDL:omg.org/PortableInterceptor/Interceptor:1.0
//
namespace CORBA
{

inline void
release(::PortableInterceptor::Interceptor_ptr p)
{
    if(p)
        p -> _remove_ref();
}

inline Boolean
is_nil(::PortableInterceptor::Interceptor_ptr p)
{
    return p == 0;
}

} // End of namespace CORBA

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

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

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

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

//
// IDL:omg.org/PortableInterceptor/ForwardRequest:1.0
//
void operator<<=(::CORBA::Any&, PortableInterceptor::ForwardRequest*);
void operator<<=(::CORBA::Any&, const PortableInterceptor::ForwardRequest&);
CORBA::Boolean operator>>=(const ::CORBA::Any&, const PortableInterceptor::ForwardRequest*&);

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

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

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

//
// IDL:omg.org/PortableInterceptor/InvalidSlot:1.0
//
void operator<<=(::CORBA::Any&, PortableInterceptor::InvalidSlot*);
void operator<<=(::CORBA::Any&, const PortableInterceptor::InvalidSlot&);
CORBA::Boolean operator>>=(const ::CORBA::Any&, const PortableInterceptor::InvalidSlot*&);

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

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

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

#endif
