LCOV - code coverage report
Current view: top level - dom/xul/templates - nsResourceSet.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 26 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 12 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /* This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       4             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       5             : #ifndef nsResourceSet_h__
       6             : #define nsResourceSet_h__
       7             : 
       8             : #include "nsIRDFResource.h"
       9             : 
      10             : class nsResourceSet
      11             : {
      12             : public:
      13           0 :     nsResourceSet()
      14           0 :         : mResources(nullptr),
      15             :           mCount(0),
      16           0 :           mCapacity(0) {
      17           0 :         MOZ_COUNT_CTOR(nsResourceSet); }
      18             : 
      19             :     nsResourceSet(const nsResourceSet& aResourceSet);
      20             : 
      21             :     nsResourceSet& operator=(const nsResourceSet& aResourceSet);
      22             : 
      23             :     ~nsResourceSet();
      24             : 
      25             :     nsresult Clear();
      26             :     nsresult Add(nsIRDFResource* aProperty);
      27             :     void Remove(nsIRDFResource* aProperty);
      28             : 
      29             :     bool Contains(nsIRDFResource* aProperty) const;
      30             : 
      31             : protected:
      32             :     nsIRDFResource** mResources;
      33             :     int32_t mCount;
      34             :     int32_t mCapacity;
      35             : 
      36             : public:
      37             :     class ConstIterator {
      38             :     protected:
      39             :         nsIRDFResource** mCurrent;
      40             : 
      41             :     public:
      42           0 :         ConstIterator() : mCurrent(nullptr) {}
      43             : 
      44           0 :         ConstIterator(const ConstIterator& aConstIterator)
      45           0 :             : mCurrent(aConstIterator.mCurrent) {}
      46             : 
      47           0 :         ConstIterator& operator=(const ConstIterator& aConstIterator) {
      48           0 :             mCurrent = aConstIterator.mCurrent;
      49           0 :             return *this; }
      50             : 
      51           0 :         ConstIterator& operator++() {
      52           0 :             ++mCurrent;
      53           0 :             return *this; }
      54             : 
      55           0 :         ConstIterator operator++(int) {
      56           0 :             ConstIterator result(*this);
      57           0 :             ++mCurrent;
      58           0 :             return result; }
      59             : 
      60           0 :         /*const*/ nsIRDFResource* operator*() const {
      61           0 :             return *mCurrent; }
      62             : 
      63           0 :         /*const*/ nsIRDFResource* operator->() const MOZ_NO_ADDREF_RELEASE_ON_RETURN {
      64           0 :             return *mCurrent; }
      65             : 
      66             :         bool operator==(const ConstIterator& aConstIterator) const {
      67             :             return mCurrent == aConstIterator.mCurrent; }
      68             : 
      69           0 :         bool operator!=(const ConstIterator& aConstIterator) const {
      70           0 :             return mCurrent != aConstIterator.mCurrent; }
      71             : 
      72             :     protected:
      73           0 :         explicit ConstIterator(nsIRDFResource** aProperty) : mCurrent(aProperty) {}
      74             :         friend class nsResourceSet;
      75             :     };
      76             : 
      77           0 :     ConstIterator First() const { return ConstIterator(mResources); }
      78           0 :     ConstIterator Last() const { return ConstIterator(mResources + mCount); }
      79             : };
      80             : 
      81             : #endif // nsResourceSet_h__
      82             : 

Generated by: LCOV version 1.13