Missing changes from last commit
[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_ senf::SchedulerBinding::~SchedulerBinding()
31 {
32     disable();
33 }
34
35 prefix_ void senf::SchedulerBinding::enable()
36 {
37     if (! enabled_) {
38         senf::Scheduler::instance().add(fd_, cb_, eventMask_);
39         enabled_ = true;
40     }
41 }
42
43 prefix_ void senf::SchedulerBinding::disable()
44 {
45     if (enabled_) {
46         senf::Scheduler::instance().remove(fd_);
47         enabled_ = false;
48     }
49 }
50
51 prefix_ bool senf::SchedulerBinding::enabled()
52 {
53     return enabled_;
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: