inline Decl check_seq_declaration(Range& r, Triple_store const& ts) { boost::sub_range<Range> bsr(r); if( ! bsr ) BOOST_THROW_EXCEPTION( Logic_err() << Logic_err::msg_t("empty sequence") ); const Decl d = declaration<Decl>(bsr.front(), ts); if( d.is_none() ) BOOST_THROW_EXCEPTION( Logic_err() << Logic_err::msg_t("node " + Decl::name() + " declaration not found") << Logic_err::str1_t(to_string(bsr.front(), ts)) ); bsr.advance_begin(1); check_seq_declaration(bsr, d, ts); return d; }
/**@brief *******************************************************************************/ template<class Decl> inline Decl check_same_declaration(const Node_id n1, const Node_id n2, Triple_store const& ts) { const Decl d1 = declaration<Decl>(n1, ts); if( d1.is_none() ) BOOST_THROW_EXCEPTION( Logic_err() << Logic_err::msg_t("node " + Decl::name() + " declaration not found") << Logic_err::str1_t(to_string(n1, ts)) ); const Decl d2 = declaration<Decl>(n2, ts); if( d1 != d2 ) BOOST_THROW_EXCEPTION( Logic_err() << Logic_err::msg_t("node type mismatch") << Logic_err::str1_t(d1.to_string()) << Logic_err::str2_t(d2.to_string()) ); return d1; }