#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 */