diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 09:01:05 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 09:01:05 +0100 |
commit | 4d9746c828558c9f872e0aed52442863affb25d5 (patch) | |
tree | 507d7c2ba67f47d3cbbcf01a722236ff1b48426b /sinksh/sinksh_utils.h | |
parent | 9cea920b7dd51867a0be0fed2f461b6be73c103e (diff) | |
download | sink-4d9746c828558c9f872e0aed52442863affb25d5.tar.gz sink-4d9746c828558c9f872e0aed52442863affb25d5.zip |
Fromatted the whole codebase with clang-format.
clang-format -i */**{.cpp,.h}
Diffstat (limited to 'sinksh/sinksh_utils.h')
-rw-r--r-- | sinksh/sinksh_utils.h | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/sinksh/sinksh_utils.h b/sinksh/sinksh_utils.h index bc4f6e5..5f470ff 100644 --- a/sinksh/sinksh_utils.h +++ b/sinksh/sinksh_utils.h | |||
@@ -28,8 +28,7 @@ | |||
28 | 28 | ||
29 | #include "state.h" | 29 | #include "state.h" |
30 | 30 | ||
31 | namespace SinkshUtils | 31 | namespace SinkshUtils { |
32 | { | ||
33 | 32 | ||
34 | class StoreBase; | 33 | class StoreBase; |
35 | 34 | ||
@@ -45,9 +44,10 @@ QMap<QString, QString> keyValueMapFromArgs(const QStringList &args); | |||
45 | /** | 44 | /** |
46 | * A small abstraction layer to use the sink store with the type available as string. | 45 | * A small abstraction layer to use the sink store with the type available as string. |
47 | */ | 46 | */ |
48 | class StoreBase { | 47 | class StoreBase |
48 | { | ||
49 | public: | 49 | public: |
50 | virtual ~StoreBase() {}; | 50 | virtual ~StoreBase(){}; |
51 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject() = 0; | 51 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject() = 0; |
52 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier = QByteArray()) = 0; | 52 | virtual Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier = QByteArray()) = 0; |
53 | virtual KAsync::Job<void> create(const Sink::ApplicationDomain::ApplicationDomainType &type) = 0; | 53 | virtual KAsync::Job<void> create(const Sink::ApplicationDomain::ApplicationDomainType &type) = 0; |
@@ -57,33 +57,37 @@ public: | |||
57 | }; | 57 | }; |
58 | 58 | ||
59 | template <typename T> | 59 | template <typename T> |
60 | class Store : public StoreBase { | 60 | class Store : public StoreBase |
61 | { | ||
61 | public: | 62 | public: |
62 | Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject() Q_DECL_OVERRIDE { | 63 | Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject() Q_DECL_OVERRIDE |
64 | { | ||
63 | return T::Ptr::create(); | 65 | return T::Ptr::create(); |
64 | } | 66 | } |
65 | 67 | ||
66 | Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier = QByteArray()) Q_DECL_OVERRIDE { | 68 | Sink::ApplicationDomain::ApplicationDomainType::Ptr getObject(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier = QByteArray()) Q_DECL_OVERRIDE |
69 | { | ||
67 | return T::Ptr::create(resourceInstanceIdentifier, identifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | 70 | return T::Ptr::create(resourceInstanceIdentifier, identifier, 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); |
68 | } | 71 | } |
69 | 72 | ||
70 | KAsync::Job<void> create(const Sink::ApplicationDomain::ApplicationDomainType &type) Q_DECL_OVERRIDE { | 73 | KAsync::Job<void> create(const Sink::ApplicationDomain::ApplicationDomainType &type) Q_DECL_OVERRIDE |
71 | return Sink::Store::create<T>(*static_cast<const T*>(&type)); | 74 | { |
75 | return Sink::Store::create<T>(*static_cast<const T *>(&type)); | ||
72 | } | 76 | } |
73 | 77 | ||
74 | KAsync::Job<void> modify(const Sink::ApplicationDomain::ApplicationDomainType &type) Q_DECL_OVERRIDE { | 78 | KAsync::Job<void> modify(const Sink::ApplicationDomain::ApplicationDomainType &type) Q_DECL_OVERRIDE |
75 | return Sink::Store::modify<T>(*static_cast<const T*>(&type)); | 79 | { |
80 | return Sink::Store::modify<T>(*static_cast<const T *>(&type)); | ||
76 | } | 81 | } |
77 | 82 | ||
78 | KAsync::Job<void> remove(const Sink::ApplicationDomain::ApplicationDomainType &type) Q_DECL_OVERRIDE { | 83 | KAsync::Job<void> remove(const Sink::ApplicationDomain::ApplicationDomainType &type) Q_DECL_OVERRIDE |
79 | return Sink::Store::remove<T>(*static_cast<const T*>(&type)); | 84 | { |
85 | return Sink::Store::remove<T>(*static_cast<const T *>(&type)); | ||
80 | } | 86 | } |
81 | 87 | ||
82 | QSharedPointer<QAbstractItemModel> loadModel(const Sink::Query &query) Q_DECL_OVERRIDE { | 88 | QSharedPointer<QAbstractItemModel> loadModel(const Sink::Query &query) Q_DECL_OVERRIDE |
89 | { | ||
83 | return Sink::Store::loadModel<T>(query); | 90 | return Sink::Store::loadModel<T>(query); |
84 | } | 91 | } |
85 | }; | 92 | }; |
86 | |||
87 | |||
88 | } | 93 | } |
89 | |||