Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

TripleSource.h

00001 // See the file LICENSE in the some directory as this file for legal
00002 // notices about this software.   
00003 // $Id: TripleSource_8h-source.html,v 1.11 2001/10/10 20:40:58 sandro Exp $
00004 #ifndef DEV_W3_ORG__2001_BLINDFOLD_SRC_TRIPLESOURCE_H
00005 #define DEV_W3_ORG__2001_BLINDFOLD_SRC_TRIPLESOURCE_H
00006 #include "config.h"
00007 
00008 
00009 #include "LoopState.h"
00010 #include "Symbol.h"
00011 #include "Triple.h"
00012 class TripleSink;
00013 class Query;
00014 class Pattern;
00015 class VariableScope;
00016 
00026 class TripleSource {
00027       
00028 public:
00029 
00030     // STANDARD MEMBER FUNCTIONS
00031     TripleSource();
00032     TripleSource(const TripleSource& other);
00033     const TripleSource& operator=(const TripleSource& other);
00034     bool operator==(const TripleSource& other) const;
00035     bool operator<(const TripleSource& other) const;
00036     size_t hash() const;
00037     friend std::ostream& operator<<(std::ostream& s, const TripleSource& me);
00038     virtual std::ostream& print_to(std::ostream& stream) const; 
00039     virtual ~TripleSource();       
00040 
00041     // CLASS-SPECIFIC PUBLIC INTERFACE
00042     
00043     std::ostream& printNTriples(std::ostream& stream, const char* prefix="") const; 
00044 
00045     /*
00046        Get a copy of the Symbol to use which indicates the absense of a Symbol. 
00047        @return The Symbol you should use (for this TripleSource) as a
00048        wildcard in the pattern for fetch(), or in other places (in
00049        derived classes) to indicate the absense of a Symbol.
00050     */
00051 
00052 
00062     virtual Triple fetch(Triple simplePattern, 
00063              LoopState& loopState, 
00064              unsigned long max_results = 0) const = 0;
00065 
00066     // virtual Query* fetch(const TripleSource* complexPattern) const;
00067 
00071     virtual VariableScope* getScope() const;
00072 
00077     TripleSource* asBound();
00078 
00083     virtual TripleSource* unionWith(const TripleSource& other) {
00084     // this may be the kind of thing that many never implement,
00085     // I think.
00086     NOT_IMPLEMENTED;
00087     }
00088 
00092     virtual TripleSource* intersect(const TripleSource& other) {
00093     // this may be the kind of thing that many never implement,
00094     // I think.
00095     NOT_IMPLEMENTED;
00096     }
00100     virtual TripleSource* diff(const TripleSource& other) {
00101     // this may be the kind of thing that many never implement,
00102     // I think.
00103     NOT_IMPLEMENTED;
00104     }
00105 
00106     virtual size_t count() const;
00107 
00108 protected:
00109 
00110     virtual Pattern* getPatternView();
00111 
00112 };     
00113 
00114 
00115 STANDARD_EXTERNAL(TripleSource)
00116 
00117 #endif   /* TRIPLESOURCE */  // -*-C++-*-

Home to blindfold. This page generated via doxygen 1.2.11.1 Wed Oct 10 16:40:33 2001.