YAMI4 C++
value_publisher_overflow_generic_dispatcher.h
1 // Copyright Maciej Sobczak 2008-2019.
2 // This file is part of YAMI4.
3 //
4 // YAMI4 is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // YAMI4 is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with YAMI4. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef YAMICPP_VALUE_PUBLISHER_OVERFLOW_GENERIC_DISPATCHER_H_INCLUDED
18 #define YAMICPP_VALUE_PUBLISHER_OVERFLOW_GENERIC_DISPATCHER_H_INCLUDED
19 
20 #include "value_publisher_overflow_dispatcher_base.h"
21 #include <yami4-core/dll.h>
22 
23 namespace yami
24 {
25 
26 namespace details
27 {
28 
29 template <typename functor>
30 class DLL value_publisher_overflow_generic_dispatcher
31  : public value_publisher_overflow_dispatcher_base
32 {
33 public:
34  value_publisher_overflow_generic_dispatcher(functor & f) : f_(f) {}
35 
36  virtual value_publisher_overflow_action dispatch(
37  const std::string & server_name,
38  const std::string & object_name,
39  const serializable & value)
40  {
41  return f_(server_name, object_name, value);
42  }
43 
44 private:
45  functor & f_;
46 };
47 
48 } // namespace details
49 
50 } // namespace yami
51 
52 #endif // YAMICPP_VALUE_PUBLISHER_OVERFLOW_GENERIC_DISPATCHER_H_INCLUDED
value_publisher_overflow_action
User-defined reaction to the overflow condition in value publisher.
Definition: value_publisher_overflow_action.h:24
Namespace devoted to everything related to YAMI4.
Definition: activity_statistics_monitor.cpp:27