// **********************************************************************
//
// 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_Policy_h__
#define __OB_Policy_h__

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


#include <OB/PolicyTypes.h>
#include <OB/Policy_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_CORBA
{

} // End of namespace OBStubImpl_CORBA

namespace OBStubImpl_CORBA
{

} // End of namespace OBStubImpl_CORBA

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

//
// IDL:omg.org/CORBA/PolicyType:1.0
//
typedef ::CORBA::ULong PolicyType;
typedef ::CORBA::ULong_out PolicyType_out;
OB_IMPORT extern OB::TypeCodeConst _tc_PolicyType;

//
// IDL:omg.org/CORBA/PolicyTypeSeq:1.0
//
class OBUnique_PolicyTypeSeq { };

typedef OB::FixSeq< ::CORBA::ULong, OBUnique_PolicyTypeSeq > PolicyTypeSeq;
typedef OB::SeqVar< OB::FixSeq< ::CORBA::ULong, OBUnique_PolicyTypeSeq > > PolicyTypeSeq_var;
typedef OB::SeqOut< OB::FixSeq< ::CORBA::ULong, OBUnique_PolicyTypeSeq > > PolicyTypeSeq_out;
OB_IMPORT extern OB::TypeCodeConst _tc_PolicyTypeSeq;

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

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

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

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

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

protected:

    static OB_IMPORT const char* ids_[];

public:

    Policy() { }
    virtual ~Policy() { }

    typedef Policy_ptr _ptr_type;
    typedef Policy_var _var_type;

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

    static inline Policy_ptr
    _nil()
    {
        return 0;
    }

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

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


    //
    // IDL:omg.org/CORBA/Policy/policy_type:1.0
    //
    virtual PolicyType policy_type() = 0;

    //
    // IDL:omg.org/CORBA/Policy/copy:1.0
    //
    virtual Policy_ptr copy() = 0;

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

//
// IDL:omg.org/CORBA/PolicyList:1.0
//
class OBUnique_PolicyList { };

typedef OB::ObjSeq< Policy, OBUnique_PolicyList > PolicyList;
typedef OB::SeqVar< OB::ObjSeq< Policy, OBUnique_PolicyList > > PolicyList_var;
typedef OB::SeqOut< OB::ObjSeq< Policy, OBUnique_PolicyList > > PolicyList_out;
OB_IMPORT extern OB::TypeCodeConst _tc_PolicyList;

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

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

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

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

//
// IDL:omg.org/CORBA/PolicyErrorCode:1.0
//
typedef ::CORBA::Short PolicyErrorCode;
typedef ::CORBA::Short_out PolicyErrorCode_out;
OB_IMPORT extern OB::TypeCodeConst _tc_PolicyErrorCode;

//
// IDL:omg.org/CORBA/BAD_POLICY:1.0
//
const PolicyErrorCode BAD_POLICY = 0;

//
// IDL:omg.org/CORBA/UNSUPPORTED_POLICY:1.0
//
const PolicyErrorCode UNSUPPORTED_POLICY = 1;

//
// IDL:omg.org/CORBA/BAD_POLICY_TYPE:1.0
//
const PolicyErrorCode BAD_POLICY_TYPE = 2;

//
// IDL:omg.org/CORBA/BAD_POLICY_VALUE:1.0
//
const PolicyErrorCode BAD_POLICY_VALUE = 3;

//
// IDL:omg.org/CORBA/UNSUPPORTED_POLICY_VALUE:1.0
//
const PolicyErrorCode UNSUPPORTED_POLICY_VALUE = 4;

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

    static PolicyError* _downcast(::CORBA::Exception*);
    static const PolicyError* _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&);

    PolicyErrorCode reason;

    PolicyError(PolicyErrorCode);

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

OB_IMPORT extern OB::TypeCodeConst _tc_PolicyError;

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

    static InvalidPolicies* _downcast(::CORBA::Exception*);
    static const InvalidPolicies* _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&);

    class OBUnique_indices { };
    typedef OB::FixSeq< ::CORBA::UShort, OBUnique_indices > _indices_seq;
    _indices_seq indices;

    InvalidPolicies(const OB::FixSeq< ::CORBA::UShort, OBUnique_indices >&);

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

OB_IMPORT extern OB::TypeCodeConst _tc_InvalidPolicies;

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

protected:

    static OB_IMPORT const char* ids_[];

public:

    PolicyManager() { }
    virtual ~PolicyManager() { }

    typedef PolicyManager_ptr _ptr_type;
    typedef PolicyManager_var _var_type;

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

    static inline PolicyManager_ptr
    _nil()
    {
        return 0;
    }

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

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


    //
    // IDL:omg.org/CORBA/PolicyManager/get_policy_overrides:1.0
    //
    virtual PolicyList* get_policy_overrides(const PolicyTypeSeq& ts) = 0;

    //
    // IDL:omg.org/CORBA/PolicyManager/set_policy_overrides:1.0
    //
    virtual void set_policy_overrides(const PolicyList& policies,
                                      SetOverrideType set_add) = 0;
};

} // End of namespace CORBA

//
// IDL:omg.org/CORBA:1.0
//
namespace OBProxy_CORBA
{

} // End of namespace OBProxy_CORBA

//
// IDL:omg.org/CORBA:1.0
//
namespace OBStubImpl_CORBA
{

} // End of namespace OBStubImpl_CORBA

//
// IDL:omg.org/CORBA:1.0
//
namespace OBMarshalStubImpl_CORBA
{

} // End of namespace OBMarshalStubImpl_CORBA

//
// IDL:omg.org/CORBA:1.0
//
namespace OBV_CORBA
{

} // End of namespace OBV_CORBA

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

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

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

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

//
// IDL:omg.org/CORBA/Policy:1.0
//
namespace CORBA
{

inline void
release(::CORBA::Policy_ptr p)
{
    if(p)
        p -> _remove_ref();
}

inline Boolean
is_nil(::CORBA::Policy_ptr p)
{
    return p == 0;
}

} // End of namespace CORBA

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

//
// IDL:omg.org/CORBA/PolicyManager:1.0
//
namespace CORBA
{

inline void
release(::CORBA::PolicyManager_ptr p)
{
    if(p)
        p -> _remove_ref();
}

inline Boolean
is_nil(::CORBA::PolicyManager_ptr p)
{
    return p == 0;
}

} // End of namespace CORBA

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

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

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

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

#endif
