25 #ifndef LSST_DAF_BASE_PROPERTYSET
26 #define LSST_DAF_BASE_PROPERTYSET
49 #include <unordered_map>
52 #include "boost/any.hpp"
64 #pragma warning(disable : 444)
98 virtual
Ptr deepCopy() const;
106 size_t nameCount(
bool topLevelOnly = true) const;
115 std::vector<
std::
string> names(
bool topLevelOnly = true) const;
120 std::vector<
std::
string> paramNames(
bool topLevelOnly = true) const;
125 std::vector<
std::
string> propertySetNames(
bool topLevelOnly = true) const;
133 bool exists(
std::
string const& name) const;
141 bool isArray(
std::
string const& name) const;
149 bool isPropertySetPtr(
std::
string const& name) const;
157 bool isUndefined(
std::
string const& name) const;
165 size_t valueCount() const;
173 size_t valueCount(
std::
string const& name) const;
184 std::type_info const& typeOf(
std::
string const& name) const;
191 template <typename T>
192 static
std::type_info const& typeOfT();
207 template <typename T>
208 T get(
std::
string const& name) const;
222 template <typename T>
223 T get(
std::
string const& name, T const& defaultValue) const;
236 template <typename T>
237 std::vector<T> getArray(
std::
string const& name) const;
251 bool getAsBool(
std::
string const& name) const;
262 int getAsInt(
std::
string const& name) const;
275 int64_t getAsInt64(
std::
string const& name) const;
286 uint64_t getAsUInt64(
std::
string const& name) const;
297 double getAsDouble(
std::
string const& name) const;
310 std::
string getAsString(
std::
string const& name) const;
341 virtual
std::
string toString(
bool topLevelOnly = false,
std::
string const& indent = "") const;
353 template <typename T>
354 void set(
std::
string const& name, T const& value);
364 template <typename T>
365 void set(
std::
string const& name,
std::vector<T> const& value);
374 void set(
std::
string const& name,
char const* value);
385 template <typename T>
386 void add(
std::
string const& name, T const& value);
399 template <typename T>
400 void add(
std::
string const& name,
std::vector<T> const& value);
412 void add(
std::
string const& name,
char const* value);
427 virtual
void copy(
std::
string const& dest,
ConstPtr source,
std::
string const& name,
428 bool asScalar = false);
451 virtual
void remove(
std::
string const& name);
463 virtual
void _set(
std::
string const& name,
std::shared_ptr<
std::vector<
boost::any> > vp);
473 virtual
void _add(
std::
string const& name,
std::shared_ptr<
std::vector<
boost::any> > vp);
476 virtual
std::
string _format(
std::
string const& name) const;
488 AnyMap::iterator _find(
std::
string const& name);
496 AnyMap::const_iterator _find(
std::
string const& name) const;
506 virtual
void _findOrInsert(
std::
string const& name,
std::shared_ptr<
std::vector<
boost::any> > vp);
507 void _cycleCheckPtrVec(
std::vector<
Ptr> const& v,
std::
string const& name);
508 void _cycleCheckAnyVec(
std::vector<
boost::any> const& v,
std::
string const& name);
509 void _cycleCheckPtr(
Ptr const& v,
std::
string const& name);
520 void PropertySet::add<PropertySet::Ptr>(
std::string const& name, Ptr
const& value);
Interface for Persistable base class.
Base class for all persistable classes.
Class for storing generic metadata.
std::shared_ptr< PropertySet > Ptr
std::shared_ptr< PropertySet const > ConstPtr
PropertySet(bool flat=false)
Construct an empty PropertySet.
virtual ~PropertySet() noexcept
Destructor.