2 Copyright (C) 2010 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __pbd_property_list_h__
21 #define __pbd_property_list_h__
25 #include "pbd/property_basics.h"
30 class PropertyList : public std::map<PropertyID, PropertyBase*>
35 virtual ~PropertyList();
37 void add_history_state (XMLNode* before);
39 /** Add a property (of some kind) to the list. Used when
40 constructing PropertyList's that describe a change/operation.
42 bool add (PropertyBase* prop);
44 /* Code that is constructing a property list for use
45 * in setting the state of an object uses this.
47 * Defined below, once we have Property<T>
49 template<typename T, typename V> bool add (PropertyDescriptor<T> pid, const V& v);
55 /** A variant of PropertyList that does not delete its
56 * property list in its destructor. Objects with their
57 * own Properties store them in an OwnedPropertyList
58 * to avoid having them deleted at the wrong time.
60 class OwnedPropertyList : public PropertyList
65 /* Classes that own property lists use this to add their
66 * property members to their plists. Note that it takes
67 * a reference argument rather than a pointer like
68 * one of the add() methods in PropertyList.
70 bool add (PropertyBase& p);
75 #endif /* __pbd_property_list_h__ */