// Copyright (c) ZeroC, Inc.

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

#ifndef Ice_Identity_h_
#define Ice_Identity_h_

#include <Ice/PushDisableWarnings.h>
#include <Ice/Config.h>
#include <Ice/StreamHelpers.h>
#include <Ice/TupleCompare.h>
#include <string>
#include <vector>

#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)

/// The Ice RPC framework.
namespace Ice
{
    struct Identity;

    /// A sequence of identities.
    using IdentitySeq = std::vector<Identity>;
}

namespace Ice
{
    /// Represents the identity of an Ice object. It is comparable to the path of a URI. Its string representation is
    /// `name` when the category is empty, and `category/name` when the category is not empty.
    /// @remarks The Slice compiler generated this struct from Slice struct `::Ice::Identity`.
    /// @headerfile Ice/Ice.h
    struct Identity
    {
        /// The name of the Ice object. An empty name is not valid.
        std::string name;

        /// The category of the object.
        std::string category{};

        /// Creates a tuple with all the fields of this struct.
        /// @return A tuple with all the fields of this struct.
        [[nodiscard]] std::tuple<const std::string&, const std::string&> ice_tuple() const
        {
            return std::tie(name, category);
        }

        /// Outputs the name and value of each field of this instance to the stream.
        /// @param os The output stream.
        ICE_API void ice_printFields(std::ostream& os) const;
    };

    /// Outputs the description of an Identity to a stream, including all its fields.
    /// @param os The output stream.
    /// @param value The instance to output.
    /// @return The output stream.
    ICE_API std::ostream& operator<<(std::ostream& os, const Identity& value);

    /// @cond INTERNAL
    using Ice::Tuple::operator<;
    using Ice::Tuple::operator<=;
    using Ice::Tuple::operator>;
    using Ice::Tuple::operator>=;
    using Ice::Tuple::operator==;
    using Ice::Tuple::operator!=;
    /// @endcond
}

namespace Ice
{
    /// @cond INTERNAL
    template<>
    struct StreamableTraits<::Ice::Identity>
    {
        static constexpr StreamHelperCategory helper = StreamHelperCategoryStruct;
        static constexpr int minWireSize = 2;
        static constexpr bool fixedLength = false;
    };

    template<>
    struct StreamReader<::Ice::Identity>
    {
        /// Unmarshals a ::Ice::Identity from the input stream.
        static void read(InputStream* istr, ::Ice::Identity& v)
        {
            istr->readAll(v.name, v.category);
        }
    };
    /// @endcond
}

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

#include <Ice/PopDisableWarnings.h>
#endif
