bd8e3e9b0ee83dc55711634f28537ad2255b4201
[senf.git] / Scheduler / Binding.cci
1 // $Id$
2 //
3 // Copyright (C) 2008 
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the
17 // Free Software Foundation, Inc.,
18 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20 /** \file
21     \brief Binding inline non-template implementation */
22
23 //#include "Binding.ih"
24
25 // Custom includes
26
27 #define prefix_ inline
28 ///////////////////////////////cci.p///////////////////////////////////////
29
30 prefix_ void senf::SchedulerBinding::enable()
31 {
32     if (! enabled_) {
33         senf::Scheduler::instance().add(fd_, cb_, eventMask_);
34         enabled_ = true;
35     }
36 }
37
38 prefix_ void senf::SchedulerBinding::disable()
39 {
40     if (enabled_) {
41         senf::Scheduler::instance().remove(fd_);
42         enabled_ = false;
43     }
44 }
45
46 prefix_ bool senf::SchedulerBinding::enabled()
47 {
48     return enabled_;
49 }
50
51 prefix_ senf::SchedulerBinding::~SchedulerBinding()
52 {
53     disable();
54 }
55
56 ///////////////////////////////cci.e///////////////////////////////////////
57 #undef prefix_
58
59 \f
60 // Local Variables:
61 // mode: c++
62 // fill-column: 100
63 // comment-column: 40
64 // c-file-style: "senf"
65 // indent-tabs-mode: nil
66 // ispell-local-dictionary: "american"
67 // compile-command: "scons -u test"
68 // End: