Skip to content

Commit 5751bc8

Browse files
committed
Fixes and enhancements
- Added support for binary WAMP payloads (closes #50) - Fixed wrong header guard in <cppwamp/types/unorderedmap.hpp> (fixes #73) - Added `SessionErrc` mappings to new predefined error URIs added to the spec (closes #77) - Added recently proposed `exclude_authid`, `exclude_authrole`, `eligible_authid`, `eligible_authrole` options (closes #80). - Fixed `ScopedRegistration`s and `ScopedSubscription`s that weren't being moved properly (fixes #82). - Added `basicRpc` and `basicEvent` functions. `basicRpc` allows the registration of statically-typed RPC handlers that don't take an `Invocation` parameter and don't return an `Outcome` result. Likewise, `basicEvent` allows the registration of statically-typed event handlers that don't take an `Event` parameter (closes #84).
1 parent 3bae44d commit 5751bc8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1541
-218
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
[submodule "ext/rapidjson"]
22
path = ext/rapidjson
33
url = https://github.com/miloyip/rapidjson
4+
ignore = dirty
45
[submodule "ext/msgpack-c"]
56
path = ext/msgpack-c
67
url = https://github.com/msgpack/msgpack-c
8+
ignore = dirty
79
[submodule "ext/Catch"]
810
path = ext/Catch
911
url = https://github.com/philsquared/Catch
12+
ignore = dirty
13+

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
v0.5.3
2+
======
3+
Fixes and enhancements.
4+
5+
- Added support for binary WAMP payloads (closes #50)
6+
- Fixed wrong header guard in <cppwamp/types/unorderedmap.hpp> (fixes #73)
7+
- Added `SessionErrc` mappings to new predefined error URIs added to
8+
the spec (closes #77)
9+
- Added recently proposed `exclude_authid`, `exclude_authrole`,
10+
`eligible_authid`, `eligible_authrole` options (closes #80).
11+
- Fixed `ScopedRegistration`s and `ScopedSubscription`s that weren't being
12+
moved properly (fixes #82).
13+
- Added `basicRpc` and `basicEvent` functions. `basicRpc` allows the
14+
registration of statically-typed RPC handlers that don't take an `Invocation`
15+
parameter and don't return an `Outcome` result. Likewise, `basicEvent` allows
16+
the registration of statically-typed event handlers that don't take an
17+
`Event` parameter (closes #84).
18+
119
v0.5.2
220
======
321
More fixes for v0.5.0 release.

cppwamp/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set(SOURCES src/cppwamp.cpp)
1010
set(HEADERS
1111
include/cppwamp/asiodefs.hpp
1212
include/cppwamp/asyncresult.hpp
13+
include/cppwamp/blob.hpp
1314
include/cppwamp/codec.hpp
1415
include/cppwamp/connector.hpp
1516
include/cppwamp/conversion.hpp
@@ -71,6 +72,8 @@ set(HEADERS
7172

7273
set(INLINES
7374
include/cppwamp/internal/asyncresult.ipp
75+
include/cppwamp/internal/base64.hpp
76+
include/cppwamp/internal/blob.ipp
7477
include/cppwamp/internal/conversion.ipp
7578
include/cppwamp/internal/corosession.ipp
7679
include/cppwamp/internal/dialoguedata.ipp
@@ -118,6 +121,13 @@ add_definitions(-DCPPWAMP_COMPILED_LIB)
118121
# Set include path for other targets that are dependant on this library
119122
target_include_directories(cppwamp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
120123

124+
if(APPLE)
125+
# Link boost libraries (command is redundant in linux)
126+
target_link_libraries(cppwamp
127+
${Boost_LIBRARIES}
128+
)
129+
endif()
130+
121131
# Add a GUI variable that let's the user choose if a shared or static library
122132
# will be built.
123133
option(

cppwamp/cppwamp.pro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ SOURCES += \
1515
HEADERS += \
1616
include/cppwamp/asiodefs.hpp \
1717
include/cppwamp/asyncresult.hpp \
18+
include/cppwamp/blob.hpp \
1819
include/cppwamp/codec.hpp \
1920
include/cppwamp/connector.hpp \
2021
include/cppwamp/conversion.hpp \
@@ -74,6 +75,8 @@ HEADERS += \
7475
include/cppwamp/types/unorderedmap.hpp \
7576
\
7677
include/cppwamp/internal/asyncresult.ipp \
78+
include/cppwamp/internal/base64.hpp \
79+
include/cppwamp/internal/blob.ipp \
7780
include/cppwamp/internal/conversion.ipp \
7881
include/cppwamp/internal/corosession.ipp \
7982
include/cppwamp/internal/dialoguedata.ipp \

cppwamp/include/cppwamp/blob.hpp

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*------------------------------------------------------------------------------
2+
Copyright Butterfly Energy Systems 2014-2015.
3+
Distributed under the Boost Software License, Version 1.0.
4+
(See accompanying file LICENSE_1_0.txt or copy at
5+
http://www.boost.org/LICENSE_1_0.txt)
6+
------------------------------------------------------------------------------*/
7+
8+
#ifndef CPPWAMP_BLOB_HPP
9+
#define CPPWAMP_BLOB_HPP
10+
11+
//------------------------------------------------------------------------------
12+
/** @file
13+
Contains the declaration of Variant and other closely related
14+
types/functions. */
15+
//------------------------------------------------------------------------------
16+
17+
#include <cstdint>
18+
#include <initializer_list>
19+
#include <ostream>
20+
#include <vector>
21+
22+
namespace wamp
23+
{
24+
25+
//------------------------------------------------------------------------------
26+
/** Contains binary data as an array of bytes. */
27+
//------------------------------------------------------------------------------
28+
class Blob
29+
{
30+
public:
31+
/// Array of bytes used to contain the binary data.
32+
using Data = std::vector<uint8_t>;
33+
34+
/** Default constructor. */
35+
Blob();
36+
37+
/** Constructor taking a vector of bytes. */
38+
explicit Blob(Data data);
39+
40+
/** Constructor taking an initializer list. */
41+
explicit Blob(std::initializer_list<uint8_t> list);
42+
43+
/** Obtains the blob's array of bytes. */
44+
Data& data();
45+
46+
/** Obtains the blob's constant array of bytes. */
47+
const Data& data() const;
48+
49+
/** Equality comparison. */
50+
bool operator==(const Blob& other) const;
51+
52+
/** Inequality comparison. */
53+
bool operator!=(const Blob& other) const;
54+
55+
/** Less-than comparison. */
56+
bool operator<(const Blob& other) const;
57+
58+
private:
59+
std::vector<uint8_t> data_;
60+
};
61+
62+
//------------------------------------------------------------------------------
63+
/** Outputs a Blob to the given output stream.
64+
@relates Blob */
65+
//------------------------------------------------------------------------------
66+
std::ostream& operator<<(std::ostream& out, const Blob& blob);
67+
68+
} // namespace wamp
69+
70+
#ifndef CPPWAMP_COMPILED_LIB
71+
#include "internal/blob.ipp"
72+
#endif
73+
74+
#endif // CPPWAMP_BLOB_HPP

cppwamp/include/cppwamp/corosession.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ namespace wamp
6363
iosvc.run();
6464
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6565
[asiocoro]: http://www.boost.org/doc/libs/release/doc/html/boost_asio/overview/core/spawn.html
66-
[yieldcontext]: http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/reference/yield_context.html
66+
[yieldcontext]: http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/yield_context.html
6767
[spawn]: http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/spawn.html
6868
6969
@par Aborting Coroutine Operations

cppwamp/include/cppwamp/dialoguedata.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ class Error : public Options<Error>, public Payload<Error>
5454
/** Converting constructor taking a reason URI. */
5555
Error(String reason);
5656

57+
/** Destructor. */
58+
virtual ~Error();
59+
5760
/** Conversion to bool operator, returning false if the error is empty. */
5861
explicit operator bool() const;
5962

cppwamp/include/cppwamp/error.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ enum class SessionErrc
131131
notAuthorized, ///< This peer is not authorized to perform the operation
132132
authorizationFailed, ///< The authorization operation failed
133133
noSuchRealm, ///< Attempt to join non-existent realm
134-
noSuchRole ///< Attempt to authenticate under unsupported role
134+
noSuchRole, ///< Attempt to authenticate under unsupported role
135+
cancelled, ///< Dealer or Callee canceled a call previously issued
136+
optionNotAllowed, ///< Option is disallowed by the router
137+
noEligibleCallee, ///< Call options lead to the exclusion of all callees providing the procedure
138+
discloseMeDisallowed, ///< Router rejected client request to disclose its identity
139+
networkFailure ///< Router encountered a network failure
135140
};
136141

137142
//------------------------------------------------------------------------------

0 commit comments

Comments
 (0)