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
=== modified file 'README.md'
--- README.md 2013-11-27 08:44:49 +0000
+++ README.md 2013-11-28 07:42:04 +0000
@@ -23,7 +23,7 @@
23 cursor_position.set(new_position);23 cursor_position.set(new_position);
24 }24 }
25 25
26 com::ubuntu::Property<int> cursor_position;26 core::Property<int> cursor_position;
27};27};
28}28}
2929
@@ -101,7 +101,7 @@
101 std::thread::id dispatcher_thread_id = dispatcher_thread.get_id();101 std::thread::id dispatcher_thread_id = dispatcher_thread.get_id();
102102
103 // The signal that we want to dispatch via the event loop.103 // The signal that we want to dispatch via the event loop.
104 com::ubuntu::Signal<int, double> s;104 core::Signal<int, double> s;
105105
106 static const int expected_invocation_count = 10000;106 static const int expected_invocation_count = 10000;
107107
108108
=== modified file 'debian/libproperties-cpp-dev.install'
--- debian/libproperties-cpp-dev.install 2013-11-13 09:54:29 +0000
+++ debian/libproperties-cpp-dev.install 2013-11-28 07:42:04 +0000
@@ -1,3 +1,3 @@
1usr/include/properties-cpp/*1usr/include/core/*
2usr/lib/*/pkgconfig/*2usr/lib/*/pkgconfig/*
33
44
=== modified file 'include/CMakeLists.txt'
--- include/CMakeLists.txt 2013-11-13 09:19:50 +0000
+++ include/CMakeLists.txt 2013-11-28 07:42:04 +0000
@@ -15,6 +15,6 @@
15# Authored by: Thomas Voss <thomas.voss@canonical.com>15# Authored by: Thomas Voss <thomas.voss@canonical.com>
1616
17install(17install(
18 DIRECTORY com18 DIRECTORY core
19 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}19 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/
20)20)
2121
=== removed directory 'include/com'
=== removed directory 'include/com/ubuntu'
=== added directory 'include/core'
=== renamed file 'include/com/ubuntu/connection.h' => 'include/core/connection.h'
--- include/com/ubuntu/connection.h 2013-11-27 08:44:49 +0000
+++ include/core/connection.h 2013-11-28 07:42:04 +0000
@@ -22,9 +22,7 @@
22#include <memory>22#include <memory>
23#include <mutex>23#include <mutex>
2424
25namespace com25namespace core
26{
27namespace ubuntu
28{26{
29/**27/**
30 * @brief The Connection class models a signal-slot connection.28 * @brief The Connection class models a signal-slot connection.
@@ -159,8 +157,6 @@
159private:157private:
160 Connection connection;158 Connection connection;
161};159};
162
163}
164}160}
165161
166#endif // COM_UBUNTU_CONNECTION_H_162#endif // COM_UBUNTU_CONNECTION_H_
167163
=== renamed file 'include/com/ubuntu/property.h' => 'include/core/property.h'
--- include/com/ubuntu/property.h 2013-11-27 08:44:49 +0000
+++ include/core/property.h 2013-11-28 07:42:04 +0000
@@ -15,16 +15,14 @@
15 *15 *
16 * Authored by: Thomas Voß <thomas.voss@canonical.com>16 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 */17 */
18#ifndef COM_UBUNTU_PROPERTY_H_18#ifndef CORE_PROPERTY_H_
19#define COM_UBUNTU_PROPERTY_H_19#define CORE_PROPERTY_H_
2020
21#include <com/ubuntu/signal.h>21#include <core/signal.h>
2222
23#include <iostream>23#include <iostream>
2424
25namespace com25namespace core
26{
27namespace ubuntu
28{26{
29/**27/**
30 * @brief A very simple, templated class that allows for uniform declaration of get-able/set-able/observable members.28 * @brief A very simple, templated class that allows for uniform declaration of get-able/set-able/observable members.
@@ -179,6 +177,5 @@
179 Signal<T> signal_changed;177 Signal<T> signal_changed;
180};178};
181}179}
182}
183180
184#endif // COM_UBUNTU_PROPERTY_H_181#endif // CORE_PROPERTY_H_
185182
=== renamed file 'include/com/ubuntu/signal.h' => 'include/core/signal.h'
--- include/com/ubuntu/signal.h 2013-11-27 08:44:49 +0000
+++ include/core/signal.h 2013-11-28 07:42:04 +0000
@@ -18,7 +18,7 @@
18#ifndef COM_UBUNTU_SIGNAL_H_18#ifndef COM_UBUNTU_SIGNAL_H_
19#define COM_UBUNTU_SIGNAL_H_19#define COM_UBUNTU_SIGNAL_H_
2020
21#include <com/ubuntu/connection.h>21#include <core/connection.h>
2222
23#include <functional>23#include <functional>
24#include <iostream>24#include <iostream>
@@ -26,9 +26,7 @@
26#include <mutex>26#include <mutex>
27#include <set>27#include <set>
2828
29namespace com29namespace core
30{
31namespace ubuntu
32{30{
33/**31/**
34 * @brief A signal class that observers can subscribe to.32 * @brief A signal class that observers can subscribe to.
@@ -295,6 +293,5 @@
295 std::shared_ptr<Private> d;293 std::shared_ptr<Private> d;
296};294};
297}295}
298}
299296
300#endif // COM_UBUNTU_SIGNAL_H_297#endif // COM_UBUNTU_SIGNAL_H_
301298
=== modified file 'tests/properties_test.cpp'
--- tests/properties_test.cpp 2013-11-27 08:44:49 +0000
+++ tests/properties_test.cpp 2013-11-28 07:42:04 +0000
@@ -16,17 +16,17 @@
16 * Authored by: Thomas Voß <thomas.voss@canonical.com>16 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 */17 */
1818
19#include <com/ubuntu/property.h>19#include <core/property.h>
2020
21#include <gtest/gtest.h>21#include <gtest/gtest.h>
2222
23TEST(Property, default_construction_yields_default_value)23TEST(Property, default_construction_yields_default_value)
24{24{
25 com::ubuntu::Property<int> p1;25 core::Property<int> p1;
26 EXPECT_EQ(int{}, p1.get());26 EXPECT_EQ(int{}, p1.get());
2727
28 static const int new_default_value = 42;28 static const int new_default_value = 42;
29 com::ubuntu::Property<int> p2{new_default_value};29 core::Property<int> p2{new_default_value};
3030
31 EXPECT_EQ(new_default_value, p2.get());31 EXPECT_EQ(new_default_value, p2.get());
32}32}
@@ -34,8 +34,8 @@
34TEST(Property, copy_construction_yields_correct_value)34TEST(Property, copy_construction_yields_correct_value)
35{35{
36 static const int default_value = 42;36 static const int default_value = 42;
37 com::ubuntu::Property<int> p1{default_value};37 core::Property<int> p1{default_value};
38 com::ubuntu::Property<int> p2{p1};38 core::Property<int> p2{p1};
3939
40 EXPECT_EQ(default_value, p2.get());40 EXPECT_EQ(default_value, p2.get());
41}41}
@@ -43,8 +43,8 @@
43TEST(Property, assignment_operator_for_properties_works)43TEST(Property, assignment_operator_for_properties_works)
44{44{
45 static const int default_value = 42;45 static const int default_value = 42;
46 com::ubuntu::Property<int> p1{default_value};46 core::Property<int> p1{default_value};
47 com::ubuntu::Property<int> p2;47 core::Property<int> p2;
48 p2 = p1;48 p2 = p1;
4949
50 EXPECT_EQ(default_value, p2.get());50 EXPECT_EQ(default_value, p2.get());
@@ -53,7 +53,7 @@
53TEST(Property, assignment_operator_for_raw_values_works)53TEST(Property, assignment_operator_for_raw_values_works)
54{54{
55 static const int default_value = 42;55 static const int default_value = 42;
56 com::ubuntu::Property<int> p1;56 core::Property<int> p1;
57 p1 = default_value;57 p1 = default_value;
5858
59 EXPECT_EQ(default_value, p1.get());59 EXPECT_EQ(default_value, p1.get());
@@ -62,8 +62,8 @@
62TEST(Property, equality_operator_for_properties_works)62TEST(Property, equality_operator_for_properties_works)
63{63{
64 static const int default_value = 42;64 static const int default_value = 42;
65 com::ubuntu::Property<int> p1{default_value};65 core::Property<int> p1{default_value};
66 com::ubuntu::Property<int> p2;66 core::Property<int> p2;
67 p2 = p1;67 p2 = p1;
6868
69 EXPECT_EQ(p1, p2);69 EXPECT_EQ(p1, p2);
@@ -72,7 +72,7 @@
72TEST(Property, equality_operator_for_raw_values_works)72TEST(Property, equality_operator_for_raw_values_works)
73{73{
74 static const int default_value = 42;74 static const int default_value = 42;
75 com::ubuntu::Property<int> p1{default_value};75 core::Property<int> p1{default_value};
7676
77 EXPECT_EQ(default_value, p1);77 EXPECT_EQ(default_value, p1);
78}78}
@@ -100,7 +100,7 @@
100TEST(Property, signal_changed_is_emitted_with_correct_value_for_set)100TEST(Property, signal_changed_is_emitted_with_correct_value_for_set)
101{101{
102 static const int default_value = 42;102 static const int default_value = 42;
103 com::ubuntu::Property<int> p1;103 core::Property<int> p1;
104 Expectation<int> expectation{default_value};104 Expectation<int> expectation{default_value};
105105
106 p1.changed().connect([&expectation](int value) { expectation.triggered = true; expectation.current_value = value; });106 p1.changed().connect([&expectation](int value) { expectation.triggered = true; expectation.current_value = value; });
@@ -113,7 +113,7 @@
113TEST(Property, signal_changed_is_emitted_with_correct_value_for_assignment)113TEST(Property, signal_changed_is_emitted_with_correct_value_for_assignment)
114{114{
115 static const int default_value = 42;115 static const int default_value = 42;
116 com::ubuntu::Property<int> p1;116 core::Property<int> p1;
117117
118 Expectation<int> expectation{42};118 Expectation<int> expectation{42};
119119
@@ -127,7 +127,7 @@
127TEST(Property, signal_changed_is_emitted_with_correct_value_for_update)127TEST(Property, signal_changed_is_emitted_with_correct_value_for_update)
128{128{
129 static const int default_value = 42;129 static const int default_value = 42;
130 com::ubuntu::Property<int> p1;130 core::Property<int> p1;
131131
132 Expectation<int> expectation{default_value};132 Expectation<int> expectation{default_value};
133133
@@ -146,7 +146,7 @@
146 cursor_position.set(new_position);146 cursor_position.set(new_position);
147 }147 }
148 148
149 com::ubuntu::Property<int> cursor_position;149 core::Property<int> cursor_position;
150};150};
151}151}
152152
153153
=== modified file 'tests/signals_test.cpp'
--- tests/signals_test.cpp 2013-11-27 08:44:49 +0000
+++ tests/signals_test.cpp 2013-11-28 07:42:04 +0000
@@ -16,7 +16,7 @@
16 * Authored by: Thomas Voß <thomas.voss@canonical.com>16 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 */17 */
1818
19#include <com/ubuntu/signal.h>19#include <core/signal.h>
2020
21#include <gtest/gtest.h>21#include <gtest/gtest.h>
2222
@@ -49,7 +49,7 @@
49{49{
50 Expectation<int> expectation{42};50 Expectation<int> expectation{42};
5151
52 com::ubuntu::Signal<int> s;52 core::Signal<int> s;
53 s.connect([&expectation](int value) { expectation.triggered = true; expectation.current_value = value; });53 s.connect([&expectation](int value) { expectation.triggered = true; expectation.current_value = value; });
5454
55 s(42);55 s(42);
@@ -61,7 +61,7 @@
61{61{
62 Expectation<int> expectation{42};62 Expectation<int> expectation{42};
6363
64 com::ubuntu::Signal<int> s;64 core::Signal<int> s;
65 auto connection = s.connect(65 auto connection = s.connect(
66 [&expectation](int value)66 [&expectation](int value)
67 {67 {
@@ -78,7 +78,7 @@
78{78{
79 Expectation<int> expectation{42};79 Expectation<int> expectation{42};
8080
81 com::ubuntu::Signal<int> s;81 core::Signal<int> s;
82 auto connection = s.connect(82 auto connection = s.connect(
83 [&expectation](int value)83 [&expectation](int value)
84 {84 {
@@ -86,7 +86,7 @@
86 expectation.current_value = value;86 expectation.current_value = value;
87 });87 });
88 {88 {
89 com::ubuntu::ScopedConnection sc{connection};89 core::ScopedConnection sc{connection};
90 }90 }
91 s(42);91 s(42);
9292
@@ -95,13 +95,13 @@
9595
96TEST(Signal, a_signal_going_out_of_scope_disconnects_from_slots)96TEST(Signal, a_signal_going_out_of_scope_disconnects_from_slots)
97{97{
98 auto signal = std::make_shared<com::ubuntu::Signal<int>>();98 auto signal = std::make_shared<core::Signal<int>>();
9999
100 auto connection = signal->connect([](int value) { std::cout << value << std::endl; });100 auto connection = signal->connect([](int value) { std::cout << value << std::endl; });
101101
102 signal.reset();102 signal.reset();
103103
104 com::ubuntu::Connection::Dispatcher dispatcher{};104 core::Connection::Dispatcher dispatcher{};
105105
106 EXPECT_NO_THROW(connection.disconnect());106 EXPECT_NO_THROW(connection.disconnect());
107 EXPECT_NO_THROW(connection.dispatch_via(dispatcher));107 EXPECT_NO_THROW(connection.dispatch_via(dispatcher));
@@ -159,7 +159,7 @@
159 std::thread::id dispatcher_thread_id = dispatcher_thread.get_id();159 std::thread::id dispatcher_thread_id = dispatcher_thread.get_id();
160160
161 // The signal that we want to dispatch via the event loop.161 // The signal that we want to dispatch via the event loop.
162 com::ubuntu::Signal<int, double> s;162 core::Signal<int, double> s;
163163
164 static const int expected_invocation_count = 10000;164 static const int expected_invocation_count = 10000;
165165

Subscribers

People subscribed via source and target branches