LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
|
an class for printing the values associated with a name in a PropertySet. More...
#include <PropertyPrinter.h>
Public Types | |
typedef PrinterList::iterator | iterator |
Public Member Functions | |
PropertyPrinter (const lsst::daf::base::PropertySet &prop, const std::string &name, const PrinterFactory &fact=defaultPrinterFactory) | |
iterator | begin () |
iterator | last () |
size_t | valueCount () |
Static Public Attributes | |
static PrinterFactory | defaultPrinterFactory |
Private Attributes | |
boost::shared_ptr< PrinterList > | _list |
an class for printing the values associated with a name in a PropertySet.
This class is vital if one needs to print out all the values in a PropertySet without knowing the data types associated with the names. In particular, it gives one the ability to write each value associated with a name individually and it any order. A typical use looks like this:
A PropertyPrinter is constructed for a particular name found in the PropertySet. (If a property with that name doesn't exist, a pex::exceptions::NotFoundError is thrown.) The PropertyPrinter is wrapped around the array of values associated with the name. One can get an Iterator for the values and send each one to a stream.
A PropertyPrinter can only print out property types that it has been configured for via the PrinterFactory instance that is passed in during construction. If one is not provided, a default is set which supports the following types:
* short char float * int signed char double * long unsigned char bool * long long string DateTime *
Other types can be supported by passing the name of factory function that can create a printer instance to a PrinterFactory that will eventually be used with a PropertyPrinter (see PrinterFactory for details.
Definition at line 451 of file PropertyPrinter.h.
the iterator type used for iterating through values.
Definition at line 457 of file PropertyPrinter.h.
lsst::pex::logging::PropertyPrinter::PropertyPrinter | ( | const lsst::daf::base::PropertySet & | prop, |
const std::string & | name, | ||
const PrinterFactory & | fact = defaultPrinterFactory |
||
) |
create the PropertyPrinter for a given name
iterator lsst::pex::logging::PropertyPrinter::begin | ( | ) |
return an iterator set at the start of the list of values
iterator lsst::pex::logging::PropertyPrinter::last | ( | ) |
return an iterator set at the last of the list of values
|
inline |
return the number of values associated with the property
Definition at line 485 of file PropertyPrinter.h.
|
private |
Definition at line 489 of file PropertyPrinter.h.
|
static |
the default look-up table for creating iterators for different types. Users are allowsd add new printers. See PropertyFactory for more details.
Definition at line 464 of file PropertyPrinter.h.