00001 #define TRACE_NAME "TripleSource"
00002
00003 #include "TripleSource.h"
00004 #include "VariableScope.h"
00005
00007
00008
00009
00011
00012 TripleSource::TripleSource()
00013 {
00014
00015 }
00016
00017 #if 0
00018 bool TripleSource::operator==(const TripleSource& other) const
00019 {
00020 if (&other == this) return true;
00021 if (count() != other.count()) return false;
00022
00023
00024 return true
00025 }
00026 #endif
00027
00028 #if 0
00029
00030 TripleSource::TripleSource(const TripleSource& other)
00031 {
00032 NOT_IMPLEMENTED
00033 }
00034
00035 const TripleSource& TripleSource::operator=(const TripleSource& other)
00036 {
00037 NOT_IMPLEMENTED
00038 }
00039
00040 bool TripleSource::operator<(const TripleSource& other) const
00041 {
00042 NOT_IMPLEMENTED
00043 }
00044
00045 size_t TripleSource::hash() const
00046 {
00047 NOT_IMPLEMENTED
00048 }
00049
00050 #endif
00051
00052
00053 std::ostream& TripleSource::print_to(std::ostream& stream) const
00054 {
00055 stream << "# TripleSource at 0x" << std::hex << static_cast<const void*>(this) << std::dec;
00056 stream << std::endl;
00057
00058 size_t numVars = getScope()->getNumVars();
00059 stream << "# variables" << std::endl;
00060 for (size_t i=0; i<numVars; i++) {
00061 Symbol s = getScope()->getVar(i);
00062 stream << "# " << i << ". " << s << std::endl;
00063 }
00064
00065
00066 LoopState l;
00067 size_t count = 0;
00068 stream << "# triples" << std::endl;
00069 count = 0;
00070 while (Triple t = fetch(Triple::null, l)) {
00071 stream << "# " << count++ << ". " << t << std::endl;
00072 }
00073
00074 return stream;
00075 }
00076
00077
00078 std::ostream& TripleSource::printNTriples(std::ostream& stream, const char* prefix) const
00079 {
00080 LoopState l;
00081 size_t count = 0;
00082 count = 0;
00083 while (Triple t = fetch(Triple::null, l)) {
00084 stream << prefix << t << "." << std::endl;
00085 }
00086
00087 return stream;
00088 }
00089
00090
00091 TripleSource::~TripleSource()
00092 {
00093
00094 }
00095
00097
00098
00099
00101
00102 #if 0
00103 Query* TripleSource::fetch(const TripleSource* complexPattern) const
00104 {
00105 NOT_IMPLEMENTED;
00106 }
00107 #endif
00108
00109 VariableScope* TripleSource::getScope() const
00110 {
00111 NOT_IMPLEMENTED;
00112 }
00113
00114 Pattern* TripleSource::getPatternView()
00115 {
00116 NOT_IMPLEMENTED;
00117 }
00118
00119 size_t TripleSource::count() const
00120 {
00121 LoopState l;
00122 size_t count = 0;
00123 while (Triple t = fetch(Triple::null, l)) {
00124 count++;
00125 }
00126 return count;
00127 }
00128
00130
00131
00132
00134
00135
00136
00137 #undef TRACE_NAME