// Copyright (c) ZeroC, Inc.

// slice2cpp version 3.8.1
// <auto-generated>Generated from Slice file 'Process.ice'.</auto-generated>
// clang-format off

#ifndef Ice_Process_h_
#define Ice_Process_h_

#include <Ice/PushDisableWarnings.h>
#include <Ice/Ice.h>
#include "LocatorRegistry.h"

#ifndef ICE_DISABLE_VERSION
#   if ICE_INT_VERSION / 100 != 308
#       error Ice version mismatch!
#   endif
#   if ICE_INT_VERSION % 100 >= 50
#       error Beta header file detected
#   endif
#   if ICE_INT_VERSION % 100 < 1
#       error Ice patch level mismatch!
#   endif
#endif

// NOLINTBEGIN(modernize-concat-nested-namespaces)

namespace Ice
{
    class ProcessPrx;
}

namespace Ice
{
    /// A server application managed by a locator implementation such as IceGrid hosts a Process object and registers a
    /// proxy to this object with the locator registry. See LocatorRegistryPrx::setServerProcessProxy.
    /// @remarks The Slice compiler generated this proxy class from Slice interface `::Ice::Process`.
    /// @headerfile Ice/Ice.h
    class ICE_API ProcessPrx : public Ice::Proxy<ProcessPrx, Ice::ObjectPrx>
    {
    public:
        /// Constructs a proxy from a Communicator and a proxy string.
        /// @param communicator The communicator of the new proxy.
        /// @param proxyString The proxy string to parse.
        ProcessPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)

        /// Copy constructor. Constructs with a copy of the contents of @p other.
        /// @param other The proxy to copy from.
        ProcessPrx(const ProcessPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)

        /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
        /// @param other The proxy to move from.
        ProcessPrx(ProcessPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)

        ~ProcessPrx() override;

        /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
        /// @param rhs The proxy to copy from.
        /// @return A reference to this proxy.
        ProcessPrx& operator=(const ProcessPrx& rhs) noexcept
        {
            if (this != &rhs)
            {
                Ice::ObjectPrx::operator=(rhs);
            }
            return *this;
        }

        /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
        /// @param rhs The proxy to move from.
        ProcessPrx& operator=(ProcessPrx&& rhs) noexcept
        {
            if (this != &rhs)
            {
                Ice::ObjectPrx::operator=(std::move(rhs));
            }
            return *this;
        }

        /// Initiates a graceful shutdown of the server application.
        /// @param context The request context.
        void shutdown(const Ice::Context& context = Ice::noExplicitContext) const;

        /// Initiates a graceful shutdown of the server application.
        /// @param context The request context.
        /// @return A future that becomes available when the invocation completes.
        [[nodiscard]] std::future<void> shutdownAsync(const Ice::Context& context = Ice::noExplicitContext) const;

        /// Initiates a graceful shutdown of the server application.
        /// @param response The response callback.
        /// @param exception The exception callback.
        /// @param sent The sent callback.
        /// @param context The request context.
        /// @return A function that can be called to cancel the invocation locally.
        // NOLINTNEXTLINE(modernize-use-nodiscard)
        std::function<void()> shutdownAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;

        /// @private
        void _iceI_shutdown(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const Ice::Context&) const;

        /// Writes a message on the server application's stdout or stderr.
        /// @param message The message to write.
        /// @param fd 1 for stdout, 2 for stderr.
        /// @param context The request context.
        void writeMessage(std::string_view message, std::int32_t fd, const Ice::Context& context = Ice::noExplicitContext) const;

        /// Writes a message on the server application's stdout or stderr.
        /// @param message The message to write.
        /// @param fd 1 for stdout, 2 for stderr.
        /// @param context The request context.
        /// @return A future that becomes available when the invocation completes.
        [[nodiscard]] std::future<void> writeMessageAsync(std::string_view message, std::int32_t fd, const Ice::Context& context = Ice::noExplicitContext) const;

