From 032d526710d174b30e0c9f33ff9f7e60e99fb172 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 20 Jun 2006 21:56:12 +0000 Subject: Renamed OmObject GraphObject; Merged Port::prepare_buffers and Node::run into GraphObject::process. git-svn-id: http://svn.drobilla.net/lad/grauph@69 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/OmObject.h | 110 --------------------------------------------- 1 file changed, 110 deletions(-) delete mode 100644 src/libs/engine/OmObject.h (limited to 'src/libs/engine/OmObject.h') diff --git a/src/libs/engine/OmObject.h b/src/libs/engine/OmObject.h deleted file mode 100644 index 2f873ff5..00000000 --- a/src/libs/engine/OmObject.h +++ /dev/null @@ -1,110 +0,0 @@ -/* This file is part of Om. Copyright (C) 2006 Dave Robillard. - * - * Om is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * Om is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef OMOBJECT_H -#define OMOBJECT_H - -#include -#include -#include -#include -#include "MaidObject.h" -#include "util/Path.h" - -using std::string; using std::map; - -namespace Om { - -class Patch; -class Node; -class Port; - - -/** An object in the "synth space" of Om - Patch, Node, Port, etc. - * - * Each of these is a MaidObject and so can be deleted in a realtime safe - * way from anywhere, and they all have a map of metadata for clients to store - * arbitrary values in (which the engine puts no significance to whatsoever). - * - * \ingroup engine - */ -class OmObject : public MaidObject -{ -public: - OmObject(OmObject* parent, const string& name) - : _parent(parent), _name(name) - { - assert(parent == NULL || _name.length() > 0); - assert(parent == NULL || _name.find("/") == string::npos); - //assert(((string)path()).find("//") == string::npos); - } - - virtual ~OmObject() {} - - OmObject* parent() const { return _parent; } - - inline const string& name() const { return _name; } - - virtual void set_path(const Path& new_path) { - _name = new_path.name(); - assert(_name.find("/") == string::npos); - } - - void set_metadata(const string& key, const string& value) { _metadata[key] = value; } - const string& get_metadata(const string& key) { - static const string empty_string = ""; - map::iterator i = _metadata.find(key); - if (i != _metadata.end()) - return (*i).second; - else - return empty_string; - } - - const map& metadata() const { return _metadata; } - - inline const Path path() const { - if (_parent == NULL) - return Path(string("/").append(_name)); - else if (_parent->path() == "/") - return Path(string("/").append(_name)); - else - return Path(_parent->path() +"/"+ _name); - } - - /** Patch and Node override this to recursively add their children. */ - virtual void add_to_store() = 0; - - /** Patch and Node override this to recursively remove their children. */ - virtual void remove_from_store() = 0; - -protected: - OmObject() {} - - OmObject* _parent; - string _name; - -private: - // Prevent copies (undefined) - OmObject(const OmObject&); - OmObject& operator=(const OmObject& copy); - - map _metadata; -}; - - -} // namespace Om - -#endif // OMOBJECT_H -- cgit v1.2.1