25 #ifndef LSST_DAF_BASE_PROPERTYLIST
26 #define LSST_DAF_BASE_PROPERTYLIST
62 #include "boost/any.hpp"
63 #include "boost/shared_ptr.hpp"
69 namespace persistence {
70 class PropertyListFormatter;
77 #pragma warning (push)
78 #pragma warning (disable: 444)
84 typedef boost::shared_ptr<PropertyList>
Ptr;
85 typedef boost::shared_ptr<PropertyList const>
ConstPtr;
96 template <
typename T> T
get(std::string
const&
name)
const;
100 T
get(std::string
const&
name, T
const& defaultValue)
const;
102 template <
typename T>
108 std::list<std::string>::const_iterator
begin(
void)
const;
109 std::list<std::string>::const_iterator
end(
void)
const;
112 virtual std::string
toString(
bool topLevelOnly =
false,
113 std::string
const& indent =
"")
const;
116 template <
typename T>
void set(
117 std::string
const&
name, T
const& value,
bool inPlace=
true);
121 template <
typename T>
void set(
122 std::string
const&
name, std::vector<T>
const& value,
125 std::string
const&
name,
char const* value,
bool inPlace=
true);
126 template <
typename T>
void add(
127 std::string
const&
name, T
const& value,
bool inPlace=
true);
128 template <
typename T>
void add(
129 std::string
const&
name, std::vector<T>
const& value,
132 std::string
const&
name,
char const* value,
bool inPlace=
true);
134 template <
typename T>
void set(
135 std::string
const&
name, T
const& value,
136 std::string
const& comment,
bool inPlace=
true);
137 template <
typename T>
void set(
138 std::string
const&
name, std::vector<T>
const& value,
139 std::string
const& comment,
bool inPlace=
true);
141 std::string
const&
name,
char const* value,
142 std::string
const& comment,
bool inPlace=
true);
143 template <
typename T>
void add(
144 std::string
const&
name, T
const& value,
145 std::string
const& comment,
bool inPlace=
true);
146 template <
typename T>
void add(
147 std::string
const&
name, std::vector<T>
const& value,
148 std::string
const& comment,
bool inPlace=
true);
150 std::string
const&
name,
char const* value,
151 std::string
const& comment,
bool inPlace=
true);
153 template <
typename T>
void set(
154 std::string
const&
name, T
const& value,
155 char const* comment,
bool inPlace=
true) {
156 set(name, value, std::string(comment), inPlace);
158 template <
typename T>
void set(
159 std::string
const&
name, std::vector<T>
const& value,
160 char const* comment,
bool inPlace=
true) {
161 set(name, value, std::string(comment), inPlace);
164 std::string
const&
name,
char const* value,
165 char const* comment,
bool inPlace=
true) {
166 set(name, value, std::string(comment), inPlace);
168 template <
typename T>
void add(
169 std::string
const&
name, T
const& value,
170 char const* comment,
bool inPlace=
true) {
171 add(name, value, std::string(comment), inPlace);
173 template <
typename T>
void add(
174 std::string
const&
name, std::vector<T>
const& value,
175 char const* comment,
bool inPlace=
true) {
176 add(name, value, std::string(comment), inPlace);
179 std::string
const&
name,
char const* value,
180 char const* comment,
bool inPlace=
true) {
181 add(name, value, std::string(comment), inPlace);
185 std::string
const&
name) {
186 copy(dest, source, name,
true);
193 std::string
const&
name,
bool inPlace);
196 virtual void remove(std::string
const&
name);
201 typedef std::tr1::unordered_map<std::
string, std::
string>
CommentMap;
203 virtual
void _set(std::
string const&
name,
204 boost::shared_ptr< std::vector<boost::
any> > vp);
205 virtual
void _moveToEnd(std::
string const& name);
207 std::
string const& name, std::
string const& comment,
bool inPlace);
214 #pragma warning (pop)
boost::shared_ptr< PropertyList const > ConstPtr
void add(std::string const &name, std::vector< T > const &value, char const *comment, bool inPlace=true)
std::string const & getComment(std::string const &name) const
table::Key< std::string > name
std::tr1::unordered_map< std::string, std::string > CommentMap
std::vector< T > getArray(std::string const &name) const
Class for storing ordered metadata with comments.
virtual void copy(std::string const &dest, PropertySet::ConstPtr source, std::string const &name)
boost::shared_ptr< PropertySet > Ptr
void set(std::string const &name, char const *value, char const *comment, bool inPlace=true)
boost::shared_ptr< PropertySet const > ConstPtr
std::list< std::string >::const_iterator begin(void) const
virtual void _moveToEnd(std::string const &name)
void set(std::string const &name, T const &value, bool inPlace=true)
bool any(CoordinateExpr< N > const &expr)
Return true if any elements are true.
std::list< std::string > _order
boost::shared_ptr< PropertyList > Ptr
virtual void _set(std::string const &name, boost::shared_ptr< std::vector< boost::any > > vp)
virtual ~PropertyList(void)
std::vector< std::string > getOrderedNames(void) const
std::list< std::string >::const_iterator end(void) const
void add(std::string const &name, char const *value, char const *comment, bool inPlace=true)
#define LSST_PERSIST_FORMATTER(formatter...)
virtual std::string toString(bool topLevelOnly=false, std::string const &indent="") const
void add(std::string const &name, T const &value, char const *comment, bool inPlace=true)
Class for storing generic metadata.
virtual void _commentOrderFix(std::string const &name, std::string const &comment, bool inPlace)
void set(std::string const &name, std::vector< T > const &value, char const *comment, bool inPlace=true)
Interface for PropertySet class.
void add(std::string const &name, T const &value, bool inPlace=true)
virtual PropertySet::Ptr deepCopy(void) const
void set(std::string const &name, T const &value, char const *comment, bool inPlace=true)
virtual void combine(PropertySet::ConstPtr source)