lsst.daf.base
19.0.0-2-g4aada73
|
Go to the documentation of this file.
54 n->_comments = _comments;
63 return PropertySet::get<T>(name);
69 return PropertySet::get<T>(name, defaultValue);
74 return PropertySet::getArray<T>(name);
78 return _comments.
find(name)->second;
83 for (
auto const& name : _order) {
95 for (
auto const& name : _order) {
112 template <
typename T>
118 Ptr pl = std::dynamic_pointer_cast<PropertyList, PropertySet>(value);
120 _comments.
erase(name);
125 _commentOrderFix(name +
"." + paramName, pl->getComment(paramName));
132 template <
typename T>
137 template <
typename T>
144 template <
typename T>
152 template <
typename T>
155 _commentOrderFix(name, comment);
162 template <
typename T>
165 _commentOrderFix(name, comment);
167 template <
typename T>
170 _commentOrderFix(name, comment);
177 template <
typename T>
180 _commentOrderFix(name, comment);
189 ConstPtr pl = std::dynamic_pointer_cast<PropertyList const, PropertySet const>(source);
191 _comments[name] = pl->_comments.find(name)->second;
196 ConstPtr pl = std::dynamic_pointer_cast<PropertyList const, PropertySet const>(source);
200 for (
auto const& name : *pl) {
201 bool present = _comments.
find(name) != _comments.
end();
210 for (
auto const& name : *pl) {
211 _comments[name] = pl->_comments.
find(name)->second;
218 _comments.
erase(name);
228 if (_comments.
find(name) == _comments.
end()) {
234 void PropertyList::_moveToEnd(
std::string const& name) {
240 _comments[name] = comment;
250 #define INSTANTIATE(t) \
251 template t PropertyList::get<t>(std::string const& name) const; \
252 template t PropertyList::get<t>(std::string const& name, t const& defaultValue) const; \
253 template std::vector<t> PropertyList::getArray<t>(std::string const& name) const; \
254 template void PropertyList::set<t>(std::string const& name, t const& value); \
255 template void PropertyList::set<t>(std::string const& name, std::vector<t> const& value); \
256 template void PropertyList::add<t>(std::string const& name, t const& value); \
257 template void PropertyList::add<t>(std::string const& name, std::vector<t> const& value); \
258 template void PropertyList::set<t>(std::string const& name, t const& value, std::string const& comment); \
259 template void PropertyList::set<t>(std::string const& name, std::vector<t> const& value, \
260 std::string const& comment); \
261 template void PropertyList::add<t>(std::string const& name, t const& value, std::string const& comment); \
262 template void PropertyList::add<t>(std::string const& name, std::vector<t> const& value, \
263 std::string const& comment); \
264 template void PropertyList::set<t>(std::string const& name, t const& value, char const* comment); \
265 template void PropertyList::set<t>(std::string const& name, std::vector<t> const& value, \
266 char const* comment); \
267 template void PropertyList::add<t>(std::string const& name, t const& value, char const* comment); \
268 template void PropertyList::add<t>(std::string const& name, std::vector<t> const& value, \
269 char const* comment);
273 INSTANTIATE(
signed char)
274 INSTANTIATE(
unsigned char)
276 INSTANTIATE(
unsigned short)
278 INSTANTIATE(
unsigned int)
280 INSTANTIATE(
unsigned long)
281 INSTANTIATE(
long long)
282 INSTANTIATE(
unsigned long long)
285 INSTANTIATE(nullptr_t)
288 INSTANTIATE(DateTime)
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).
std::list< std::string >::const_iterator end() const
End iterator over the list of property names, in the order they were added.
std::shared_ptr< Persistable > Ptr
virtual std::string _format(std::string const &name) const
void add(std::string const &name, T const &value)
Append a single value to the vector of values for a property name (possibly hierarchical).
Interface for DateTime class.
Class for storing ordered metadata with comments.
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.
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)
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::list< std::string >::const_iterator begin() const
Begin iterator over the list of property names, in the order they were added.
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::ConstPtr source, std::string const &name, bool asScalar=false)
Replace a single value vector in the destination with one from the source.
std::vector< std::string > paramNames(bool topLevelOnly=true) const
A variant of names that excludes the names of subproperties.
virtual void remove(std::string const &name)
Remove all values for a property name (possibly hierarchical).
std::vector< T > getArray(std::string const &name) const
Get the vector of values for a property name (possibly hierarchical).
PropertyList()
Construct an empty PropertyList.
virtual std::string toString(bool topLevelOnly=false, std::string const &indent="") const
Generate a string representation of the PropertySet.
Class for storing generic metadata.
virtual ~PropertyList() noexcept
Destructor.
virtual void remove(std::string const &name)
Remove all values for a property name (possibly hierarchical).
virtual void combine(ConstPtr source)
Append all value vectors from the source to their corresponding properties.
std::vector< std::string > getOrderedNames() const
Get the list of property names, in the order they were added.
virtual Ptr deepCopy() const
Make a deep copy of the PropertySet and all of its contents.
void set(std::string const &name, T const &value)
Replace all values for a property name (possibly hierarchical) with a new scalar value.