summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/GraphObject.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-09-13 06:11:25 +0000
committerDavid Robillard <d@drobilla.net>2006-09-13 06:11:25 +0000
commite5675ebfeb93175e16762d0a078bd51d15d05f63 (patch)
tree189249ed9014e4c482cfaed0d6af28ced68570ca /src/libs/engine/GraphObject.h
parent23b7568ab7a87a79c186b8ddf3d3db4f1f934b06 (diff)
downloadingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.tar.gz
ingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.tar.bz2
ingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.zip
Heavy-duty redesign of client library and GUI (now fully signal driven with clean Model/View separation).
Smarter, centralized window creation/management (should make window unification easy (panes?)). Typed metadata system, no more fugly string conversion of floats. Supports OSC fundamental types string, int, float, blob for now (though blob isn't working over the wire yet). git-svn-id: http://svn.drobilla.net/lad/ingen@131 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/GraphObject.h')
-rw-r--r--src/libs/engine/GraphObject.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/libs/engine/GraphObject.h b/src/libs/engine/GraphObject.h
index 3b0c27b1..4f72a2e6 100644
--- a/src/libs/engine/GraphObject.h
+++ b/src/libs/engine/GraphObject.h
@@ -23,8 +23,9 @@
#include <cassert>
#include "MaidObject.h"
#include "util/Path.h"
+#include "util/Atom.h"
#include "types.h"
-using std::string; using std::map;
+using std::string;
namespace Ingen {
@@ -45,6 +46,8 @@ class ObjectStore;
class GraphObject : public MaidObject
{
public:
+ typedef std::map<string, Atom> MetadataMap;
+
GraphObject(GraphObject* parent, const string& name)
: _parent(parent), _name(name)
{
@@ -67,16 +70,16 @@ public:
assert(_name.find("/") == string::npos);
}
- void set_metadata(const string& key, const string& value)
+ void set_metadata(const string& key, const Atom& value)
{ _metadata[key] = value; }
- const string& get_metadata(const string& key) {
- static const string empty_string = "";
- map<string, string>::iterator i = _metadata.find(key);
- return (i != _metadata.end()) ? (*i).second : empty_string;
+ const Atom& get_metadata(const string& key) {
+ static Atom null_atom;
+ MetadataMap::iterator i = _metadata.find(key);
+ return (i != _metadata.end()) ? (*i).second : null_atom;
}
- const map<string, string>& metadata() const { return _metadata; }
+ const MetadataMap& metadata() const { return _metadata; }
/** Patch and Node override this to recursively add their children. */
@@ -104,7 +107,7 @@ private:
GraphObject(const GraphObject&);
GraphObject& operator=(const GraphObject& copy);
- map<string, string> _metadata;
+ MetadataMap _metadata;
};