00001 // $Id: RateFilter.cc 1772 2011-03-10 12:45:21Z tho $ 00002 // 00003 // Copyright (C) 2007 00004 // Fraunhofer (FOKUS) 00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY 00006 // Stefan Bund <g0dil@berlios.de> 00007 // 00008 // This program is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation; either version 2 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with this program; if not, write to the 00020 // Free Software Foundation, Inc., 00021 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 00026 #include "RateFilter.hh" 00027 //#include "RateFilter.ih" 00028 00029 // Custom includes 00030 00031 //#include "RateFilter.mpp" 00032 #define prefix_ 00033 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00034 00035 prefix_ senf::ppi::module::RateFilter::RateFilter(ClockService::clock_type interval) 00036 : timer_(interval) 00037 { 00038 route(input, timer_); 00039 route(timer_, output); 00040 registerEvent(timer_, &RateFilter::timeout); 00041 } 00042 00043 prefix_ void senf::ppi::module::RateFilter::timeout() 00044 { 00045 output(input()); 00046 } 00047 00048 prefix_ senf::ClockService::clock_type senf::ppi::module::RateFilter::interval() 00049 const 00050 { 00051 return timer_.interval().first; 00052 } 00053 00054 prefix_ void senf::ppi::module::RateFilter::interval(ClockService::clock_type interval) 00055 { 00056 timer_.interval(interval); 00057 } 00058 00059 00060 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00061 #undef prefix_ 00062 //#include "RateFilter.mpp" 00063 00064 00065 // Local Variables: 00066 // mode: c++ 00067 // fill-column: 100 00068 // comment-column: 40 00069 // c-file-style: "senf" 00070 // indent-tabs-mode: nil 00071 // ispell-local-dictionary: "american" 00072 // compile-command: "scons -u test" 00073 // End: