dlvhex  2.5.0
ostream_printable< T > Class Template Reference

With this class, you can make your own classes ostream-printable. More...

#include <include/dlvhex2/Printhelpers.h>

Inherited by Table< AggregateAtom, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< impl::AddressTag > > > >, Table< BuiltinAtom, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< impl::AddressTag > > > >, Table< ExternalAtom, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< impl::AddressTag > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< impl::PredicateTag >, > > >, Table< Module, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< impl::AddressTag > >, boost::multi_index::hashed_unique< boost::multi_index::tag< impl::ModuleNameTag >, > > >, Table< ModuleAtom, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< impl::AddressTag > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< impl::PredicateTag >, >, boost::multi_index::hashed_unique< boost::multi_index::tag< impl::ElementTag >, boost::multi_index::composite_key< ModuleAtom, BOOST_MULTI_INDEX_MEMBER(ModuleAtom, ID, predicate), BOOST_MULTI_INDEX_MEMBER(ModuleAtom, Tuple, inputs), > > > >, Table< OrdinaryAtom, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< impl::AddressTag > >, boost::multi_index::hashed_unique< boost::multi_index::tag< impl::TextTag >, >, boost::multi_index::hashed_unique< boost::multi_index::tag< impl::TupleTag >, >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< impl::PredicateTag >, boost::multi_index::const_mem_fun_explicit< OrdinaryAtom, ID, ID(Atom::*)() const,&Atom::front > > > >, Table< Predicate, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< impl::AddressTag > >, boost::multi_index::hashed_unique< boost::multi_index::tag< impl::PredicateNameTag >, > > >, Table< Rule, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< impl::AddressTag > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< impl::KindTag >, >, boost::multi_index::hashed_unique< boost::multi_index::tag< impl::ElementTag >, boost::multi_index::composite_key< Rule, BOOST_MULTI_INDEX_MEMBER(Rule, IDKind, kind), BOOST_MULTI_INDEX_MEMBER(Rule, Tuple, head), BOOST_MULTI_INDEX_MEMBER(Rule, Tuple, body), BOOST_MULTI_INDEX_MEMBER(Rule, Tuple, headGuard), BOOST_MULTI_INDEX_MEMBER(Rule, Tuple, bodyWeightVector), BOOST_MULTI_INDEX_MEMBER(Rule, ID, bound), BOOST_MULTI_INDEX_MEMBER(Rule, ID, weight), BOOST_MULTI_INDEX_MEMBER(Rule, ID, level), > > > >, and Table< Term, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< impl::AddressTag > >, boost::multi_index::hashed_unique< boost::multi_index::tag< impl::TermTag >, > > >.

Friends

std::ostream & operator<< (std::ostream &o, const T &t)
 Streaming operator.

Detailed Description

template<typename T>
class ostream_printable< T >

With this class, you can make your own classes ostream-printable.

Usage: * derive YourType from ostream_printable<YourType> * implement std::ostream& YourType::print(std::ostream& o) const; * now you can << YourType << and it will use the print() function. see http://en.wikipedia.org/wiki/BartonNackman_trick.

Definition at line 55 of file Printhelpers.h.


Friends And Related Function Documentation

template<typename T>
std::ostream& operator<< ( std::ostream &  o,
const T &  t 
) [friend]

Streaming operator.

Parameters:
oOutput stream to print to.
tElement to print.
Returns:
o.

Definition at line 61 of file Printhelpers.h.


The documentation for this class was generated from the following file: