Commit 8002ff4f authored by Dominik Charousset's avatar Dominik Charousset

Merge branch 'master' into develop

parents 99fcd2b1 298f57cd
...@@ -50,7 +50,7 @@ Dependencies ...@@ -50,7 +50,7 @@ Dependencies
Supported Compilers Supported Compilers
------------------- -------------------
* GCC >= 4.7 * GCC >= 4.7.2
* Clang >= 3.2 * Clang >= 3.2
...@@ -59,6 +59,7 @@ Supported Operating Systems ...@@ -59,6 +59,7 @@ Supported Operating Systems
* Linux * Linux
* Mac OS X * Mac OS X
* FreeBSD 10
* *Note for MS Windows*: CAF relies on C++11 features such as variadic templates and unrestricted unions. We will support Visual Studio as soon as Microsoft's compiler implements all required C++11 features. In the meantime, you can use CAF via MinGW. * *Note for MS Windows*: CAF relies on C++11 features such as variadic templates and unrestricted unions. We will support Visual Studio as soon as Microsoft's compiler implements all required C++11 features. In the meantime, you can use CAF via MinGW.
......
...@@ -172,6 +172,7 @@ void testee(event_based_actor* self, size_t remaining) { ...@@ -172,6 +172,7 @@ void testee(event_based_actor* self, size_t remaining) {
int main() { int main() {
// the tree_type_info is owned by libcaf after this function call // the tree_type_info is owned by libcaf after this function call
announce(typeid(tree), std::unique_ptr<uniform_type_info>{new tree_type_info}); announce(typeid(tree), std::unique_ptr<uniform_type_info>{new tree_type_info});
announce<tree_vector>("tree_vector");
tree t0; // create a tree and fill it with some data tree t0; // create a tree and fill it with some data
...@@ -203,7 +204,6 @@ int main() { ...@@ -203,7 +204,6 @@ int main() {
self->send(t, t0); self->send(t, t0);
// send a vector of trees // send a vector of trees
announce<tree_vector>("tree_vector");
tree_vector tvec; tree_vector tvec;
tvec.push_back(t0); tvec.push_back(t0);
tvec.push_back(t0); tvec.push_back(t0);
......
...@@ -174,3 +174,19 @@ The following table summarizes the changes made to the API. ...@@ -174,3 +174,19 @@ The following table summarizes the changes made to the API.
Version 0.11 introduced new, optional components. Version 0.11 introduced new, optional components.
The core library itself, however, mainly received optimizations and bugfixes with one exception: the member function \lstinline^on_exit^ is no longer virtual. The core library itself, however, mainly received optimizations and bugfixes with one exception: the member function \lstinline^on_exit^ is no longer virtual.
You can still provide it to define a custom exit handler, but you must not use \lstinline^override^. You can still provide it to define a custom exit handler, but you must not use \lstinline^override^.
\clearpage
\subsubsection{0.11 $\Rightarrow$ 0.12}
Version 0.12 removed two features:
\begin{itemize}
\item
Type names are no longer demangled automatically.
Hence, users must explicitly pass the type name as first argument when using \lstinline^announce^, i.e., \lstinline^announce<my_class>(...)^ becomes \lstinline^announce<my_class>("my_class", ...)^.
\item
Synchronous send blocks no longer support \lstinline^continue_with^.
This feature has been removed without substitution.
\end{itemize}
...@@ -86,23 +86,3 @@ void foo(event_based_actor* self, actor testee) { ...@@ -86,23 +86,3 @@ void foo(event_based_actor* self, actor testee) {
[=](const std::string& str) { /* handle str */ } [=](const std::string& str) { /* handle str */ }
); );
\end{lstlisting} \end{lstlisting}
\clearpage
\subsubsection{Continuations for Event-based Actors}
\lib supports continuations to enable chaining of send/receive statements.
The functions \lstinline^then^ returns a helper object offering the member function \lstinline^continue_with^, which takes a functor $f$ without arguments.
After receiving a message, $f$ is invoked if and only if the received messages was handled successfully, i.e., neither \lstinline^sync_failure^ nor \lstinline^sync_timeout^ occurred.
\begin{lstlisting}
void foo(event_based_actor* self) {
actor d_or_s = ...; // replies with either a double or a string
sync_send(d_or_s, atom("get")).then(
[=](double value) { /* functor f1 */ },
[=](const string& value) { /* functor f2*/ }
).continue_with([=] {
// this continuation is invoked in both cases
// *after* f1 or f2 is done, but *not* in case
// of sync_failure or sync_timeout
});
\end{lstlisting}
No preview for this file type
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment