From e1a63732f796c8057751cb7f8ac98a595b91692e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 Jan 2013 03:17:47 +0000 Subject: Bulk reformat. git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4929 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/ClientModel.cpp | 15 +++++++++------ src/client/ClientModel.hpp | 11 ++++++++--- src/client/ClientObject.cpp | 13 ++++++------- src/client/ClientObject.hpp | 17 +++++++++++------ 4 files changed, 34 insertions(+), 22 deletions(-) (limited to 'src/client') diff --git a/src/client/ClientModel.cpp b/src/client/ClientModel.cpp index 4af3a37..c945de7 100644 --- a/src/client/ClientModel.cpp +++ b/src/client/ClientModel.cpp @@ -24,11 +24,12 @@ SharedPtr ClientModel::find(uint64_t id) { SharedPtr key(new ClientObjectKey(id)); - Objects::iterator i = _objects.find(key); - if (i != _objects.end()) + Objects::iterator i = _objects.find(key); + if (i != _objects.end()) { return *i; - else + } else { return SharedPtr(); + } } void @@ -42,9 +43,10 @@ void ClientModel::erase_object(uint64_t id) { SharedPtr key(new ClientObjectKey(id)); - Objects::iterator i = _objects.find(key); - if (i == _objects.end()) + Objects::iterator i = _objects.find(key); + if (i == _objects.end()) { return; + } signal_erase_object.emit(*i); (*i)->set_view(SharedPtr()); @@ -55,8 +57,9 @@ void ClientModel::property(uint64_t id, URIInt key, const Raul::Atom& value) { SharedPtr object = find(id); - if (object) + if (object) { object->set(key, value); + } } } diff --git a/src/client/ClientModel.hpp b/src/client/ClientModel.hpp index de3b8ea..07500db 100644 --- a/src/client/ClientModel.hpp +++ b/src/client/ClientModel.hpp @@ -24,12 +24,15 @@ #include "ClientObject.hpp" -namespace Raul { class Atom; } +namespace Raul { +class Atom; +} namespace Machina { namespace Client { -class ClientModel { +class ClientModel +{ public: void new_object(SharedPtr object); void erase_object(uint64_t id); @@ -42,9 +45,11 @@ public: private: struct ClientObjectComparator { - inline bool operator()(SharedPtr lhs, SharedPtr rhs) const { + inline bool operator()(SharedPtr lhs, + SharedPtr rhs) const { return lhs->id() < rhs->id(); } + }; typedef std::set, ClientObjectComparator> Objects; diff --git a/src/client/ClientObject.cpp b/src/client/ClientObject.cpp index c6d254b..7f7eb9e 100644 --- a/src/client/ClientObject.cpp +++ b/src/client/ClientObject.cpp @@ -24,14 +24,12 @@ namespace Client { ClientObject::ClientObject(uint64_t id) : _id(id) -{ -} +{} ClientObject::ClientObject(const ClientObject& copy, uint64_t id) : _id(id) , _properties(copy._properties) -{ -} +{} void ClientObject::set(URIInt key, const Raul::Atom& value) @@ -43,12 +41,13 @@ ClientObject::set(URIInt key, const Raul::Atom& value) const Raul::Atom& ClientObject::get(URIInt key) const { - static const Raul::Atom null_atom; + static const Raul::Atom null_atom; Properties::const_iterator i = _properties.find(key); - if (i != _properties.end()) + if (i != _properties.end()) { return i->second; - else + } else { return null_atom; + } } } diff --git a/src/client/ClientObject.hpp b/src/client/ClientObject.hpp index 658d603..994a5ba 100644 --- a/src/client/ClientObject.hpp +++ b/src/client/ClientObject.hpp @@ -30,7 +30,8 @@ namespace Machina { namespace Client { -class ClientObject { +class ClientObject +{ public: ClientObject(uint64_t id); ClientObject(const ClientObject& copy, uint64_t id); @@ -42,7 +43,8 @@ public: sigc::signal signal_property; - class View { + class View + { public: virtual ~View() {} }; @@ -50,8 +52,8 @@ public: typedef std::map Properties; const Properties& properties() { return _properties; } - SharedPtr view() const { return _view; } - void set_view(SharedPtr view) { _view = view; } + SharedPtr view() const { return _view; } + void set_view(SharedPtr view) { _view = view; } private: uint64_t _id; @@ -60,9 +62,12 @@ private: Properties _properties; }; -class ClientObjectKey : public ClientObject { +class ClientObjectKey + : public ClientObject +{ public: - ClientObjectKey(uint64_t id) : ClientObject(id) {} + ClientObjectKey(uint64_t id) + : ClientObject(id) {} }; } -- cgit v1.2.1