storage/mozStorageResultSet.h
author James Graham <james@hoppipolla.co.uk>
Mon, 21 May 2018 11:37:35 +0100
changeset 1555220 4c1f3fe87bc0049ab9f4138994d3c10d1e4a8514
parent 467925 dd79977a3286d947aff8e270245d05c05e676964
child 1049334 cbb8fdf1daf98a15f7d57f6b08d273bdf96aa1a0
child 1336492 46ef8bf6c68664b27953e4680747da7a985c30b2
child 1343097 98e2b4ee9775a2a2b5cc1bb8a390bfe901814f38
child 1398386 80ed235cff6a319ed3171c949f352a5d6e41726e
permissions -rw-r--r--
Bug 1354232 - Add support for LSAN to mozlog, r=ahal, mccr8 This adds two new actions to mozlog, one for reporting an LSAN failure, and one for reporting the summary. MozReview-Commit-ID: D7ep27SrI1n

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozStorageResultSet_h
#define mozStorageResultSet_h

#include "mozIStorageResultSet.h"
#include "nsCOMArray.h"
#include "mozilla/Attributes.h"
class mozIStorageRow;

namespace mozilla {
namespace storage {

class ResultSet final : public mozIStorageResultSet
{
public:
  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_MOZISTORAGERESULTSET

  ResultSet();

  /**
   * Adds a tuple to this result set.
   */
  nsresult add(mozIStorageRow *aTuple);

  /**
   * @returns the number of rows this result set holds.
   */
  int32_t rows() const { return mData.Count(); }

private:
  ~ResultSet();

  /**
   * Stores the current index of the active result set.
   */
  int32_t mCurrentIndex;

  /**
   * Stores the tuples.
   */
  nsCOMArray<mozIStorageRow> mData;
};

} // namespace storage
} // namespace mozilla

#endif // mozStorageResultSet_h