class PolicySRBase : public PolicyBase<TI> {
public:
DecisionItem getDecisionItem(const typename TI::match_type &item) const {
- for (auto i : *this) {
+ for (auto &i : *this) {
tslog::log_verbose("-read: ", i.getDecision(), " ", i, "\n");
if (item.match(i.getType(), i.getInterface(), i.getPath(),
pimpl->printContent();
}
+inline boost::string_ref s(const flatbuffers::String *str) {
+ return boost::string_ref(str->c_str(), str->size());
+}
+
template <typename T, typename I>
bool match(const T &match, const I *i) {
- return match.match(makeMessageType(i->type()), i->interface()->c_str(), i->path()->c_str(),
- i->member()->c_str(), i->name()->c_str(), i->is_name_prefix());
+ return match.match(makeMessageType(i->type()),
+ s(i->interface()),
+ s(i->path()),
+ s(i->member()),
+ s(i->name()),
+ i->is_name_prefix());
}
template <> bool match(const ldp_xml_parser::MatchItemAccess &match, const FB::ItemAccess *item) {