//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PWebGPUTypes_h
#define PWebGPUTypes_h

#include "mozilla/Attributes.h"
#include "IPCMessageStart.h"
#include "mozilla/RefPtr.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "mozilla/MozPromise.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/ipc/ByteBuf.h"
#include "mozilla/ipc/FileDescriptor.h"
#include "mozilla/ipc/IPCForwards.h"
#include "mozilla/ipc/Shmem.h"

// Headers for typedefs
#include "mozilla/ipc/IPDLStructMember.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct BufferMapSuccess|
//
namespace mozilla {
namespace webgpu {
class BufferMapSuccess final
{
private:
    typedef ::uint64_t uint64_t;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    BufferMapSuccess() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT BufferMapSuccess(
            const uint64_t& _offset,
            const uint64_t& _size,
            const bool& _writable) :
        writable_(_writable),
        offset_(_offset),
        size_(_size)
    {
    }

    MOZ_IMPLICIT BufferMapSuccess(
            uint64_t&& _offset,
            uint64_t&& _size,
            bool&& _writable) :
        writable_(std::move(_writable)),
        offset_(std::move(_offset)),
        size_(std::move(_size))
    {
    }

    uint64_t&
    offset()
    {
        return offset_;
    }
    const uint64_t&
    offset() const
    {
        return offset_;
    }

    uint64_t&
    size()
    {
        return size_;
    }
    const uint64_t&
    size() const
    {
        return size_;
    }

    bool&
    writable()
    {
        return writable_;
    }
    const bool&
    writable() const
    {
        return writable_;
    }

private:
    void
    StaticAssertions() const;
    ::mozilla::ipc::IPDLStructMember<bool> writable_;
    ::mozilla::ipc::IPDLStructMember<uint64_t> offset_;
    ::mozilla::ipc::IPDLStructMember<uint64_t> size_;
};
} // namespace webgpu
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::webgpu::BufferMapSuccess>
{
    typedef ::mozilla::webgpu::BufferMapSuccess paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct BufferMapError|
//
namespace mozilla {
namespace webgpu {
class BufferMapError final
{
private:
    typedef ::nsCString nsCString;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    BufferMapError() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT BufferMapError(const nsCString& _message) :
        message_(_message)
    {
    }

    MOZ_IMPLICIT BufferMapError(nsCString&& _message) :
        message_(std::move(_message))
    {
    }

    nsCString&
    message()
    {
        return message_;
    }
    const nsCString&
    message() const
    {
        return message_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<nsCString> message_;
};
} // namespace webgpu
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::webgpu::BufferMapError>
{
    typedef ::mozilla::webgpu::BufferMapError paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union BufferMapResult|
//
namespace mozilla {
namespace webgpu {
class BufferMapResult final
{
public:
    enum Type {
        T__None,
        TBufferMapSuccess = 1,
        TBufferMapError,
        T__Last = TBufferMapError
    };

private:
    typedef ::mozilla::webgpu::BufferMapSuccess BufferMapSuccess;
    typedef ::mozilla::webgpu::BufferMapError BufferMapError;
    typedef BufferMapSuccess BufferMapSuccess__tdef;
    typedef BufferMapError BufferMapError__tdef;

    BufferMapSuccess*
    ptr_BufferMapSuccess()
    {
        return (&(mVBufferMapSuccess));
    }
    const BufferMapSuccess*
    constptr_BufferMapSuccess() const
    {
        return (&(mVBufferMapSuccess));
    }
    BufferMapError*
    ptr_BufferMapError()
    {
        return (&(mVBufferMapError));
    }
    const BufferMapError*
    constptr_BufferMapError() const
    {
        return (&(mVBufferMapError));
    }

    void
    MaybeDestroy();

    void
    AssertSanity() const
    {
        MOZ_RELEASE_ASSERT((T__None) <= (mType), "invalid type tag");
        MOZ_RELEASE_ASSERT((mType) <= (T__Last), "invalid type tag");
    }
    void
    AssertSanity(Type aType) const
    {
        AssertSanity();
        MOZ_RELEASE_ASSERT((mType) == (aType), "unexpected type tag");
    }

public:
    MOZ_IMPLICIT BufferMapResult() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT BufferMapResult(const BufferMapSuccess& aOther);

    MOZ_IMPLICIT BufferMapResult(BufferMapSuccess&& aOther);

    MOZ_IMPLICIT BufferMapResult(const BufferMapError& aOther);

    MOZ_IMPLICIT BufferMapResult(BufferMapError&& aOther);

    MOZ_IMPLICIT BufferMapResult(const BufferMapResult& aOther);

    MOZ_IMPLICIT BufferMapResult(BufferMapResult&& aOther);

    ~BufferMapResult();

    Type
    type() const
    {
        return mType;
    }

    BufferMapResult&
    operator=(const BufferMapSuccess& aRhs);

    BufferMapResult&
    operator=(BufferMapSuccess&& aRhs);

    BufferMapResult&
    operator=(const BufferMapError& aRhs);

    BufferMapResult&
    operator=(BufferMapError&& aRhs);

    BufferMapResult&
    operator=(const BufferMapResult& aRhs);

    BufferMapResult&
    operator=(BufferMapResult&& aRhs);

    BufferMapSuccess&
    get_BufferMapSuccess()
    {
        AssertSanity(TBufferMapSuccess);
        return (*(ptr_BufferMapSuccess()));
    }
    const BufferMapSuccess&
    get_BufferMapSuccess() const
    {
        AssertSanity(TBufferMapSuccess);
        return (*(constptr_BufferMapSuccess()));
    }
    operator BufferMapSuccess&()
    {
        return get_BufferMapSuccess();
    }
    operator const BufferMapSuccess&() const
    {
        return get_BufferMapSuccess();
    }

    BufferMapError&
    get_BufferMapError()
    {
        AssertSanity(TBufferMapError);
        return (*(ptr_BufferMapError()));
    }
    const BufferMapError&
    get_BufferMapError() const
    {
        AssertSanity(TBufferMapError);
        return (*(constptr_BufferMapError()));
    }
    operator BufferMapError&()
    {
        return get_BufferMapError();
    }
    operator const BufferMapError&() const
    {
        return get_BufferMapError();
    }

private:
    union {
        BufferMapSuccess mVBufferMapSuccess;
        BufferMapError mVBufferMapError;
    };
    Type mType;
};
} // namespace webgpu
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::webgpu::BufferMapResult>
{
    typedef ::mozilla::webgpu::BufferMapResult paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC

#endif // ifndef PWebGPUTypes_h
