// Copyright (c) ZeroC, Inc.

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

#ifndef IceLocatorDiscovery_Lookup_h_
#define IceLocatorDiscovery_Lookup_h_

#include <Ice/PushDisableWarnings.h>
#include <Ice/Ice.h>
#include <Ice/Locator.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)

/// IceLocatorDiscovery is an Ice plug-in that enables the discovery of Ice locators (such as IceGrid) via UDP
/// multicast.
namespace IceLocatorDiscovery
{
    class LookupReplyPrx;

    class LookupPrx;
}

namespace IceLocatorDiscovery
{
    /// Represents a callback object implemented by IceLocatorDiscovery clients. It allows IceLocatorDiscovery clients
    /// to receive replies to LookupPrx requests.
    /// @remarks The Slice compiler generated this proxy class from Slice interface `::IceLocatorDiscovery::LookupReply`.
    /// @see LookupPrx
    class LookupReplyPrx : public Ice::Proxy<LookupReplyPrx, 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.
        LookupReplyPrx(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.
        LookupReplyPrx(const LookupReplyPrx& 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.
        LookupReplyPrx(LookupReplyPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)

        ~LookupReplyPrx() 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.
        LookupReplyPrx& operator=(const LookupReplyPrx& 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.
        LookupReplyPrx& operator=(LookupReplyPrx&& rhs) noexcept
        {
            if (this != &rhs)
            {
                Ice::ObjectPrx::operator=(std::move(rhs));
            }
            return *this;
        }

        /// Provides a reply to a ::IceLocatorDiscovery::LookupPrx::findLocator request.
        /// @param prx The proxy of the locator.
        /// @param context The request context.
        void foundLocator(const std::optional<::Ice::LocatorPrx>& prx, const Ice::Context& context = Ice::noExplicitContext) const;

        /// Provides a reply to a ::IceLocatorDiscovery::LookupPrx::findLocator request.
        /// @param prx The proxy of the locator.
        /// @param context The request context.
        /// @return A future that becomes available when the invocation completes.
        [[nodiscard]] std::future<void> foundLocatorAsync(const std::optional<::Ice::LocatorPrx>& prx, const Ice::Context& context = Ice::noExplicitContext) const;

        /// Provides a reply to a ::IceLocatorDiscovery::LookupPrx::findLocator request.
        /// @param prx The proxy of the locator.
        /// @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()> foundLocatorAsync(const std::optional<::Ice::LocatorPrx>& prx, 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_foundLocator(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const std::optional<::Ice::LocatorPrx>&, const Ice::Context&) const;

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

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

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

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

    /// Looks for a locator using UDP multicast.
    /// @remarks This interface is implemented by Ice locator implementations and can be used by clients to find
    /// available Ice locators on the network.
    /// Ice locator implementations provide a well-known `Ice/LocatorLookup` object accessible through UDP multicast.
    /// Clients typically make a multicast `findLocator` request to find the locator proxy.
    ///
    /// The Slice compiler generated this proxy class from Slice interface `::IceLocatorDiscovery::Lookup`.
    /// @see LookupReplyPrx
    class LookupPrx : public Ice::Proxy<LookupPrx, 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.
        LookupPrx(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.
        LookupPrx(const LookupPrx& 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.
        LookupPrx(LookupPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)

        ~LookupPrx() 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.
        LookupPrx& operator=(const LookupPrx& 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.
        LookupPrx& operator=(LookupPrx&& rhs) noexcept
        {
            if (this != &rhs)
            {
                Ice::ObjectPrx::operator=(std::move(rhs));
            }
            return *this;
        }

        /// Finds a locator proxy with the given @p instanceName.
        /// @param instanceName Restrict the search to Ice registries configured with the given instance name. If
        /// empty, all the available registries will reply.
        /// @param reply The reply object to use to send the reply.
        /// @param context The request context.
        void findLocator(std::string_view instanceName, const std::optional<LookupReplyPrx>& reply, const Ice::Context& context = Ice::noExplicitContext) const;

        /// Finds a locator proxy with the given @p instanceName.
        /// @param instanceName Restrict the search to Ice registries configured with the given instance name. If
        /// empty, all the available registries will reply.
        /// @param reply The reply object to use to send the reply.
        /// @param context The request context.
        /// @return A future that becomes available when the invocation completes.
        [[nodiscard]] std::future<void> findLocatorAsync(std::string_view instanceName, const std::optional<LookupReplyPrx>& reply, const Ice::Context& context = Ice::noExplicitContext) const;

        /// Finds a locator proxy with the given @p instanceName.
        /// @param instanceName Restrict the search to Ice registries configured with the given instance name. If
        /// empty, all the available registries will reply.
        /// @param reply The reply object to use to send the reply.
        /// @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()> findLocatorAsync(std::string_view instanceName, const std::optional<LookupReplyPrx>& reply, 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_findLocator(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, const std::optional<LookupReplyPrx>&, const Ice::Context&) const;

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

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

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

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

namespace IceLocatorDiscovery
{
    /// Represents a callback object implemented by IceLocatorDiscovery clients. It allows IceLocatorDiscovery clients
    /// to receive replies to LookupPrx requests.
    /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceLocatorDiscovery::LookupReply`.
    /// @see LookupPrx
    class LookupReply : public virtual Ice::Object
    {
    public:
        /// The associated proxy type.
        using ProxyType = LookupReplyPrx;

        /// 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(Ice::IncomingRequest& request, std::function<void(Ice::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;

        /// Provides a reply to a ::IceLocatorDiscovery::LookupPrx::findLocator request.
        /// @param prx The proxy of the locator.
        /// @param current The Current object of the incoming request.
        virtual void foundLocator(std::optional<::Ice::LocatorPrx> prx, const Ice::Current& current) = 0;

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

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

    /// A shared pointer to a LookupReply.
    using LookupReplyPtr = std::shared_ptr<LookupReply>;

    /// Looks for a locator using UDP multicast.
    /// @remarks This interface is implemented by Ice locator implementations and can be used by clients to find
    /// available Ice locators on the network.
    /// Ice locator implementations provide a well-known `Ice/LocatorLookup` object accessible through UDP multicast.
    /// Clients typically make a multicast `findLocator` request to find the locator proxy.
    ///
    /// The Slice compiler generated this skeleton class from Slice interface `::IceLocatorDiscovery::Lookup`.
    /// @see LookupReplyPrx
    class Lookup : public virtual Ice::Object
    {
    public:
        /// The associated proxy type.
        using ProxyType = LookupPrx;

        /// 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(Ice::IncomingRequest& request, std::function<void(Ice::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;

        /// Finds a locator proxy with the given @p instanceName.
        /// @param instanceName Restrict the search to Ice registries configured with the given instance name. If
        /// empty, all the available registries will reply.
        /// @param reply The reply object to use to send the reply.
        /// @param current The Current object of the incoming request.
        virtual void findLocator(std::string instanceName, std::optional<LookupReplyPrx> reply, const Ice::Current& current) = 0;

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

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

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

namespace IceLocatorDiscovery
{
    /// Represents a callback object implemented by IceLocatorDiscovery clients. It allows IceLocatorDiscovery clients
    /// to receive replies to LookupPrx requests.
    /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceLocatorDiscovery::LookupReply`.
    /// @see LookupPrx
    class AsyncLookupReply : public virtual Ice::Object
    {
    public:
        /// The associated proxy type.
        using ProxyType = LookupReplyPrx;

        /// 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(Ice::IncomingRequest& request, std::function<void(Ice::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;

        /// Provides a reply to a ::IceLocatorDiscovery::LookupPrx::findLocator request.
        /// @param prx The proxy of the locator.
        /// @param response The response callback.
        /// @param exception The exception callback.
        /// @param current The Current object of the incoming request.
        virtual void foundLocatorAsync(std::optional<::Ice::LocatorPrx> prx, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;

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

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

    /// A shared pointer to an AsyncLookupReply.
    using AsyncLookupReplyPtr = std::shared_ptr<AsyncLookupReply>;

    /// Looks for a locator using UDP multicast.
    /// @remarks This interface is implemented by Ice locator implementations and can be used by clients to find
    /// available Ice locators on the network.
    /// Ice locator implementations provide a well-known `Ice/LocatorLookup` object accessible through UDP multicast.
    /// Clients typically make a multicast `findLocator` request to find the locator proxy.
    ///
    /// The Slice compiler generated this skeleton class from Slice interface `::IceLocatorDiscovery::Lookup`.
    /// @see LookupReplyPrx
    class AsyncLookup : public virtual Ice::Object
    {
    public:
        /// The associated proxy type.
        using ProxyType = LookupPrx;

        /// 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(Ice::IncomingRequest& request, std::function<void(Ice::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;

        /// Finds a locator proxy with the given @p instanceName.
        /// @param instanceName Restrict the search to Ice registries configured with the given instance name. If
        /// empty, all the available registries will reply.
        /// @param reply The reply object to use to send the reply.
        /// @param response The response callback.
        /// @param exception The exception callback.
        /// @param current The Current object of the incoming request.
        virtual void findLocatorAsync(std::string instanceName, std::optional<LookupReplyPrx> reply, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;

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

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

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

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

#include <Ice/PopDisableWarnings.h>
#endif
