nsRDFTestNode.h 1.6 KB

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