        /// Writes a message on the server application's stdout or stderr.
        /// @param message The message to write.
        /// @param fd 1 for stdout, 2 for stderr.
        /// @param response The response callback.
        /// @param exception The exception callback.
        /// @param sent The sent callback.
        /// @param context The request context.
        /// @return A function that can be called to cancel the invocation locally.
        // NOLINTNEXTLINE(modernize-use-nodiscard)
        std::function<void()> writeMessageAsync(std::string_view message, std::int32_t fd, std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;

        /// @private
        void _iceI_writeMessage(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, std::int32_t, const Ice::Context&) const;

        /// Gets the type ID of the associated Slice interface.
        /// @return The string `"::Ice::Process"`.
        static const char* ice_staticId() noexcept;

        /// @private
        static ProcessPrx _fromReference(IceInternal::ReferencePtr ref) { return ProcessPrx{std::move(ref)}; }

    protected:
        /// @private
        ProcessPrx() = default;

        /// @private
        explicit ProcessPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
        {
        }
    };
}

namespace Ice
{
    /// A server application managed by a locator implementation such as IceGrid hosts a Process object and registers a
    /// proxy to this object with the locator registry. See LocatorRegistryPrx::setServerProcessProxy.
    /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Ice::Process`.
    /// @headerfile Ice/Ice.h
    class ICE_API Process : public virtual Ice::Object
    {
    public:
        /// The associated proxy type.
        using ProxyType = ProcessPrx;

        /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
        /// @param request The incoming request.
        /// @param sendResponse The callback to send the response.
        void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;

        [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;

        [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;

        /// Initiates a graceful shutdown of the server application.
        /// @param current The Current object of the incoming request.
        virtual void shutdown(const Ice::Current& current) = 0;

        /// @private
        void _iceD_shutdown(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);

        /// Writes a message on the server application's stdout or stderr.
        /// @param message The message to write.
        /// @param fd 1 for stdout, 2 for stderr.
        /// @param current The Current object of the incoming request.
        virtual void writeMessage(std::string message, std::int32_t fd, const Ice::Current& current) = 0;

        /// @private
        void _iceD_writeMessage(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);

        /// Gets the type ID of the associated Slice interface.
        /// @return The string `"::Ice::Process"`.
        static const char* ice_staticId() noexcept;
    };

    /// A shared pointer to a Process.
    using ProcessPtr = std::shared_ptr<Process>;
}

namespace Ice
{
    /// A server application managed by a locator implementation such as IceGrid hosts a Process object and registers a
    /// proxy to this object with the locator registry. See LocatorRegistryPrx::setServerProcessProxy.
    /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Ice::Process`.
    /// @headerfile Ice/Ice.h
    class ICE_API AsyncProcess : public virtual Ice::Object
    {
    public:
        /// The associated proxy type.
        using ProxyType = ProcessPrx;

        /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
        /// @param request The incoming request.
        /// @param sendResponse The callback to send the response.
        void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;

        [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;

        [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;

        /// Initiates a graceful shutdown of the server application.
        /// @param response The response callback.
        /// @param exception The exception callback.
        /// @param current The Current object of the incoming request.
        virtual void shutdownAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;

        /// @private
        void _iceD_shutdown(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);

        /// Writes a message on the server application's stdout or stderr.
        /// @param message The message to write.
        /// @param fd 1 for stdout, 2 for stderr.
        /// @param response The response callback.
        /// @param exception The exception callback.
        /// @param current The Current object of the incoming request.
        virtual void writeMessageAsync(std::string message, std::int32_t fd, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;

        /// @private
        void _iceD_writeMessage(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);

        /// Gets the type ID of the associated Slice interface.
        /// @return The string `"::Ice::Process"`.
        static const char* ice_staticId() noexcept;
    };

    /// A shared pointer to an AsyncProcess.
    using AsyncProcessPtr = std::shared_ptr<AsyncProcess>;
}

// NOLINTEND(modernize-concat-nested-namespaces)

#include <Ice/PopDisableWarnings.h>
#endif
