30 #ifndef LSST_PEX_PROPERTYPRINTER_H
31 #define LSST_PEX_PROPERTYPRINTER_H
41 #include "boost/any.hpp"
63 virtual std::ostream&
write(std::ostream *strm)
const=0;
109 std::ostringstream out;
120 typename std::vector<T>::const_iterator beginiter,
121 typename std::vector<T>::const_iterator enditer)
131 return (this->
_it == that.
_it);
134 return (this->
_it != that.
_it);
150 return (thit == 0) ?
false : (*
this == *thit);
156 return (thit == 0) ?
true : (*
this != *thit);
167 typename std::vector<T>::const_iterator beginiter,
168 typename std::vector<T>::const_iterator enditer)
170 virtual std::ostream&
write(std::ostream *strm)
const;
175 (*strm) << *(this->_it);
190 virtual std::ostream&
write(std::ostream *strm)
const;
198 boost::shared_ptr<PrinterIter>
_it;
253 const std::string&
name)
254 :
_list(prop.getArray<T>(name)) { }
307 const std::string&
name) {
314 std::vector<lsst::daf::base::DateTime>::const_iterator beginiter,
315 std::vector<lsst::daf::base::DateTime>::const_iterator enditer)
320 virtual std::ostream&
write(std::ostream *strm)
const;
326 const std::string&
name)
335 const std::string&
name);
340 std::vector<bool>::const_iterator beginiter,
341 std::vector<bool>::const_iterator enditer)
344 virtual std::ostream&
write(std::ostream *strm)
const;
358 const std::string&
name);
394 const std::string&
name)
const
397 return (fi ==
_factFuncs.end()) ? 0 : (*(fi->second))(prop, name);
403 typedef std::map<std::string, factoryFuncPtr>
Lookup;
489 boost::shared_ptr<PrinterList>
_list;
494 #endif // end LSST_PEX_PROPERTYPRINTER_H
virtual bool operator==(const PrinterIter &that) const
BoolPrinterIter(std::vector< bool >::const_iterator listiter, std::vector< bool >::const_iterator beginiter, std::vector< bool >::const_iterator enditer)
virtual ~BaseTmplPrinterList()
WrappedPrinterIter iterator
virtual size_t valueCount() const
table::Key< std::string > name
an abstract iterator class used to print out property values
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)
virtual PrinterIter & operator--()
TmplPrinterIter(typename std::vector< T >::const_iterator listiter, typename std::vector< T >::const_iterator beginiter, typename std::vector< T >::const_iterator enditer)
PrinterList::iterator iterator
virtual bool operator!=(const PrinterIter &that) const =0
TmplPrinterIter< T > delegateIter
virtual PrinterIter & operator++()=0
DateTimePrinterList(const lsst::daf::base::PropertySet &prop, const std::string &name)
PrinterList * makePrinter(const lsst::daf::base::PropertySet &prop, const std::string &name)
the template factory function for supporting printing of printable types
virtual ~DateTimePrinterList()
an class for printing the values associated with a name in a PropertySet.
virtual bool operator==(const PrinterIter &that) const =0
PrinterList * makeDateTimePrinter(const lsst::daf::base::PropertySet &prop, const std::string &name)
virtual iterator begin() const =0
PrinterFactory(bool loadDefaults=false)
virtual iterator last() const =0
virtual std::ostream & write(std::ostream *strm) const =0
virtual bool operator!=(const PrinterIter &that) const
virtual std::ostream & write(std::ostream *strm) const
PrinterList * makePrinter(const lsst::daf::base::PropertySet &prop, const std::string &name) const
virtual std::ostream & write(std::ostream *strm) const
virtual ~WrappedPrinterIter()
std::vector< T >::const_iterator _it
virtual bool operator!=(const PrinterIter &that) const
boost::shared_ptr< PrinterList > _list
std::map< std::string, factoryFuncPtr > Lookup
bool operator==(const BaseTmplPrinterIter &that) const
Interface for DateTime class.
PrinterList *(* factoryFuncPtr)(const lsst::daf::base::PropertySet &, const std::string &)
virtual std::ostream & write(std::ostream *strm) const
BaseTmplPrinterIter(typename std::vector< T >::const_iterator listiter, typename std::vector< T >::const_iterator beginiter, typename std::vector< T >::const_iterator enditer)
std::vector< T >::const_iterator _begin
virtual iterator begin() const
an abstract class that encapsulates a list of property values to be printed out.
virtual bool notAtEnd() const
virtual bool notLTBegin() const
std::type_info const & typeOf(std::string const &name) const
boost::shared_ptr< PrinterIter > _it
virtual PrinterIter & operator++()
Class for storing generic metadata.
static PrinterFactory defaultPrinterFactory
std::vector< T >::const_iterator _end
DateTimePrinterIter(std::vector< lsst::daf::base::DateTime >::const_iterator listiter, std::vector< lsst::daf::base::DateTime >::const_iterator beginiter, std::vector< lsst::daf::base::DateTime >::const_iterator enditer)
virtual PrinterIter & operator--()=0
Interface for PropertySet class.
BoolPrinterList(const lsst::daf::base::PropertySet &prop, const std::string &name)
bool operator!=(const BaseTmplPrinterIter &that) const
virtual bool notLTBegin() const
TmplPrinterList(const lsst::daf::base::PropertySet &prop, const std::string &name)
virtual size_t valueCount() const =0
virtual bool notAtEnd() const
BaseTmplPrinterList(const lsst::daf::base::PropertySet &prop, const std::string &name)
WrappedPrinterIter(boost::shared_ptr< PrinterIter > iter)
virtual iterator last() const
virtual ~DateTimePrinterIter()
virtual PrinterList::iterator last() const
virtual bool notAtEnd() const =0
virtual PrinterList::iterator begin() const
virtual PrinterIter & operator++()
virtual ~BoolPrinterList()
a wrapper PrinterIter class that hides the polymorphic (and possibly templatized) nature of an underl...
const std::string operator*() const
virtual bool notLTBegin() const =0
virtual ~BoolPrinterIter()
a factory used to create PrinterList instances to be used by a PropertyPrinter instance.
virtual ~BaseTmplPrinterIter()