// **********************************************************************
//
// 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_Dispatch_h__
#define __OB_Dispatch_h__

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


#include <OB/Dispatch_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_OB
{

} // End of namespace OBStubImpl_OB

namespace OBStubImpl_OB
{

} // End of namespace OBStubImpl_OB

//
// IDL:ooc.com/OB:1.0
//
namespace OB
{

//
// IDL:ooc.com/OB/DispatchRequest:1.0
//
class DispatchRequest : virtual public ::CORBA::Object
{
    DispatchRequest(const DispatchRequest&);
    void operator=(const DispatchRequest&);

protected:

    static OB_IMPORT const char* ids_[];

public:

    DispatchRequest() { }
    virtual ~DispatchRequest() { }

    typedef DispatchRequest_ptr _ptr_type;
    typedef DispatchRequest_var _var_type;

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

    static inline DispatchRequest_ptr
    _nil()
    {
        return 0;
    }

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

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


    //
    // IDL:ooc.com/OB/DispatchRequest/invoke:1.0
    //
    virtual void invoke() = 0;
};

//
// IDL:ooc.com/OB/DispatchStrategyId:1.0
//
typedef ::CORBA::ULong DispatchStrategyId;
typedef ::CORBA::ULong_out DispatchStrategyId_out;

//
// IDL:ooc.com/OB/SAME_THREAD:1.0
//
const DispatchStrategyId SAME_THREAD = 0U;

//
// IDL:ooc.com/OB/THREAD_PER_REQUEST:1.0
//
const DispatchStrategyId THREAD_PER_REQUEST = 1U;

//
// IDL:ooc.com/OB/THREAD_POOL:1.0
//
const DispatchStrategyId THREAD_POOL = 2U;

//
// IDL:ooc.com/OB/DispatchStrategy:1.0
//
class DispatchStrategy : virtual public ::CORBA::Object
{
    DispatchStrategy(const DispatchStrategy&);
    void operator=(const DispatchStrategy&);

protected:

    static OB_IMPORT const char* ids_[];

public:

    DispatchStrategy() { }
    virtual ~DispatchStrategy() { }

    typedef DispatchStrategy_ptr _ptr_type;
    typedef DispatchStrategy_var _var_type;

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

    static inline DispatchStrategy_ptr
    _nil()
    {
        return 0;
    }

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

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


    //
    // IDL:ooc.com/OB/DispatchStrategy/id:1.0
    //
    virtual DispatchStrategyId id() = 0;

    //
    // IDL:ooc.com/OB/DispatchStrategy/info:1.0
    //
    virtual ::CORBA::Any* info() = 0;

    //
    // IDL:ooc.com/OB/DispatchStrategy/dispatch:1.0
    //
    virtual void dispatch(DispatchRequest_ptr r) = 0;
};

//
// IDL:ooc.com/OB/ThreadPoolId:1.0
//
typedef ::CORBA::ULong ThreadPoolId;
typedef ::CORBA::ULong_out ThreadPoolId_out;

//
// IDL:ooc.com/OB/InvalidThreadPool:1.0
//
struct InvalidThreadPool : public ::CORBA::UserException
{
    InvalidThreadPool() { }
    InvalidThreadPool(const InvalidThreadPool&);
    InvalidThreadPool& operator=(const InvalidThreadPool&);

    static InvalidThreadPool* _downcast(::CORBA::Exception*);
    static const InvalidThreadPool* _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(InvalidThreadPool&, OB::InputStreamImpl*);
};

//
// IDL:ooc.com/OB/DispatchStrategyFactory:1.0
//
class DispatchStrategyFactory : virtual public ::CORBA::Object
{
    DispatchStrategyFactory(const DispatchStrategyFactory&);
    void operator=(const DispatchStrategyFactory&);

protected:

    static OB_IMPORT const char* ids_[];

public:

    DispatchStrategyFactory() { }
    virtual ~DispatchStrategyFactory() { }

    typedef DispatchStrategyFactory_ptr _ptr_type;
    typedef DispatchStrategyFactory_var _var_type;

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

    static inline DispatchStrategyFactory_ptr
    _nil()
    {
        return 0;
    }

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

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


    //
    // IDL:ooc.com/OB/DispatchStrategyFactory/create_thread_pool:1.0
    //
    virtual ThreadPoolId create_thread_pool(::CORBA::Long nthreads) = 0;

    //
    // IDL:ooc.com/OB/DispatchStrategyFactory/destroy_thread_pool:1.0
    //
    virtual void destroy_thread_pool(ThreadPoolId id) = 0;

    //
    // IDL:ooc.com/OB/DispatchStrategyFactory/create_thread_pool_strategy:1.0
    //
    virtual DispatchStrategy_ptr create_thread_pool_strategy(ThreadPoolId id) = 0;

    //
    // IDL:ooc.com/OB/DispatchStrategyFactory/create_same_thread_strategy:1.0
    //
    virtual DispatchStrategy_ptr create_same_thread_strategy() = 0;

    //
    // IDL:ooc.com/OB/DispatchStrategyFactory/create_thread_per_request_strategy:1.0
    //
    virtual DispatchStrategy_ptr create_thread_per_request_strategy() = 0;

    //
    // IDL:ooc.com/OB/DispatchStrategyFactory/create_default_dispatch_strategy:1.0
    //
    virtual DispatchStrategy_ptr create_default_dispatch_strategy() = 0;
};

} // End of namespace OB

//
// IDL:ooc.com/OB:1.0
//
namespace OBProxy_OB
{

} // End of namespace OBProxy_OB

//
// IDL:ooc.com/OB:1.0
//
namespace OBStubImpl_OB
{

} // End of namespace OBStubImpl_OB

//
// IDL:ooc.com/OB:1.0
//
namespace OBMarshalStubImpl_OB
{

} // End of namespace OBMarshalStubImpl_OB

//
// IDL:ooc.com/OB:1.0
//
namespace OBV_OB
{

} // End of namespace OBV_OB

//
// IDL:ooc.com/OB/DispatchRequest:1.0
//
namespace CORBA
{

inline void
release(::OB::DispatchRequest_ptr p)
{
    if(p)
        p -> _remove_ref();
}

inline Boolean
is_nil(::OB::DispatchRequest_ptr p)
{
    return p == 0;
}

} // End of namespace CORBA

//
// IDL:ooc.com/OB/DispatchStrategy:1.0
//
namespace CORBA
{

inline void
release(::OB::DispatchStrategy_ptr p)
{
    if(p)
        p -> _remove_ref();
}

inline Boolean
is_nil(::OB::DispatchStrategy_ptr p)
{
    return p == 0;
}

} // End of namespace CORBA

//
// IDL:ooc.com/OB/DispatchStrategyFactory:1.0
//
namespace CORBA
{

inline void
release(::OB::DispatchStrategyFactory_ptr p)
{
    if(p)
        p -> _remove_ref();
}

inline Boolean
is_nil(::OB::DispatchStrategyFactory_ptr p)
{
    return p == 0;
}

} // End of namespace CORBA

#endif
