76 n->_comments = _comments;
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);
130 return _comments.
find(name)->second;
136 i != _order.
end(); ++i) {
144 return _order.
begin();
162 i != _order.
end(); ++i) {
165 if (comment.
size()) {
186 template <
typename T>
196 _comments.
erase(name);
200 i != names.
end(); ++i) {
202 _commentOrderFix(name +
"." + *i, pl->getComment(*i));
224 template <
typename T>
237 template <
typename T>
253 add(name,
string(value));
265 template <
typename T>
282 template <
typename T>
287 _commentOrderFix(name, comment);
300 set(name,
string(value), comment);
310 template <
typename T>
315 _commentOrderFix(name, comment);
326 template <
typename T>
331 _commentOrderFix(name, comment);
347 add(name,
string(value), comment);
360 template <
typename T>
365 _commentOrderFix(name, comment);
389 _comments[name] = pl->_comments.find(name)->second;
409 i != pl->end(); ++i) {
410 bool present = _comments.
find(*i) != _comments.
end();
420 i != pl->end(); ++i) {
421 _comments[*i] = pl->_comments.find(*i)->second;
432 _comments.
erase(name);
443 if (_comments.
find(name) == _comments.
end()) {
449 void PropertyList::_moveToEnd(
std::string const& name) {
454 void PropertyList::_commentOrderFix(
456 _comments[name] = comment;
466 #define INSTANTIATE(t) \ 467 template t PropertyList::get<t>(string const& name) const; \ 468 template t PropertyList::get<t>(string const& name, t const& defaultValue) const; \ 469 template vector<t> PropertyList::getArray<t>(string const& name) const; \ 470 template void PropertyList::set<t>(string const& name, t const& value); \ 471 template void PropertyList::set<t>(string const& name, vector<t> const& value); \ 472 template void PropertyList::add<t>(string const& name, t const& value); \ 473 template void PropertyList::add<t>(string const& name, vector<t> const& value); \ 474 template void PropertyList::set<t>(string const& name, t const& value, string const& comment); \ 475 template void PropertyList::set<t>(string const& name, vector<t> const& value, string const& comment); \ 476 template void PropertyList::add<t>(string const& name, t const& value, string const& comment); \ 477 template void PropertyList::add<t>(string const& name, vector<t> const& value, string const& comment); \ 478 template void PropertyList::set<t>(string const& name, t const& value, char const* comment); \ 479 template void PropertyList::set<t>(string const& name, vector<t> const& value, char const* comment); \ 480 template void PropertyList::add<t>(string const& name, t const& value, char const* comment); \ 481 template void PropertyList::add<t>(string const& name, vector<t> const& value, char const* comment); 485 INSTANTIATE(
signed char)
486 INSTANTIATE(
unsigned char)
488 INSTANTIATE(
unsigned short)
490 INSTANTIATE(
unsigned int)
492 INSTANTIATE(
unsigned long)
493 INSTANTIATE(
long long)
494 INSTANTIATE(
unsigned long long)
virtual Ptr deepCopy(void) const
Copy the PropertySet and all of its contents.
std::list< std::string >::const_iterator end(void) const
virtual std::string _format(std::string const &name) const
std::list< std::string >::const_iterator begin(void) const
Class for handling dates/times, including MJD, UTC, and TAI.
virtual std::string toString(bool topLevelOnly=false, std::string const &indent="") const
Generate a string representation of the PropertyList.
virtual void remove(std::string const &name)
Removes all values for a property name (possibly hierarchical).
Class for storing ordered metadata with comments.
virtual void copy(std::string const &dest, ConstPtr source, std::string const &name)
Replaces a single value vector in the destination with one from the source.
virtual void combine(PropertySet::ConstPtr source)
Appends all value vectors from the source to their corresponding properties.
std::string const & getComment(std::string const &name) const
Get the comment for a string property name (possibly hierarchical).
Interface for PropertyList class.
void set(std::string const &name, T const &value)
Replace all values for a property name (possibly hierarchical) with a new value.
virtual void copy(std::string const &dest, PropertySet::ConstPtr source, std::string const &name)
Replaces a single value vector in the destination with one from the source.
PropertyList(void)
Constructor.
void set(std::string const &name, T const &value)
Replace all values for a property name (possibly hierarchical) with a new value.
std::vector< T > getArray(std::string const &name) const
virtual void remove(std::string const &name)
Removes all values for a property name (possibly hierarchical).
virtual PropertySet::Ptr deepCopy(void) const
Copy the PropertyList and all of its contents.
virtual void combine(ConstPtr source)
Appends all value vectors from the source to their corresponding properties.
void add(std::string const &name, T const &value)
Appends a single value to the vector of values for a property name (possibly hierarchical).
std::vector< std::string > names(bool topLevelOnly=true) const
Get the names in the PropertySet, optionally including those in subproperties.
std::vector< std::string > getOrderedNames(void) const
T dynamic_pointer_cast(T... args)
virtual ~PropertyList(void)
Destructor.
Interface for DateTime class.
T get(std::string const &name) const
Get the last value for a property name (possibly hierarchical).
virtual void _set(std::string const &name, std::shared_ptr< std::vector< boost::any > > vp)
Finds the property name (possibly hierarchical) and sets or replaces its value with the given vector ...
Class for storing generic metadata.
void add(std::string const &name, T const &value)
Appends a single value to the vector of values for a property name (possibly hierarchical).