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 :
6 : #ifndef nsXULTemplateResultSetRDF_h__
7 : #define nsXULTemplateResultSetRDF_h__
8 :
9 : #include "nsISimpleEnumerator.h"
10 : #include "nsRuleNetwork.h"
11 : #include "nsRDFQuery.h"
12 : #include "nsXULTemplateResultRDF.h"
13 : #include "mozilla/Attributes.h"
14 :
15 : class nsXULTemplateQueryProcessorRDF;
16 : class nsXULTemplateResultRDF;
17 :
18 : /**
19 : * An enumerator used to iterate over a set of results.
20 : */
21 : class nsXULTemplateResultSetRDF final : public nsISimpleEnumerator
22 : {
23 : private:
24 : nsXULTemplateQueryProcessorRDF* mProcessor;
25 :
26 : nsRDFQuery* mQuery;
27 :
28 : const InstantiationSet* mInstantiations;
29 :
30 : nsCOMPtr<nsIRDFResource> mResource;
31 :
32 : InstantiationSet::List *mCurrent;
33 :
34 : bool mCheckedNext;
35 :
36 0 : ~nsXULTemplateResultSetRDF()
37 0 : {
38 0 : delete mInstantiations;
39 0 : }
40 :
41 : public:
42 :
43 : // nsISupports interface
44 : NS_DECL_ISUPPORTS
45 :
46 : // nsISimpleEnumerator interface
47 : NS_DECL_NSISIMPLEENUMERATOR
48 :
49 0 : nsXULTemplateResultSetRDF(nsXULTemplateQueryProcessorRDF *aProcessor,
50 : nsRDFQuery* aQuery,
51 : const InstantiationSet* aInstantiations)
52 0 : : mProcessor(aProcessor),
53 : mQuery(aQuery),
54 : mInstantiations(aInstantiations),
55 : mCurrent(nullptr),
56 0 : mCheckedNext(false)
57 0 : { }
58 : };
59 :
60 : #endif // nsXULTemplateResultSetRDF_h__
|