// Copyright (c) ZeroC, Inc.

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

#ifndef Ice_Version_h_
#define Ice_Version_h_

#include <Ice/PushDisableWarnings.h>
#include <Ice/Config.h>
#include <Ice/TupleCompare.h>
#include <cstdint>
#include <ostream>

#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
{
    struct ProtocolVersion;

    struct EncodingVersion;
}

namespace Ice
{
    /// Represents a version of the Ice protocol. The only version implemented and supported by Ice is version 1.0.
    /// @remarks The Slice compiler generated this struct from Slice struct `::Ice::ProtocolVersion`.
    /// @headerfile Ice/Ice.h
    struct ProtocolVersion
    {
        /// The major version of the Ice protocol.
        std::uint8_t major;

        /// The minor version of the Ice protocol.
        std::uint8_t minor;

        /// 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::uint8_t&, const std::uint8_t&> ice_tuple() const
        {
            return std::tie(major, minor);
        }

        /// 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 a ProtocolVersion 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 ProtocolVersion& value);

    /// Represents a version of the Slice encoding. Ice supports version 1.0 and 1.1 of this encoding.
    /// @remarks The Slice encoding is also known as the Ice encoding.
    ///
    /// The Slice compiler generated this struct from Slice struct `::Ice::EncodingVersion`.
    /// @headerfile Ice/Ice.h
    struct EncodingVersion
    {
        /// The major version of the Slice encoding.
        std::uint8_t major;

        /// The minor version of the Slice encoding.
        std::uint8_t minor;

        /// 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::uint8_t&, const std::uint8_t&> ice_tuple() const
        {
            return std::tie(major, minor);
        }

        /// 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 EncodingVersion 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 EncodingVersion& 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
}

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

#include <Ice/PopDisableWarnings.h>
#endif
