55 n->_comments = _comments;
64 return PropertySet::get<T>(name);
70 return PropertySet::get<T>(name, defaultValue);
75 return PropertySet::getArray<T>(name);
79 return _comments.
find(name)->second;
84 for (
auto const& name : _order) {
96 for (
auto const& name : _order) {
119 auto pl = std::dynamic_pointer_cast<PropertyList, PropertySet>(value);
121 _comments.
erase(name);
190 auto const * pl =
dynamic_cast<PropertyList const *
>(&source);
192 _comments[name] = pl->_comments.
find(name)->second;
198 auto const * pl =
dynamic_cast<PropertyList const *
>(&source);
202 for (
auto const& name : *pl) {
203 bool present = _comments.
find(name) != _comments.
end();
212 for (
auto const& name : *pl) {
213 _comments[name] = pl->_comments.
find(name)->second;
221 _comments.
erase(name);
231 if (_comments.
find(name) == _comments.
end()) {
243 _comments[name] = comment;
253#define INSTANTIATE(t) \
254 template t PropertyList::get<t>(std::string const& name) const; \
255 template t PropertyList::get<t>(std::string const& name, t const& defaultValue) const; \
256 template std::vector<t> PropertyList::getArray<t>(std::string const& name) const; \
257 template void PropertyList::set<t>(std::string const& name, t const& value); \
258 template void PropertyList::set<t>(std::string const& name, std::vector<t> const& value); \
259 template void PropertyList::add<t>(std::string const& name, t const& value); \
260 template void PropertyList::add<t>(std::string const& name, std::vector<t> const& value); \
261 template void PropertyList::set<t>(std::string const& name, t const& value, std::string const& comment); \
262 template void PropertyList::set<t>(std::string const& name, std::vector<t> const& value, \
263 std::string const& comment); \
264 template void PropertyList::add<t>(std::string const& name, t const& value, std::string const& comment); \
265 template void PropertyList::add<t>(std::string const& name, std::vector<t> const& value, \
266 std::string const& comment); \
267 template void PropertyList::set<t>(std::string const& name, t const& value, char const* comment); \
268 template void PropertyList::set<t>(std::string const& name, std::vector<t> const& value, \
269 char const* comment); \
270 template void PropertyList::add<t>(std::string const& name, t const& value, char const* comment); \
271 template void PropertyList::add<t>(std::string const& name, std::vector<t> const& value, \
272 char const* comment);
276INSTANTIATE(
signed char)
277INSTANTIATE(
unsigned char)
279INSTANTIATE(
unsigned short)
281INSTANTIATE(
unsigned int)
283INSTANTIATE(
unsigned long)
284INSTANTIATE(
long long)
285INSTANTIATE(
unsigned long long)
Interface for DateTime class.
Class for handling dates/times, including MJD, UTC, and TAI.
Class for storing ordered metadata with comments.
std::list< std::string >::const_iterator end() const
End iterator over the list of property names, in the order they were added.
PropertyList()
Construct an empty PropertyList.
virtual void combine(PropertySet const &source)
Append all value vectors from the source to their corresponding properties.
void set(std::string const &name, T const &value)
Replace all values for a property name (possibly hierarchical) with a new scalar value.
T get(std::string const &name) const
Get the last value for a property name (possibly hierarchical).
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 _set(std::string const &name, std::shared_ptr< std::vector< std::any > > vp)
std::string const & getComment(std::string const &name) const
Get the comment for a string property name (possibly hierarchical).
std::vector< T > getArray(std::string const &name) const
Get the vector of values for a property name (possibly hierarchical).
std::vector< std::string > getOrderedNames() const
Get the list of property names, in the order they were added.
virtual void remove(std::string const &name)
Remove all values for a property name (possibly hierarchical).
virtual ~PropertyList() noexcept
Destructor.
virtual void _moveToEnd(std::string const &name)
virtual void copy(std::string const &dest, PropertySet const &source, std::string const &name, bool asScalar=false)
Replace a single value vector in the destination with one from the source.
virtual void _commentOrderFix(std::string const &name, std::string const &comment)
virtual std::string toString(bool topLevelOnly=false, std::string const &indent="") const
Generate a string representation of the PropertySet.
std::list< std::string >::const_iterator begin() const
Begin iterator over the list of property names, in the order they were added.
Class for storing generic metadata.
virtual void _set(std::string const &name, std::shared_ptr< std::vector< std::any > > vp)
virtual void remove(std::string const &name)
Remove all values for a property name (possibly hierarchical).
virtual std::string _format(std::string const &name) const
void set(std::string const &name, T const &value)
Replace all values for a property name (possibly hierarchical) with a new scalar value.
virtual void copy(std::string const &dest, PropertySet const &source, std::string const &name, bool asScalar=false)
Replace a single value vector in the destination with one from the source.
virtual void combine(PropertySet const &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).
virtual std::shared_ptr< PropertySet > deepCopy() const
Make a deep copy of the PropertySet and all of its contents.
std::vector< std::string > paramNames(bool topLevelOnly=true) const
A variant of names that excludes the names of subproperties.