Permalink
Browse files

added `skip_message` utility function

this utility function allows users to skip messages manually
  • Loading branch information...
Neverlord committed Feb 22, 2013
1 parent e896953 commit 71f28b45be15c174be9c2ddea18b946096817158
Showing with 51 additions and 7 deletions.
  1. +1 −0 CMakeLists.txt
  2. +14 −7 cppa/on.hpp
  3. +36 −0 src/on.cpp
View
@@ -133,6 +133,7 @@ set(LIBCPPA_SRC
src/middleman.cpp
src/object.cpp
src/object_array.cpp
+ src/on.cpp
src/opt.cpp
src/partial_function.cpp
src/primitive_variant.cpp
View
@@ -227,24 +227,29 @@ namespace cppa {
/**
* @brief A wildcard that matches the argument types
-* of a given callback. Must be the last argument to {@link on()}.
+ * of a given callback. Must be the last argument to {@link on()}.
* @see {@link math_actor_example.cpp Math Actor Example}
*/
-constexpr ___ arg_match;
+constexpr __unspecified__ arg_match;
/**
* @brief Left-hand side of a partial function expression.
*
* Equal to <tt>on(arg_match)</tt>.
*/
-constexpr ___ on_arg_match;
+constexpr __unspecified__ on_arg_match;
+
+/**
+ * @brief Right-hand side expression to *not* match a particular pattern.
+ */
+constexpr __unspecified__ skip_message;
/**
* @brief A wildcard that matches any value of type @p T.
* @see {@link math_actor_example.cpp Math Actor Example}
*/
template<typename T>
-___ val();
+__unspecified__ val();
/**
* @brief A wildcard that matches any number of any values.
@@ -259,7 +264,7 @@ constexpr anything any_vals;
* {@link cppa::any_vals any_vals} and {@link cppa::arg_match arg_match}.
*/
template<typename Arg0, typename... Args>
-___ on(const Arg0& arg0, const Args&... args);
+__unspecified__ on(const Arg0& arg0, const Args&... args);
/**
* @brief Left-hand side of a partial function expression that matches types.
@@ -268,7 +273,7 @@ ___ on(const Arg0& arg0, const Args&... args);
* can be used as wildcard to match any number of elements of any types.
*/
template<typename... Ts>
-___ on();
+__unspecified__ on();
/**
* @brief Left-hand side of a partial function expression that matches types.
@@ -278,10 +283,12 @@ ___ on();
* can be used as wildcard to match any number of elements of any types.
*/
template<atom_value... Atoms, typename... Ts>
-___ on();
+__unspecified__ on();
#else
+bool skip_message();
+
template<typename T>
constexpr typename detail::boxed<T>::type val() {
return typename detail::boxed<T>::type();
View
@@ -0,0 +1,36 @@
+/******************************************************************************\
+ * ___ __ *
+ * /\_ \ __/\ \ *
+ * \//\ \ /\_\ \ \____ ___ _____ _____ __ *
+ * \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
+ * \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
+ * /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
+ * \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
+ * \ \_\ \ \_\ *
+ * \/_/ \/_/ *
+ * *
+ * Copyright (C) 2011-2013 *
+ * Dominik Charousset <dominik.charousset@haw-hamburg.de> *
+ * *
+ * This file is part of libcppa. *
+ * libcppa is free software: you can redistribute it and/or modify it under *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License *
+ * or (at your option) any later version. *
+ * *
+ * libcppa is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
+ * See the GNU Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public License *
+ * along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
+\******************************************************************************/
+
+#include "cppa/on.hpp"
+
+namespace cppa {
+
+bool skip_message() { return false; }
+
+} // namespace cppa

0 comments on commit 71f28b4

Please sign in to comment.