29 #include <boost/any.hpp>
46 _it.get()->write(strm);
53 return (*
_it == that);
56 return (*
_it == that);
59 return _it.get()->notAtEnd();
62 return _it.get()->notLTBegin();
70 (*strm) <<
_it->nsecs();
77 PrinterIter *it =
new DateTimePrinterIter(
_list.begin(),
79 return iterator(boost::shared_ptr<PrinterIter>(it));
82 PrinterIter *it =
new DateTimePrinterIter(
_list.end()-1,
84 return iterator(boost::shared_ptr<PrinterIter>(it));
88 const std::string&
name)
90 return new DateTimePrinterList(prop, name);
96 (*strm) << ((*_it) ?
"true" :
"false");
103 PrinterIter *it =
new BoolPrinterIter(
_list.begin(),
105 return iterator(boost::shared_ptr<PrinterIter>(it));
108 PrinterIter *it =
new BoolPrinterIter(
_list.end()-1,
110 return iterator(boost::shared_ptr<PrinterIter>(it));
114 const std::string&
name)
116 return new BoolPrinterList(prop, name);
119 #define PF_ADD(T) add(typeid(T), &lsst::pex::logging::makePrinter<T>)
130 PF_ADD(
unsigned char);
139 const std::string&
name,
140 const PrinterFactory&
fact)
143 if (_list.get() == 0) {
145 tmp.
set(name,
"<unprintable>");
146 _list = boost::shared_ptr<PrinterList>(fact.makePrinter(tmp, name));
151 return _list.get()->begin();
155 return _list.get()->last();
WrappedPrinterIter iterator
Class for handling dates/times, including MJD, UTC, and TAI.
table::Key< std::string > name
virtual bool operator==(const PrinterIter &that) const
PropertyPrinter(const lsst::daf::base::PropertySet &prop, const std::string &name, const PrinterFactory &fact=defaultPrinterFactory)
virtual iterator last() const
virtual PrinterIter & operator--()
virtual std::ostream & write(std::ostream *strm) const
void add(const std::type_info &tp, factoryFuncPtr func)
virtual iterator begin() const
PrinterList * makeBoolPrinter(const lsst::daf::base::PropertySet &prop, const std::string &name)
PrinterList::iterator iterator
void set(std::string const &name, T const &value)
PrinterList * makePrinter(const lsst::daf::base::PropertySet &prop, const std::string &name)
the template factory function for supporting printing of printable types
lsst::daf::base::PropertySet PropertySet
virtual ~DateTimePrinterList()
std::vector< lsst::daf::base::DateTime > _list
PrinterList * makeDateTimePrinter(const lsst::daf::base::PropertySet &prop, const std::string &name)
virtual std::ostream & write(std::ostream *strm) const
virtual ~WrappedPrinterIter()
std::vector< lsst::daf::base::DateTime >::const_iterator _it
definition of the PropertyPrinter class and its helpers
virtual bool operator!=(const PrinterIter &that) const
boost::shared_ptr< PrinterList > _list
Interface for DateTime class.
virtual std::ostream & write(std::ostream *strm) const
virtual iterator begin() const
virtual bool notAtEnd() const
boost::shared_ptr< PrinterIter > _it
virtual PrinterIter & operator++()
Class for storing generic metadata.
static PrinterFactory defaultPrinterFactory
virtual bool notLTBegin() const
virtual iterator last() const
virtual ~DateTimePrinterIter()
virtual ~BoolPrinterList()
virtual ~BoolPrinterIter()