From 21365044f63e70deb2e8bd0685349aad6ea14e85 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 10 Jan 2011 23:50:45 +0000 Subject: Add missing files. git-svn-id: http://svn.drobilla.net/lad/trunk/machina@2824 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/ClientModel.hpp | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/client/ClientModel.hpp (limited to 'src/client/ClientModel.hpp') diff --git a/src/client/ClientModel.hpp b/src/client/ClientModel.hpp new file mode 100644 index 0000000..49f14a5 --- /dev/null +++ b/src/client/ClientModel.hpp @@ -0,0 +1,57 @@ +/* This file is part of Machina. + * Copyright (C) 2010 David Robillard + * + * Machina 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 3 of the License, or + * (at your option) any later version. + * + * Machina 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 more details. + * + * You should have received a copy of the GNU General Public License + * along with Machina. If not, see . + */ + +#ifndef MACHINA_CLIENTMODEL_HPP +#define MACHINA_CLIENTMODEL_HPP + +#include + +#include + +#include "ClientObject.hpp" + +namespace Raul { class Atom; } + +namespace Machina { +namespace Client { + +class ClientModel { +public: + void new_object(SharedPtr object); + void erase_object(uint64_t id); + void property(uint64_t id, URIInt key, const Raul::Atom& value); + + SharedPtr find(uint64_t id); + + sigc::signal< void, SharedPtr > signal_new_object; + sigc::signal< void, SharedPtr > signal_erase_object; + +private: + struct ClientObjectComparator { + inline bool operator()(SharedPtr lhs, SharedPtr rhs) const { + return lhs->id() < rhs->id(); + } + }; + + typedef std::set, ClientObjectComparator> Objects; + Objects _objects; +}; + +} +} + +#endif // MACHINA_CLIENTMODEL_HPP -- cgit v1.2.1