Menu

[r12]: / trunk / libtop_engine / rdf_index.cpp  Maximize  Restore  History

Download this file

101 lines (80 with data), 2.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
#include "rdf_index.h"
namespace rdf {
// literal const literal::_NO_VALUE_ = literal();
namespace internal {
index_graph_iterator index_graph::find(index_type u, index_type v) const
{
typedef itor_map<u_map_type> U;
typedef itor_map<v_map_type> V;
typedef w_itor_set W;
typedef index_graph_iterator iterator;
u_const_itor_type utor = m_index.find(u);
if(utor == m_index.end()) {
return iterator(U(0, m_index.end(), m_index.end()),
V(0, m_v_end, m_v_end),
W(m_w_end, m_w_end));
}
v_const_itor_type vtor = utor->second.find(v);
if(vtor == utor->second.end()) {
return iterator(U(0, m_index.end(), m_index.end()),
V(0, m_v_end, m_v_end),
W(m_w_end, m_w_end));
}
return iterator(U(u, m_index.end(), m_index.end()),
V(v, m_v_end, m_v_end), W(vtor->second.begin(), vtor->second.end()));
};
index_graph_iterator index_graph::find(index_type u) const
{
typedef itor_map<u_map_type> U;
typedef itor_map<v_map_type> V;
typedef w_itor_set W;
typedef index_graph_iterator iterator;
u_const_itor_type utor = m_index.find(u);
if(utor == m_index.end()) {
return iterator(
U(0, m_index.end(), m_index.end()),
V(0, m_v_end, m_v_end),
W(m_w_end, m_w_end));
}
v_const_itor_type vtor_begin = utor->second.begin();
v_const_itor_type vtor_end = utor->second.end();
if(vtor_begin == vtor_end) {
return iterator(
U(0, m_index.end(), m_index.end()),
V(0, vtor_end, vtor_end),
W(m_w_end, m_w_end));
}
return iterator(
U(u, m_index.end(), m_index.end()),
V(0, vtor_begin, vtor_end),
W(vtor_begin->second.begin(), vtor_begin->second.end()));
};
index_graph_iterator index_graph::find() const
{
typedef itor_map<u_map_type> U;
typedef itor_map<v_map_type> V;
typedef w_itor_set W;
typedef index_graph_iterator iterator;
u_const_itor_type utor_begin = m_index.begin();
u_const_itor_type utor_end = m_index.end();
if(utor_begin == utor_end) {
return iterator(
U(0, utor_end, utor_end),
V(0, m_v_end, m_v_end),
W(m_w_end, m_w_end));
}
v_const_itor_type vtor_begin = utor_begin->second.begin();
v_const_itor_type vtor_end = utor_begin->second.end();
if(vtor_begin == vtor_end) {
return iterator(
U(0, utor_end, utor_end),
V(0, vtor_end, vtor_end),
W(m_w_end, m_w_end));
}
return iterator(
U(0, utor_begin, utor_end),
V(0, vtor_begin, vtor_end),
W(vtor_begin->second.begin(), vtor_begin->second.end()));
};
}; /* internal namespace */
}; /* rdf namespace */
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.