Merge lp:~thomas-voss/properties-cpp/adjust-namespace-to-core into lp:properties-cpp

Proposed by Thomas Voß
Status: Merged
Merged at revision: 5
Proposed branch: lp:~thomas-voss/properties-cpp/adjust-namespace-to-core
Merge into: lp:properties-cpp
Diff against target: 319 lines (+36/-46)
8 files modified
README.md (+2/-2)
debian/libproperties-cpp-dev.install (+1/-1)
include/CMakeLists.txt (+2/-2)
include/core/connection.h (+1/-5)
include/core/property.h (+5/-8)
include/core/signal.h (+2/-5)
tests/properties_test.cpp (+15/-15)
tests/signals_test.cpp (+8/-8)
To merge this branch: bzr merge lp:~thomas-voss/properties-cpp/adjust-namespace-to-core
Reviewer Review Type Date Requested Status
Jussi Pakkanen (community) Approve
Review via email: mp+197015@code.launchpad.net

Commit message

Adjust namespace to core.

Description of the change

Adjust namespace to core.

To post a comment you must log in.
6. By Thomas Voß

Adjust namespaces in documentation.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

As per the irc discussion, let's go with this. We can change it later if a better name comes along.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2013-11-27 08:44:49 +0000
3+++ README.md 2013-11-28 07:42:04 +0000
4@@ -23,7 +23,7 @@
5 cursor_position.set(new_position);
6 }
7
8- com::ubuntu::Property<int> cursor_position;
9+ core::Property<int> cursor_position;
10 };
11 }
12
13@@ -101,7 +101,7 @@
14 std::thread::id dispatcher_thread_id = dispatcher_thread.get_id();
15
16 // The signal that we want to dispatch via the event loop.
17- com::ubuntu::Signal<int, double> s;
18+ core::Signal<int, double> s;
19
20 static const int expected_invocation_count = 10000;
21
22
23=== modified file 'debian/libproperties-cpp-dev.install'
24--- debian/libproperties-cpp-dev.install 2013-11-13 09:54:29 +0000
25+++ debian/libproperties-cpp-dev.install 2013-11-28 07:42:04 +0000
26@@ -1,3 +1,3 @@
27-usr/include/properties-cpp/*
28+usr/include/core/*
29 usr/lib/*/pkgconfig/*
30
31
32=== modified file 'include/CMakeLists.txt'
33--- include/CMakeLists.txt 2013-11-13 09:19:50 +0000
34+++ include/CMakeLists.txt 2013-11-28 07:42:04 +0000
35@@ -15,6 +15,6 @@
36 # Authored by: Thomas Voss <thomas.voss@canonical.com>
37
38 install(
39- DIRECTORY com
40- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}
41+ DIRECTORY core
42+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/
43 )
44
45=== removed directory 'include/com'
46=== removed directory 'include/com/ubuntu'
47=== added directory 'include/core'
48=== renamed file 'include/com/ubuntu/connection.h' => 'include/core/connection.h'
49--- include/com/ubuntu/connection.h 2013-11-27 08:44:49 +0000
50+++ include/core/connection.h 2013-11-28 07:42:04 +0000
51@@ -22,9 +22,7 @@
52 #include <memory>
53 #include <mutex>
54
55-namespace com
56-{
57-namespace ubuntu
58+namespace core
59 {
60 /**
61 * @brief The Connection class models a signal-slot connection.
62@@ -159,8 +157,6 @@
63 private:
64 Connection connection;
65 };
66-
67-}
68 }
69
70 #endif // COM_UBUNTU_CONNECTION_H_
71
72=== renamed file 'include/com/ubuntu/property.h' => 'include/core/property.h'
73--- include/com/ubuntu/property.h 2013-11-27 08:44:49 +0000
74+++ include/core/property.h 2013-11-28 07:42:04 +0000
75@@ -15,16 +15,14 @@
76 *
77 * Authored by: Thomas Voß <thomas.voss@canonical.com>
78 */
79-#ifndef COM_UBUNTU_PROPERTY_H_
80-#define COM_UBUNTU_PROPERTY_H_
81+#ifndef CORE_PROPERTY_H_
82+#define CORE_PROPERTY_H_
83
84-#include <com/ubuntu/signal.h>
85+#include <core/signal.h>
86
87 #include <iostream>
88
89-namespace com
90-{
91-namespace ubuntu
92+namespace core
93 {
94 /**
95 * @brief A very simple, templated class that allows for uniform declaration of get-able/set-able/observable members.
96@@ -179,6 +177,5 @@
97 Signal<T> signal_changed;
98 };
99 }
100-}
101
102-#endif // COM_UBUNTU_PROPERTY_H_
103+#endif // CORE_PROPERTY_H_
104
105=== renamed file 'include/com/ubuntu/signal.h' => 'include/core/signal.h'
106--- include/com/ubuntu/signal.h 2013-11-27 08:44:49 +0000
107+++ include/core/signal.h 2013-11-28 07:42:04 +0000
108@@ -18,7 +18,7 @@
109 #ifndef COM_UBUNTU_SIGNAL_H_
110 #define COM_UBUNTU_SIGNAL_H_
111
112-#include <com/ubuntu/connection.h>
113+#include <core/connection.h>
114
115 #include <functional>
116 #include <iostream>
117@@ -26,9 +26,7 @@
118 #include <mutex>
119 #include <set>
120
121-namespace com
122-{
123-namespace ubuntu
124+namespace core
125 {
126 /**
127 * @brief A signal class that observers can subscribe to.
128@@ -295,6 +293,5 @@
129 std::shared_ptr<Private> d;
130 };
131 }
132-}
133
134 #endif // COM_UBUNTU_SIGNAL_H_
135
136=== modified file 'tests/properties_test.cpp'
137--- tests/properties_test.cpp 2013-11-27 08:44:49 +0000
138+++ tests/properties_test.cpp 2013-11-28 07:42:04 +0000
139@@ -16,17 +16,17 @@
140 * Authored by: Thomas Voß <thomas.voss@canonical.com>
141 */
142
143-#include <com/ubuntu/property.h>
144+#include <core/property.h>
145
146 #include <gtest/gtest.h>
147
148 TEST(Property, default_construction_yields_default_value)
149 {
150- com::ubuntu::Property<int> p1;
151+ core::Property<int> p1;
152 EXPECT_EQ(int{}, p1.get());
153
154 static const int new_default_value = 42;
155- com::ubuntu::Property<int> p2{new_default_value};
156+ core::Property<int> p2{new_default_value};
157
158 EXPECT_EQ(new_default_value, p2.get());
159 }
160@@ -34,8 +34,8 @@
161 TEST(Property, copy_construction_yields_correct_value)
162 {
163 static const int default_value = 42;
164- com::ubuntu::Property<int> p1{default_value};
165- com::ubuntu::Property<int> p2{p1};
166+ core::Property<int> p1{default_value};
167+ core::Property<int> p2{p1};
168
169 EXPECT_EQ(default_value, p2.get());
170 }
171@@ -43,8 +43,8 @@
172 TEST(Property, assignment_operator_for_properties_works)
173 {
174 static const int default_value = 42;
175- com::ubuntu::Property<int> p1{default_value};
176- com::ubuntu::Property<int> p2;
177+ core::Property<int> p1{default_value};
178+ core::Property<int> p2;
179 p2 = p1;
180
181 EXPECT_EQ(default_value, p2.get());
182@@ -53,7 +53,7 @@
183 TEST(Property, assignment_operator_for_raw_values_works)
184 {
185 static const int default_value = 42;
186- com::ubuntu::Property<int> p1;
187+ core::Property<int> p1;
188 p1 = default_value;
189
190 EXPECT_EQ(default_value, p1.get());
191@@ -62,8 +62,8 @@
192 TEST(Property, equality_operator_for_properties_works)
193 {
194 static const int default_value = 42;
195- com::ubuntu::Property<int> p1{default_value};
196- com::ubuntu::Property<int> p2;
197+ core::Property<int> p1{default_value};
198+ core::Property<int> p2;
199 p2 = p1;
200
201 EXPECT_EQ(p1, p2);
202@@ -72,7 +72,7 @@
203 TEST(Property, equality_operator_for_raw_values_works)
204 {
205 static const int default_value = 42;
206- com::ubuntu::Property<int> p1{default_value};
207+ core::Property<int> p1{default_value};
208
209 EXPECT_EQ(default_value, p1);
210 }
211@@ -100,7 +100,7 @@
212 TEST(Property, signal_changed_is_emitted_with_correct_value_for_set)
213 {
214 static const int default_value = 42;
215- com::ubuntu::Property<int> p1;
216+ core::Property<int> p1;
217 Expectation<int> expectation{default_value};
218
219 p1.changed().connect([&expectation](int value) { expectation.triggered = true; expectation.current_value = value; });
220@@ -113,7 +113,7 @@
221 TEST(Property, signal_changed_is_emitted_with_correct_value_for_assignment)
222 {
223 static const int default_value = 42;
224- com::ubuntu::Property<int> p1;
225+ core::Property<int> p1;
226
227 Expectation<int> expectation{42};
228
229@@ -127,7 +127,7 @@
230 TEST(Property, signal_changed_is_emitted_with_correct_value_for_update)
231 {
232 static const int default_value = 42;
233- com::ubuntu::Property<int> p1;
234+ core::Property<int> p1;
235
236 Expectation<int> expectation{default_value};
237
238@@ -146,7 +146,7 @@
239 cursor_position.set(new_position);
240 }
241
242- com::ubuntu::Property<int> cursor_position;
243+ core::Property<int> cursor_position;
244 };
245 }
246
247
248=== modified file 'tests/signals_test.cpp'
249--- tests/signals_test.cpp 2013-11-27 08:44:49 +0000
250+++ tests/signals_test.cpp 2013-11-28 07:42:04 +0000
251@@ -16,7 +16,7 @@
252 * Authored by: Thomas Voß <thomas.voss@canonical.com>
253 */
254
255-#include <com/ubuntu/signal.h>
256+#include <core/signal.h>
257
258 #include <gtest/gtest.h>
259
260@@ -49,7 +49,7 @@
261 {
262 Expectation<int> expectation{42};
263
264- com::ubuntu::Signal<int> s;
265+ core::Signal<int> s;
266 s.connect([&expectation](int value) { expectation.triggered = true; expectation.current_value = value; });
267
268 s(42);
269@@ -61,7 +61,7 @@
270 {
271 Expectation<int> expectation{42};
272
273- com::ubuntu::Signal<int> s;
274+ core::Signal<int> s;
275 auto connection = s.connect(
276 [&expectation](int value)
277 {
278@@ -78,7 +78,7 @@
279 {
280 Expectation<int> expectation{42};
281
282- com::ubuntu::Signal<int> s;
283+ core::Signal<int> s;
284 auto connection = s.connect(
285 [&expectation](int value)
286 {
287@@ -86,7 +86,7 @@
288 expectation.current_value = value;
289 });
290 {
291- com::ubuntu::ScopedConnection sc{connection};
292+ core::ScopedConnection sc{connection};
293 }
294 s(42);
295
296@@ -95,13 +95,13 @@
297
298 TEST(Signal, a_signal_going_out_of_scope_disconnects_from_slots)
299 {
300- auto signal = std::make_shared<com::ubuntu::Signal<int>>();
301+ auto signal = std::make_shared<core::Signal<int>>();
302
303 auto connection = signal->connect([](int value) { std::cout << value << std::endl; });
304
305 signal.reset();
306
307- com::ubuntu::Connection::Dispatcher dispatcher{};
308+ core::Connection::Dispatcher dispatcher{};
309
310 EXPECT_NO_THROW(connection.disconnect());
311 EXPECT_NO_THROW(connection.dispatch_via(dispatcher));
312@@ -159,7 +159,7 @@
313 std::thread::id dispatcher_thread_id = dispatcher_thread.get_id();
314
315 // The signal that we want to dispatch via the event loop.
316- com::ubuntu::Signal<int, double> s;
317+ core::Signal<int, double> s;
318
319 static const int expected_invocation_count = 10000;
320

Subscribers

People subscribed via source and target branches