00001 
00002 
00003 
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     
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     
00042     
00043     std::ostream& printNTriples(std::ostream& stream, const char* prefix="") const; 
00044 
00045     
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00062     virtual Triple fetch(Triple simplePattern, 
00063              LoopState& loopState, 
00064              unsigned long max_results = 0) const = 0;
00065 
00066     
00067 
00071     virtual VariableScope* getScope() const;
00072 
00077     TripleSource* asBound();
00078 
00083     virtual TripleSource* unionWith(const TripleSource& other) {
00084     
00085     
00086     NOT_IMPLEMENTED;
00087     }
00088 
00092     virtual TripleSource* intersect(const TripleSource& other) {
00093     
00094     
00095     NOT_IMPLEMENTED;
00096     }
00100     virtual TripleSource* diff(const TripleSource& other) {
00101     
00102     
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