Compare commits

...
4 Commits
Author SHA1 Message Date
Stanislav Angelovič 97372155a6 Update ChangeLog for v0.3.3 2018-12-29 01:02:36 +01:00
Stanislav Angelovič 1def4e247a Add note on thread-safety of Variant and its const methods 2018-12-29 00:59:31 +01:00
Stanislav Angelovič d764afec93 Little fixes in tutorial code samples
Fixes #24
2018-12-24 15:43:01 +01:00
Jeremy Prater eb58d2fa52 - Rewind Message prior to access for peekValueType.
Fixes #8

(cherry picked from commit f8bed4b0faa2c0a2bc7037f3a55105060d56dbdb)
2018-12-24 15:30:55 +01:00
4 changed files with 14 additions and 1 deletions
+5
View File
@@ -29,3 +29,8 @@ v0.3.1
v0.3.2
- Switched from autotools to CMake build system
v0.3.3
- Minor fixes in tutorial examples
- Add comment on threading traits of Variant and its const methods
- Fix broken invariant of const Variant::peekValueType() method
+2 -1
View File
@@ -357,7 +357,7 @@ int main(int argc, char *argv[])
// Let's subscribe for the 'concatenated' signals
const char* interfaceName = "org.sdbuscpp.Concatenator";
concatenatorProxy->uponSignal("concatenated").onInterface(interfaceName).call([this](const std::string& str){ onConcatenated(str); });
concatenatorProxy->uponSignal("concatenated").onInterface(interfaceName).call([](const std::string& str){ onConcatenated(str); });
concatenatorProxy->finishRegistration();
std::vector<int> numbers = {1, 2, 3};
@@ -636,6 +636,7 @@ Now let's use this proxy to make remote calls and listen to signals in a real ap
```cpp
#include "ConcatenatorProxy.h"
#include <unistd.h>
int main(int argc, char *argv[])
{
+6
View File
@@ -40,6 +40,12 @@ namespace sdbus {
* @class Variant
*
* Variant can hold value of any D-Bus-supported type.
*
* Note: Even though thread-aware, Variant objects are not thread-safe.
* Some const methods are conceptually const, but not physically const,
* thus are not thread-safe. This is by design: normally, clients
* should process a single Variant object in a single thread at a time.
* Otherwise they need to take care of synchronization by themselves.
*
***********************************************/
class Variant
+1
View File
@@ -51,6 +51,7 @@ void Variant::deserializeFrom(Message& msg)
std::string Variant::peekValueType() const
{
msg_.rewind(false);
std::string type;
std::string contents;
msg_.peekType(type, contents);