61 n->_comments = _comments;
69 return PropertySet::get<T>(name);
74 return PropertySet::get<T>(name, defaultValue);
79 return PropertySet::getArray<T>(name);
84 return _comments.
find(name)->second;
90 i != _order.
end(); ++i) {
98 return _order.
begin();
110 i != _order.
end(); ++i) {
113 if (comment.
size()) {
128 template <
typename T>
138 _comments.
erase(name);
142 i != names.
end(); ++i) {
144 _commentOrderFix(name +
"." + *i, pl->getComment(*i));
154 template <
typename T>
160 template <
typename T>
168 add(name,
string(value));
171 template <
typename T>
181 template <
typename T>
186 _commentOrderFix(name, comment);
192 set(name,
string(value), comment);
195 template <
typename T>
200 _commentOrderFix(name, comment);
202 template <
typename T>
207 _commentOrderFix(name, comment);
213 add(name,
string(value), comment);
216 template <
typename T>
221 _commentOrderFix(name, comment);
236 _comments[name] = pl->_comments.find(name)->second;
248 i != pl->end(); ++i) {
249 bool present = _comments.
find(*i) != _comments.
end();
259 i != pl->end(); ++i) {
260 _comments[*i] = pl->_comments.find(*i)->second;
267 _comments.
erase(name);
278 if (_comments.
find(name) == _comments.
end()) {
284 void PropertyList::_moveToEnd(
std::string const& name) {
289 void PropertyList::_commentOrderFix(
291 _comments[name] = comment;
301 #define INSTANTIATE(t) \ 302 template t PropertyList::get<t>(string const& name) const; \ 303 template t PropertyList::get<t>(string const& name, t const& defaultValue) const; \ 304 template vector<t> PropertyList::getArray<t>(string const& name) const; \ 305 template void PropertyList::set<t>(string const& name, t const& value); \ 306 template void PropertyList::set<t>(string const& name, vector<t> const& value); \ 307 template void PropertyList::add<t>(string const& name, t const& value); \ 308 template void PropertyList::add<t>(string const& name, vector<t> const& value); \ 309 template void PropertyList::set<t>(string const& name, t const& value, string const& comment); \ 310 template void PropertyList::set<t>(string const& name, vector<t> const& value, string const& comment); \ 311 template void PropertyList::add<t>(string const& name, t const& value, string const& comment); \ 312 template void PropertyList::add<t>(string const& name, vector<t> const& value, string const& comment); \ 313 template void PropertyList::set<t>(string const& name, t const& value, char const* comment); \ 314 template void PropertyList::set<t>(string const& name, vector<t> const& value, char const* comment); \ 315 template void PropertyList::add<t>(string const& name, t const& value, char const* comment); \ 316 template void PropertyList::add<t>(string const& name, vector<t> const& value, char const* comment); 320 INSTANTIATE(
signed char)
321 INSTANTIATE(
unsigned char)
323 INSTANTIATE(
unsigned short)
325 INSTANTIATE(
unsigned int)
327 INSTANTIATE(
unsigned long)
328 INSTANTIATE(
long long)
329 INSTANTIATE(
unsigned long long)
virtual Ptr deepCopy(void) const
Make a deep copy of the PropertySet and all of its contents.
std::list< std::string >::const_iterator end(void) const
End iterator over the list of property names, in the order they were added.
virtual std::string _format(std::string const &name) const
std::list< std::string >::const_iterator begin(void) const
Begin iterator over the list of property names, in the order they were added.
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 PropertySet.
virtual void remove(std::string const &name)
Remove all values for a property name (possibly hierarchical).
Class for storing ordered metadata with comments.
virtual void combine(PropertySet::ConstPtr source)
Append 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).
void set(std::string const &name, T const &value)
Replace all values for a property name (possibly hierarchical) with a new scalar value.
PropertyList(void)
Construct an empty PropertyList.
void set(std::string const &name, T const &value)
Replace all values for a property name (possibly hierarchical) with a new scalar value.
std::vector< T > getArray(std::string const &name) const
Get the vector of values for a property name (possibly hierarchical).
virtual void remove(std::string const &name)
Remove all values for a property name (possibly hierarchical).
virtual void copy(std::string const &dest, ConstPtr source, std::string const &name, bool asScalar=false)
Replace a single value vector in the destination with one from the source.
virtual PropertySet::Ptr deepCopy(void) const
Make a deep copy of the PropertyList and all of its contents.
virtual void combine(ConstPtr source)
Append all value vectors from the source to their corresponding properties.
void add(std::string const &name, T const &value)
Append 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
Get the list of property names, in the order they were added.
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)
Class for storing generic metadata.
void add(std::string const &name, T const &value)
Append a single value to the vector of values for a property name (possibly hierarchical).
virtual void copy(std::string const &dest, PropertySet::ConstPtr source, std::string const &name, bool asScalar=false)
Replace a single value vector in the destination with one from the source.