EventManager.cc
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #include "EventManager.hh"
18 //#include "EventManager.ih"
19 
20 // Custom includes
21 #include <boost/lambda/lambda.hpp>
22 #include <boost/lambda/bind.hpp>
23 
24 //#include "EventManager.mpp"
25 #define prefix_
26 //-/////////////////////////////////////////////////////////////////////////////////////////////////
27 
28 //-/////////////////////////////////////////////////////////////////////////////////////////////////
29 // senf::ppi::EventManager
30 
31 //-/////////////////////////////////////////////////////////////////////////////////////////////////
32 // private members
33 
34 bool senf::ppi::EventManager::alive_ (false);
35 
36 prefix_ void senf::ppi::EventManager::destroyModule(module::Module & module)
37 {
38  using boost::lambda::_1;
39  namespace l = boost::lambda;
40 
41  registrations_.erase_if(l::bind(&detail::EventBindingBase::module_,_1) == &module);
42 }
43 
44 prefix_ void senf::ppi::EventManager::destroyEvent(EventDescriptor & event)
45 {
46  using boost::lambda::_1;
47  namespace l = boost::lambda;
48 
50  std::find_if(registrations_.begin(), registrations_.end(),
51  l::bind(&detail::EventBindingBase::descriptor_,_1) == &event)
52  == registrations_.end(),
53  "Internal failure: registrations still active while destroying event."
54  "Maybe you've put the SENF_PPI_MODULE macro in a superclass instead of"
55  "in the subclass?");
56 }
57 
58 //-/////////////////////////////////////////////////////////////////////////////////////////////////
59 #undef prefix_
60 //#include "EventManager.mpp"
61 
62 
63 // Local Variables:
64 // mode: c++
65 // fill-column: 100
66 // comment-column: 40
67 // c-file-style: "senf"
68 // indent-tabs-mode: nil
69 // ispell-local-dictionary: "american"
70 // compile-command: "scons -u test"
71 // End:
friend class EventDescriptor
EventManager public header.
#define prefix_
Definition: EventManager.cc:25
#define SENF_ASSERT(x, comment)