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

#ifndef PBackgroundIDBCursor_h
#define PBackgroundIDBCursor_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/dom/indexedDB/Key.h"
#include "mozilla/ipc/IPCCore.h"
#include "mozilla/ipc/IPDLStructMember.h"
#include "mozilla/dom/indexedDB/PBackgroundIDBSharedTypes.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ContinueParams|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class ContinueParams final
{
private:
    typedef ::mozilla::dom::indexedDB::Key Key;

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

    MOZ_IMPLICIT ContinueParams(const Key& _key) :
        key_(_key)
    {
    }

    MOZ_IMPLICIT ContinueParams(Key&& _key) :
        key_(std::move(_key))
    {
    }

    Key&
    key()
    {
        return key_;
    }
    const Key&
    key() const
    {
        return key_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<Key> key_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::ContinueParams>
{
    typedef ::mozilla::dom::indexedDB::ContinueParams 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 ContinuePrimaryKeyParams|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class ContinuePrimaryKeyParams final
{
private:
    typedef ::mozilla::dom::indexedDB::Key Key;

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

    MOZ_IMPLICIT ContinuePrimaryKeyParams(
            const Key& _key,
            const Key& _primaryKey) :
        key_(_key),
        primaryKey_(_primaryKey)
    {
    }

    MOZ_IMPLICIT ContinuePrimaryKeyParams(
            Key&& _key,
            Key&& _primaryKey) :
        key_(std::move(_key)),
        primaryKey_(std::move(_primaryKey))
    {
    }

    Key&
    key()
    {
        return key_;
    }
    const Key&
    key() const
    {
        return key_;
    }

    Key&
    primaryKey()
    {
        return primaryKey_;
    }
    const Key&
    primaryKey() const
    {
        return primaryKey_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<Key> key_;
    ::mozilla::ipc::IPDLStructMember<Key> primaryKey_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::ContinuePrimaryKeyParams>
{
    typedef ::mozilla::dom::indexedDB::ContinuePrimaryKeyParams 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 AdvanceParams|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class AdvanceParams final
{
private:
    typedef ::uint32_t uint32_t;

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

    MOZ_IMPLICIT AdvanceParams(const uint32_t& _count) :
        count_(_count)
    {
    }

    MOZ_IMPLICIT AdvanceParams(uint32_t&& _count) :
        count_(std::move(_count))
    {
    }

    uint32_t&
    count()
    {
        return count_;
    }
    const uint32_t&
    count() const
    {
        return count_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<uint32_t> count_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::AdvanceParams>
{
    typedef ::mozilla::dom::indexedDB::AdvanceParams 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 CursorRequestParams|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class CursorRequestParams final
{
public:
    enum Type {
        T__None,
        TContinueParams = 1,
        TContinuePrimaryKeyParams,
        TAdvanceParams,
        T__Last = TAdvanceParams
    };

private:
    typedef ::mozilla::dom::indexedDB::ContinueParams ContinueParams;
    typedef ::mozilla::dom::indexedDB::ContinuePrimaryKeyParams ContinuePrimaryKeyParams;
    typedef ::mozilla::dom::indexedDB::AdvanceParams AdvanceParams;
    typedef ContinueParams ContinueParams__tdef;
    typedef ContinuePrimaryKeyParams ContinuePrimaryKeyParams__tdef;
    typedef AdvanceParams AdvanceParams__tdef;

    ContinueParams*
    ptr_ContinueParams()
    {
        return (&(mVContinueParams));
    }
    const ContinueParams*
    constptr_ContinueParams() const
    {
        return (&(mVContinueParams));
    }
    ContinuePrimaryKeyParams*
    ptr_ContinuePrimaryKeyParams()
    {
        return (&(mVContinuePrimaryKeyParams));
    }
    const ContinuePrimaryKeyParams*
    constptr_ContinuePrimaryKeyParams() const
    {
        return (&(mVContinuePrimaryKeyParams));
    }
    AdvanceParams*
    ptr_AdvanceParams()
    {
        return (&(mVAdvanceParams));
    }
    const AdvanceParams*
    constptr_AdvanceParams() const
    {
        return (&(mVAdvanceParams));
    }

    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 CursorRequestParams() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT CursorRequestParams(const ContinueParams& aOther);

    MOZ_IMPLICIT CursorRequestParams(ContinueParams&& aOther);

    MOZ_IMPLICIT CursorRequestParams(const ContinuePrimaryKeyParams& aOther);

    MOZ_IMPLICIT CursorRequestParams(ContinuePrimaryKeyParams&& aOther);

    MOZ_IMPLICIT CursorRequestParams(const AdvanceParams& aOther);

    MOZ_IMPLICIT CursorRequestParams(AdvanceParams&& aOther);

    MOZ_IMPLICIT CursorRequestParams(const CursorRequestParams& aOther);

    MOZ_IMPLICIT CursorRequestParams(CursorRequestParams&& aOther);

    ~CursorRequestParams();

    Type
    type() const
    {
        return mType;
    }

    CursorRequestParams&
    operator=(const ContinueParams& aRhs);

    CursorRequestParams&
    operator=(ContinueParams&& aRhs);

    CursorRequestParams&
    operator=(const ContinuePrimaryKeyParams& aRhs);

    CursorRequestParams&
    operator=(ContinuePrimaryKeyParams&& aRhs);

    CursorRequestParams&
    operator=(const AdvanceParams& aRhs);

    CursorRequestParams&
    operator=(AdvanceParams&& aRhs);

    CursorRequestParams&
    operator=(const CursorRequestParams& aRhs);

    CursorRequestParams&
    operator=(CursorRequestParams&& aRhs);

    ContinueParams&
    get_ContinueParams()
    {
        AssertSanity(TContinueParams);
        return (*(ptr_ContinueParams()));
    }
    const ContinueParams&
    get_ContinueParams() const
    {
        AssertSanity(TContinueParams);
        return (*(constptr_ContinueParams()));
    }
    operator ContinueParams&()
    {
        return get_ContinueParams();
    }
    operator const ContinueParams&() const
    {
        return get_ContinueParams();
    }

    ContinuePrimaryKeyParams&
    get_ContinuePrimaryKeyParams()
    {
        AssertSanity(TContinuePrimaryKeyParams);
        return (*(ptr_ContinuePrimaryKeyParams()));
    }
    const ContinuePrimaryKeyParams&
    get_ContinuePrimaryKeyParams() const
    {
        AssertSanity(TContinuePrimaryKeyParams);
        return (*(constptr_ContinuePrimaryKeyParams()));
    }
    operator ContinuePrimaryKeyParams&()
    {
        return get_ContinuePrimaryKeyParams();
    }
    operator const ContinuePrimaryKeyParams&() const
    {
        return get_ContinuePrimaryKeyParams();
    }

    AdvanceParams&
    get_AdvanceParams()
    {
        AssertSanity(TAdvanceParams);
        return (*(ptr_AdvanceParams()));
    }
    const AdvanceParams&
    get_AdvanceParams() const
    {
        AssertSanity(TAdvanceParams);
        return (*(constptr_AdvanceParams()));
    }
    operator AdvanceParams&()
    {
        return get_AdvanceParams();
    }
    operator const AdvanceParams&() const
    {
        return get_AdvanceParams();
    }

private:
    union {
        ContinueParams mVContinueParams;
        ContinuePrimaryKeyParams mVContinuePrimaryKeyParams;
        AdvanceParams mVAdvanceParams;
    };
    Type mType;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::CursorRequestParams>
{
    typedef ::mozilla::dom::indexedDB::CursorRequestParams 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 ObjectStoreCursorResponse|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class ObjectStoreCursorResponse final
{
private:
    typedef ::mozilla::dom::indexedDB::Key Key;
    typedef ::mozilla::dom::indexedDB::SerializedStructuredCloneReadInfo SerializedStructuredCloneReadInfo;

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

    MOZ_IMPLICIT ObjectStoreCursorResponse(
            const Key& _key,
            SerializedStructuredCloneReadInfo&& _cloneInfo) :
        key_(_key),
        cloneInfo_(std::move(_cloneInfo))
    {
    }

    MOZ_IMPLICIT ObjectStoreCursorResponse(
            Key&& _key,
            SerializedStructuredCloneReadInfo&& _cloneInfo) :
        key_(std::move(_key)),
        cloneInfo_(std::move(_cloneInfo))
    {
    }

    Key&
    key()
    {
        return key_;
    }
    const Key&
    key() const
    {
        return key_;
    }

    SerializedStructuredCloneReadInfo&
    cloneInfo()
    {
        return cloneInfo_;
    }
    const SerializedStructuredCloneReadInfo&
    cloneInfo() const
    {
        return cloneInfo_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<Key> key_;
    ::mozilla::ipc::IPDLStructMember<SerializedStructuredCloneReadInfo> cloneInfo_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::ObjectStoreCursorResponse>
{
    typedef ::mozilla::dom::indexedDB::ObjectStoreCursorResponse 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 ObjectStoreKeyCursorResponse|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class ObjectStoreKeyCursorResponse final
{
private:
    typedef ::mozilla::dom::indexedDB::Key Key;

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

    MOZ_IMPLICIT ObjectStoreKeyCursorResponse(const Key& _key) :
        key_(_key)
    {
    }

    MOZ_IMPLICIT ObjectStoreKeyCursorResponse(Key&& _key) :
        key_(std::move(_key))
    {
    }

    Key&
    key()
    {
        return key_;
    }
    const Key&
    key() const
    {
        return key_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<Key> key_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::ObjectStoreKeyCursorResponse>
{
    typedef ::mozilla::dom::indexedDB::ObjectStoreKeyCursorResponse 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 IndexCursorResponse|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class IndexCursorResponse final
{
private:
    typedef ::mozilla::dom::indexedDB::Key Key;
    typedef ::mozilla::dom::indexedDB::SerializedStructuredCloneReadInfo SerializedStructuredCloneReadInfo;

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

    MOZ_IMPLICIT IndexCursorResponse(
            const Key& _key,
            const Key& _sortKey,
            const Key& _objectKey,
            SerializedStructuredCloneReadInfo&& _cloneInfo) :
        key_(_key),
        sortKey_(_sortKey),
        objectKey_(_objectKey),
        cloneInfo_(std::move(_cloneInfo))
    {
    }

    MOZ_IMPLICIT IndexCursorResponse(
            Key&& _key,
            Key&& _sortKey,
            Key&& _objectKey,
            SerializedStructuredCloneReadInfo&& _cloneInfo) :
        key_(std::move(_key)),
        sortKey_(std::move(_sortKey)),
        objectKey_(std::move(_objectKey)),
        cloneInfo_(std::move(_cloneInfo))
    {
    }

    Key&
    key()
    {
        return key_;
    }
    const Key&
    key() const
    {
        return key_;
    }

    Key&
    sortKey()
    {
        return sortKey_;
    }
    const Key&
    sortKey() const
    {
        return sortKey_;
    }

    Key&
    objectKey()
    {
        return objectKey_;
    }
    const Key&
    objectKey() const
    {
        return objectKey_;
    }

    SerializedStructuredCloneReadInfo&
    cloneInfo()
    {
        return cloneInfo_;
    }
    const SerializedStructuredCloneReadInfo&
    cloneInfo() const
    {
        return cloneInfo_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<Key> key_;
    ::mozilla::ipc::IPDLStructMember<Key> sortKey_;
    ::mozilla::ipc::IPDLStructMember<Key> objectKey_;
    ::mozilla::ipc::IPDLStructMember<SerializedStructuredCloneReadInfo> cloneInfo_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::IndexCursorResponse>
{
    typedef ::mozilla::dom::indexedDB::IndexCursorResponse 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 IndexKeyCursorResponse|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class IndexKeyCursorResponse final
{
private:
    typedef ::mozilla::dom::indexedDB::Key Key;

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

    MOZ_IMPLICIT IndexKeyCursorResponse(
            const Key& _key,
            const Key& _sortKey,
            const Key& _objectKey) :
        key_(_key),
        sortKey_(_sortKey),
        objectKey_(_objectKey)
    {
    }

    MOZ_IMPLICIT IndexKeyCursorResponse(
            Key&& _key,
            Key&& _sortKey,
            Key&& _objectKey) :
        key_(std::move(_key)),
        sortKey_(std::move(_sortKey)),
        objectKey_(std::move(_objectKey))
    {
    }

    Key&
    key()
    {
        return key_;
    }
    const Key&
    key() const
    {
        return key_;
    }

    Key&
    sortKey()
    {
        return sortKey_;
    }
    const Key&
    sortKey() const
    {
        return sortKey_;
    }

    Key&
    objectKey()
    {
        return objectKey_;
    }
    const Key&
    objectKey() const
    {
        return objectKey_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<Key> key_;
    ::mozilla::ipc::IPDLStructMember<Key> sortKey_;
    ::mozilla::ipc::IPDLStructMember<Key> objectKey_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::IndexKeyCursorResponse>
{
    typedef ::mozilla::dom::indexedDB::IndexKeyCursorResponse 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 CursorResponse|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class CursorResponse final
{
public:
    enum Type {
        T__None,
        Tvoid_t = 1,
        Tnsresult,
        TArrayOfObjectStoreCursorResponse,
        TArrayOfObjectStoreKeyCursorResponse,
        TArrayOfIndexCursorResponse,
        TArrayOfIndexKeyCursorResponse,
        T__Last = TArrayOfIndexKeyCursorResponse
    };

private:
    typedef ::mozilla::void_t void_t;
    typedef ::nsresult nsresult;
    typedef ::mozilla::dom::indexedDB::ObjectStoreCursorResponse ObjectStoreCursorResponse;
    typedef ::mozilla::dom::indexedDB::ObjectStoreKeyCursorResponse ObjectStoreKeyCursorResponse;
    typedef ::mozilla::dom::indexedDB::IndexCursorResponse IndexCursorResponse;
    typedef ::mozilla::dom::indexedDB::IndexKeyCursorResponse IndexKeyCursorResponse;
    typedef void_t void_t__tdef;
    typedef nsresult nsresult__tdef;
    typedef nsTArray<ObjectStoreCursorResponse> ArrayOfObjectStoreCursorResponse__tdef;
    typedef nsTArray<ObjectStoreKeyCursorResponse> ArrayOfObjectStoreKeyCursorResponse__tdef;
    typedef nsTArray<IndexCursorResponse> ArrayOfIndexCursorResponse__tdef;
    typedef nsTArray<IndexKeyCursorResponse> ArrayOfIndexKeyCursorResponse__tdef;

    void_t*
    ptr_void_t()
    {
        return (&(mVvoid_t));
    }
    const void_t*
    constptr_void_t() const
    {
        return (&(mVvoid_t));
    }
    nsresult*
    ptr_nsresult()
    {
        return (&(mVnsresult));
    }
    const nsresult*
    constptr_nsresult() const
    {
        return (&(mVnsresult));
    }
    nsTArray<ObjectStoreCursorResponse>*
    ptr_ArrayOfObjectStoreCursorResponse()
    {
        return (&(mVArrayOfObjectStoreCursorResponse));
    }
    const nsTArray<ObjectStoreCursorResponse>*
    constptr_ArrayOfObjectStoreCursorResponse() const
    {
        return (&(mVArrayOfObjectStoreCursorResponse));
    }
    nsTArray<ObjectStoreKeyCursorResponse>*
    ptr_ArrayOfObjectStoreKeyCursorResponse()
    {
        return (&(mVArrayOfObjectStoreKeyCursorResponse));
    }
    const nsTArray<ObjectStoreKeyCursorResponse>*
    constptr_ArrayOfObjectStoreKeyCursorResponse() const
    {
        return (&(mVArrayOfObjectStoreKeyCursorResponse));
    }
    nsTArray<IndexCursorResponse>*
    ptr_ArrayOfIndexCursorResponse()
    {
        return (&(mVArrayOfIndexCursorResponse));
    }
    const nsTArray<IndexCursorResponse>*
    constptr_ArrayOfIndexCursorResponse() const
    {
        return (&(mVArrayOfIndexCursorResponse));
    }
    nsTArray<IndexKeyCursorResponse>*
    ptr_ArrayOfIndexKeyCursorResponse()
    {
        return (&(mVArrayOfIndexKeyCursorResponse));
    }
    const nsTArray<IndexKeyCursorResponse>*
    constptr_ArrayOfIndexKeyCursorResponse() const
    {
        return (&(mVArrayOfIndexKeyCursorResponse));
    }

    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 CursorResponse() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT CursorResponse(const void_t& aOther);

    MOZ_IMPLICIT CursorResponse(void_t&& aOther);

    MOZ_IMPLICIT CursorResponse(const nsresult& aOther);

    MOZ_IMPLICIT CursorResponse(nsresult&& aOther);

    MOZ_IMPLICIT CursorResponse(nsTArray<ObjectStoreCursorResponse>&& aOther);

    MOZ_IMPLICIT CursorResponse(const nsTArray<ObjectStoreKeyCursorResponse>& aOther);

    MOZ_IMPLICIT CursorResponse(nsTArray<ObjectStoreKeyCursorResponse>&& aOther);

    MOZ_IMPLICIT CursorResponse(nsTArray<IndexCursorResponse>&& aOther);

    MOZ_IMPLICIT CursorResponse(const nsTArray<IndexKeyCursorResponse>& aOther);

    MOZ_IMPLICIT CursorResponse(nsTArray<IndexKeyCursorResponse>&& aOther);

    MOZ_IMPLICIT CursorResponse(CursorResponse&& aOther);

    ~CursorResponse();

    Type
    type() const
    {
        return mType;
    }

    CursorResponse&
    operator=(const void_t& aRhs);

    CursorResponse&
    operator=(void_t&& aRhs);

    CursorResponse&
    operator=(const nsresult& aRhs);

    CursorResponse&
    operator=(nsresult&& aRhs);

    CursorResponse&
    operator=(nsTArray<ObjectStoreCursorResponse>&& aRhs);

    CursorResponse&
    operator=(const nsTArray<ObjectStoreKeyCursorResponse>& aRhs);

    CursorResponse&
    operator=(nsTArray<ObjectStoreKeyCursorResponse>&& aRhs);

    CursorResponse&
    operator=(nsTArray<IndexCursorResponse>&& aRhs);

    CursorResponse&
    operator=(const nsTArray<IndexKeyCursorResponse>& aRhs);

    CursorResponse&
    operator=(nsTArray<IndexKeyCursorResponse>&& aRhs);

    CursorResponse&
    operator=(CursorResponse&& aRhs);

    void_t&
    get_void_t()
    {
        AssertSanity(Tvoid_t);
        return (*(ptr_void_t()));
    }
    const void_t&
    get_void_t() const
    {
        AssertSanity(Tvoid_t);
        return (*(constptr_void_t()));
    }
    operator void_t&()
    {
        return get_void_t();
    }
    operator const void_t&() const
    {
        return get_void_t();
    }

    nsresult&
    get_nsresult()
    {
        AssertSanity(Tnsresult);
        return (*(ptr_nsresult()));
    }
    const nsresult&
    get_nsresult() const
    {
        AssertSanity(Tnsresult);
        return (*(constptr_nsresult()));
    }
    operator nsresult&()
    {
        return get_nsresult();
    }
    operator const nsresult&() const
    {
        return get_nsresult();
    }

    nsTArray<ObjectStoreCursorResponse>&
    get_ArrayOfObjectStoreCursorResponse()
    {
        AssertSanity(TArrayOfObjectStoreCursorResponse);
        return (*(ptr_ArrayOfObjectStoreCursorResponse()));
    }
    const nsTArray<ObjectStoreCursorResponse>&
    get_ArrayOfObjectStoreCursorResponse() const
    {
        AssertSanity(TArrayOfObjectStoreCursorResponse);
        return (*(constptr_ArrayOfObjectStoreCursorResponse()));
    }
    operator nsTArray<ObjectStoreCursorResponse>&()
    {
        return get_ArrayOfObjectStoreCursorResponse();
    }
    operator const nsTArray<ObjectStoreCursorResponse>&() const
    {
        return get_ArrayOfObjectStoreCursorResponse();
    }

    nsTArray<ObjectStoreKeyCursorResponse>&
    get_ArrayOfObjectStoreKeyCursorResponse()
    {
        AssertSanity(TArrayOfObjectStoreKeyCursorResponse);
        return (*(ptr_ArrayOfObjectStoreKeyCursorResponse()));
    }
    const nsTArray<ObjectStoreKeyCursorResponse>&
    get_ArrayOfObjectStoreKeyCursorResponse() const
    {
        AssertSanity(TArrayOfObjectStoreKeyCursorResponse);
        return (*(constptr_ArrayOfObjectStoreKeyCursorResponse()));
    }
    operator nsTArray<ObjectStoreKeyCursorResponse>&()
    {
        return get_ArrayOfObjectStoreKeyCursorResponse();
    }
    operator const nsTArray<ObjectStoreKeyCursorResponse>&() const
    {
        return get_ArrayOfObjectStoreKeyCursorResponse();
    }

    nsTArray<IndexCursorResponse>&
    get_ArrayOfIndexCursorResponse()
    {
        AssertSanity(TArrayOfIndexCursorResponse);
        return (*(ptr_ArrayOfIndexCursorResponse()));
    }
    const nsTArray<IndexCursorResponse>&
    get_ArrayOfIndexCursorResponse() const
    {
        AssertSanity(TArrayOfIndexCursorResponse);
        return (*(constptr_ArrayOfIndexCursorResponse()));
    }
    operator nsTArray<IndexCursorResponse>&()
    {
        return get_ArrayOfIndexCursorResponse();
    }
    operator const nsTArray<IndexCursorResponse>&() const
    {
        return get_ArrayOfIndexCursorResponse();
    }

    nsTArray<IndexKeyCursorResponse>&
    get_ArrayOfIndexKeyCursorResponse()
    {
        AssertSanity(TArrayOfIndexKeyCursorResponse);
        return (*(ptr_ArrayOfIndexKeyCursorResponse()));
    }
    const nsTArray<IndexKeyCursorResponse>&
    get_ArrayOfIndexKeyCursorResponse() const
    {
        AssertSanity(TArrayOfIndexKeyCursorResponse);
        return (*(constptr_ArrayOfIndexKeyCursorResponse()));
    }
    operator nsTArray<IndexKeyCursorResponse>&()
    {
        return get_ArrayOfIndexKeyCursorResponse();
    }
    operator const nsTArray<IndexKeyCursorResponse>&() const
    {
        return get_ArrayOfIndexKeyCursorResponse();
    }

private:
    union {
        void_t mVvoid_t;
        nsresult mVnsresult;
        nsTArray<ObjectStoreCursorResponse> mVArrayOfObjectStoreCursorResponse;
        nsTArray<ObjectStoreKeyCursorResponse> mVArrayOfObjectStoreKeyCursorResponse;
        nsTArray<IndexCursorResponse> mVArrayOfIndexCursorResponse;
        nsTArray<IndexKeyCursorResponse> mVArrayOfIndexKeyCursorResponse;
    };
    Type mType;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

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

namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBCursorParent;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBCursorChild;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PBackgroundIDBCursorChild and PBackgroundIDBCursorParent
//
namespace mozilla {
namespace dom {
namespace indexedDB {
namespace PBackgroundIDBCursor {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::dom::indexedDB::PBackgroundIDBCursorParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::dom::indexedDB::PBackgroundIDBCursorChild>* aChild);

enum MessageType {
    PBackgroundIDBCursorStart = PBackgroundIDBCursorMsgStart << 16,
    Msg_DeleteMe__ID,
    Msg_Continue__ID,
    Msg___delete____ID,
    Reply___delete____ID,
    Msg_Response__ID,
    PBackgroundIDBCursorEnd
};

mozilla::UniquePtr<IPC::Message>
Msg_DeleteMe(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_Continue(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg___delete__(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply___delete__(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_Response(IPC::Message::routeid_t routingId);



} // namespace PBackgroundIDBCursor
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

#endif // ifndef PBackgroundIDBCursor_h
