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 nsRDFTestNode_h__
7 : #define nsRDFTestNode_h__
8 :
9 : #include "nsRuleNetwork.h"
10 :
11 : class nsIRDFResource;
12 : class nsIRDFNode;
13 :
14 : /**
15 : * An abstract base class for all of the RDF-related tests. This interface
16 : * allows us to iterate over all of the RDF tests to find the one in the
17 : * network that is apropos for a newly-added assertion.
18 : */
19 0 : class nsRDFTestNode : public TestNode
20 : {
21 : public:
22 0 : explicit nsRDFTestNode(TestNode* aParent)
23 0 : : TestNode(aParent) {}
24 :
25 : /**
26 : * Determine whether the node can propagate an assertion
27 : * with the specified source, property, and target. If the
28 : * assertion can be propagated, aInitialBindings will be
29 : * initialized with appropriate variable-to-value assignments
30 : * to allow the rule network to start a constrain and propagate
31 : * search from this node in the network.
32 : *
33 : * @return true if the node can propagate the specified
34 : * assertion.
35 : */
36 : virtual bool CanPropagate(nsIRDFResource* aSource,
37 : nsIRDFResource* aProperty,
38 : nsIRDFNode* aTarget,
39 : Instantiation& aInitialBindings) const = 0;
40 :
41 : /**
42 : *
43 : */
44 : virtual void Retract(nsIRDFResource* aSource,
45 : nsIRDFResource* aProperty,
46 : nsIRDFNode* aTarget) const = 0;
47 : };
48 :
49 : #endif // nsRDFTestNode_h__
|