Menu

[r45]: / trunk / libtop_engine / rule_internal.cpp  Maximize  Restore  History

Download this file

54 lines (44 with data), 1.3 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
#include "rule_internal.h"
#include "rule_term_base.h"
namespace rule {
namespace internal {
const unsigned int beta_relation::NO_LOOKUP_INDEX = std::numeric_limits<unsigned int>::max();
std::string relation_row_map::to_string()const
{
std::ostringstream out;
data_type::const_iterator itor = m_data.begin();
data_type::const_iterator end = m_data.end();
bool is_first = true;
out << "[";
for(;itor!=end; ++itor) {
if(!is_first) out << ", ";
out << rdf::internal::to_resource_base(*itor);
is_first = false;
}
out << "]";
return out.str();
};
std::string relation_row_map::to_string(rule_term_base const& rule_term)const
{
std::ostringstream out;
data_type::const_iterator itor = m_data.begin();
data_type::const_iterator end = m_data.end();
index_map_helper::label_iterator litor = rule_term.label_iterator_begin();
index_map_helper::label_iterator lend = rule_term.label_iterator_end();
bool is_first = true;
out << "[";
for(;itor!=end; ++itor) {
if(!is_first) out << ", ";
if(litor != lend) {
out << *litor << "=" << rdf::internal::to_resource_base(*itor);
++litor;
} else {
out << rdf::internal::to_resource_base(*itor);
}
is_first = false;
}
out << "]";
return out.str();
};
}; /* internal */
}; /* rule */
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.