47 namespace pexExcept = lsst::pex::exceptions;
92 return PropertySet::get<T>(
name);
104 template <
typename T>
106 return PropertySet::get<T>(
name, defaultValue);
117 template <
typename T>
119 return PropertySet::getArray<T>(
name);
129 std::string
const&
name)
const {
134 std::vector<std::string> v;
135 for (std::list<std::string>::const_iterator i =
_order.begin();
142 std::list<std::string>::const_iterator
147 std::list<std::string>::const_iterator
159 std::string
const& indent)
const {
161 for (std::list<std::string>::const_iterator i =
_order.begin();
164 std::string
const& comment =
_comments.find(*i)->second;
165 if (comment.size()) {
166 s <<
"// " << comment << std::endl;
187 template <
typename T>
189 std::string
const&
name, T
const& value,
bool inPlace) {
203 vector<string>
names = value->paramNames(
false);
204 for (vector<string>::const_iterator i = names.begin();
205 i != names.end(); ++i) {
223 std::string
const&
name,
char const* value,
bool inPlace) {
224 set(name,
string(value), inPlace);
237 template <
typename T>
239 std::string
const&
name, vector<T>
const& value,
bool inPlace) {
254 template <
typename T>
256 std::string
const&
name, T
const& value,
bool inPlace) {
273 std::string
const&
name,
char const* value,
bool inPlace) {
274 add(name,
string(value), inPlace);
287 template <
typename T>
289 std::string
const&
name, vector<T>
const& value,
bool inPlace) {
308 template <
typename T>
310 std::string
const&
name, T
const& value,
311 std::string
const& comment,
bool inPlace) {
325 std::string
const&
name,
char const* value,
326 std::string
const& comment,
bool inPlace) {
327 set(name,
string(value), comment, inPlace);
338 template <
typename T>
340 std::string
const&
name, vector<T>
const& value,
341 std::string
const& comment,
bool inPlace) {
355 template <
typename T>
357 std::string
const&
name, T
const& value,
358 std::string
const& comment,
bool inPlace) {
375 std::string
const&
name,
char const* value,
376 std::string
const& comment,
bool inPlace) {
377 add(name,
string(value), comment, inPlace);
391 template <
typename T>
393 std::string
const&
name, vector<T>
const& value,
394 std::string
const& comment,
bool inPlace) {
415 std::string
const&
name,
bool inPlace) {
442 std::list<std::string> newOrder;
445 for (std::list<std::string>::const_iterator i = pl->begin();
446 i != pl->end(); ++i) {
449 newOrder.push_back(*i);
453 newOrder.push_back(*i);
460 for (std::list<std::string>::const_iterator i = pl->begin();
461 i != pl->end(); ++i) {
462 _comments[*i] = pl->_comments.find(*i)->second;
482 boost::shared_ptr< std::vector<boost::any> > vp) {
485 _comments.insert(std::make_pair(name, std::string()));
496 std::string
const&
name, std::string
const& comment,
bool inPlace) {
510 #define INSTANTIATE(t) \
511 template t PropertyList::get<t>(string const& name) const; \
512 template t PropertyList::get<t>(string const& name, t const& defaultValue) const; \
513 template vector<t> PropertyList::getArray<t>(string const& name) const; \
514 template void PropertyList::set<t>(string const& name, t const& value, bool inPlace); \
515 template void PropertyList::set<t>(string const& name, vector<t> const& value, bool inPlace); \
516 template void PropertyList::add<t>(string const& name, t const& value, bool inPlace); \
517 template void PropertyList::add<t>(string const& name, vector<t> const& value, bool inPlace); \
518 template void PropertyList::set<t>(string const& name, t const& value, string const& comment, bool inPlace); \
519 template void PropertyList::set<t>(string const& name, vector<t> const& value, string const& comment, bool inPlace); \
520 template void PropertyList::add<t>(string const& name, t const& value, string const& comment, bool inPlace); \
521 template void PropertyList::add<t>(string const& name, vector<t> const& value, string const& comment, bool inPlace); \
522 template void PropertyList::set<t>(string const& name, t const& value, char const* comment, bool inPlace); \
523 template void PropertyList::set<t>(string const& name, vector<t> const& value, char const* comment, bool inPlace); \
524 template void PropertyList::add<t>(string const& name, t const& value, char const* comment, bool inPlace); \
525 template void PropertyList::add<t>(string const& name, vector<t> const& value, char const* comment, bool inPlace);
boost::shared_ptr< PropertyList const > ConstPtr
Class for handling dates/times, including MJD, UTC, and TAI.
std::string const & getComment(std::string const &name) const
table::Key< std::string > name
std::vector< T > getArray(std::string const &name) const
virtual void remove(std::string const &name)
Class for storing ordered metadata with comments.
virtual void copy(std::string const &dest, ConstPtr source, std::string const &name)
virtual void copy(std::string const &dest, PropertySet::ConstPtr source, std::string const &name)
boost::shared_ptr< PropertySet > Ptr
Interface for PropertyList class.
boost::shared_ptr< PropertySet const > ConstPtr
T get(std::string const &name) const
std::list< std::string >::const_iterator begin(void) const
void set(std::string const &name, T const &value)
virtual void _moveToEnd(std::string const &name)
std::vector< std::string > names(bool topLevelOnly=true) const
virtual void remove(std::string const &name)
void set(std::string const &name, T const &value, bool inPlace=true)
std::list< std::string > _order
virtual void combine(ConstPtr source)
boost::shared_ptr< Persistable > Ptr
virtual std::string _format(std::string const &name) const
if(width!=gim.getWidth()||height!=gim.getHeight()||x0!=gim.getX0()||y0!=gim.getY0())
virtual void _set(std::string const &name, boost::shared_ptr< std::vector< boost::any > > vp)
virtual ~PropertyList(void)
std::vector< std::string > getOrderedNames(void) const
Interface for DateTime class.
std::list< std::string >::const_iterator end(void) const
virtual std::string toString(bool topLevelOnly=false, std::string const &indent="") const
Class for storing generic metadata.
virtual Ptr deepCopy(void) const
virtual void _commentOrderFix(std::string const &name, std::string const &comment, bool inPlace)
virtual void _set(std::string const &name, boost::shared_ptr< std::vector< boost::any > > vp)
Base class for all persistable classes.
void add(std::string const &name, T const &value, bool inPlace=true)
void add(std::string const &name, T const &value)
virtual PropertySet::Ptr deepCopy(void) const
virtual void combine(PropertySet::ConstPtr source)