Autobahn|Cpp is a subproject of Autobahn which provides a WAMP implementation in C++ with the following roles
- Caller
- Callee
- Publisher
- Subscriber
running over TCP, Unix domain sockets or pipes (stdio
), using rawsocket-msgpack
WAMP transport.
The library is "header-only" and depends on
- C++ 11 compiler
boost::asio
boost::any
boost::future
Note: While C++ 11 provides a
std::future
, that lacks continuations. Autobahn|Cpp makes use ofboost::future.then
for attaching continuations to futures as outlined in the proposal here. This feature will come to standard C++, but probably not before 2015:
Install some libs and build tools:
sudo apt-get install libbz2-dev libssl-dev ruby libtool autoconf scons
sudo apt-get install clang-3.4 libc++1 libc++-dev
Get the latest Boost from here. Then
cd $HOME
tar xvjf Downloads/boost_1_55_0.tar.bz2
cd boost_1_55_0/
./bootstrap.sh
./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++"
Get Boost trunk by doing:
git clone --recursive [email protected]:boostorg/boost.git
svn co http://svn.boost.org/svn/boost/trunk boost-trunk
Add the following to $HOME/.profile
export LD_LIBRARY_PATH=${HOME}/boost_1_55_0/stage/lib:${LD_LIBRARY_PATH}
Get MsgPack-C and build with clang:
cd $HOME
git clone https://github.com/msgpack/msgpack-c.git
cd msgpack-c
./bootstrap
CXX=`which clang++` CC=`which clang` CXXFLAGS="-std=c++11 -stdlib=libc++" \
LDFLAGS="-stdlib=libc++" ./configure --prefix=$HOME/msgpack_clang
make
make install
Add the following to $HOME/.profile
export LD_LIBRARY_PATH=${HOME}/msgpack_clang/lib:${LD_LIBRARY_PATH}
Finally, to build Autobahn|Cpp
source $HOME/.profile
cd $HOME
git clone [email protected]:tavendo/AutobahnCpp.git
cd AutobahnCpp
scons
The documentation is built using Sphinx, Doxygen and Breathe.
Doxygen takes the C++ source files and autogenerates XML files from the documented C++ source code.
Breathe takes the XML files generated by Doxygen and generates Sphinx RST files.
Sphinx takes the RST files generated plus manually written RST files and generates the final documentation in HTML format.
sudo apt-get install doxygen python-sphinx
sudo /usr/bin/pip install breathe
_gen/doxygen
- ASIO C++11 Examples
- Using Asio with C++11
- C++17: I See a Monad in Your Future!
- Boost Thread
- Boost Issue: when_all
- Boost Issue. when_any
- Boost Issue: future fires twice
[]
Capture nothing (or, a scorched earth strategy?)[&]
Capture any referenced variable by reference[=]
Capture any referenced variable by making a copy[=, &foo]
Capture any referenced variable by making a copy, but capture variablefoo
by reference[bar]
Capturebar
by making a copy; don't copy anything else[this]
Capture the this pointer of the enclosing class