EventManager.cci
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 
14 /** \file
15  \brief EventManager inline non-template implementation */
16 
17 //#include "EventManager.ih"
18 
19 // Custom includes
20 #include <senf/Scheduler/Scheduler.hh>
21 
22 #define prefix_ inline
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 // senf::ppi::EventManager
27 
28 prefix_ bool senf::ppi::EventManager::alive()
29 {
30  return alive_;
31 }
32 
33 prefix_ senf::ppi::EventManager & senf::ppi::EventManager::instance()
34 {
35  static EventManager manager;
36  return manager;
37 }
38 
39 prefix_ senf::ClockService::clock_type const & senf::ppi::EventManager::now()
40 {
41  return scheduler::now();
42 }
43 
44 prefix_ senf::ClockService::clock_type const & senf::ppi::EventManager::time()
45 {
46  return eventTime_;
47 }
48 
49 //-/////////////////////////////////////////////////////////////////////////////////////////////////
50 // private members
51 
52 prefix_ senf::ppi::EventManager::EventManager()
53 {
54  alive_ = true;
55 }
56 
57 prefix_ senf::ppi::EventManager::~EventManager()
58 {
59  alive_ = false;
60 }
61 
62 prefix_ void senf::ppi::EventManager::eventTime(ClockService::clock_type const & time)
63 {
64  eventTime_ = time;
65 }
66 
67 //-/////////////////////////////////////////////////////////////////////////////////////////////////
68 #undef prefix_
69 
70 
71 // Local Variables:
72 // mode: c++
73 // fill-column: 100
74 // comment-column: 40
75 // c-file-style: "senf"
76 // indent-tabs-mode: nil
77 // ispell-local-dictionary: "american"
78 // compile-command: "scons -u test"
79 // End: