rc_reset_channel_if.cpp

Go to the documentation of this file.
00001 // vim:set et sts=4 ts=4 tw=75 sw=4 ai ci cin cino=g0,t0:
00002 /*
00003  * Copyright (C) 2007, Technical Computer Science Group,
00004  *                     University of Bonn
00005  *
00006  * This file is part of the ReChannel library.
00007  *
00008  * The ReChannel library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License as
00010  * published by the Free Software Foundation; either version 2 of the
00011  * License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be
00014  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this library; see the file COPYING. If not, write to the
00020  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
00021  * Boston, MA 02110-1301, USA.
00022  *
00023  * Authors: Andreas Raabe and Armin Felke. Implementation by Armin Felke.
00024  *          {raabe, felke}@cs.uni-bonn.de
00025  */
00037 #include "rc_reset_channel_if.h"
00038 
00039 namespace ReChannel {
00040 
00041 namespace internals {
00042 
00043 void reset_signal::register_process_control(
00044     rc_process_control& pctrl, bool active_level) const
00045 {
00046     p_pctrl_set[(active_level ? 1 : 0)].insert(&pctrl);
00047 }
00048 
00049 void reset_signal::unregister_process_control(
00050     rc_process_control& pctrl) const
00051 {
00052     p_pctrl_set[0].erase(&pctrl);
00053     p_pctrl_set[1].erase(&pctrl);
00054 }
00055 
00056 void reset_signal::update()
00057 {
00058     base_type::update();
00059     pctrl_set& set_ = p_pctrl_set[(this->read() ? 1 : 0)];
00060     for (pctrl_set::iterator it = set_.begin();
00061         it != set_.end();
00062         ++it)
00063     {
00064         (*it)->deactivate();
00065     }
00066 }
00067 
00068 void reset_buffer::register_process_control(
00069     rc_process_control& pctrl, bool active_level) const
00070 {
00071     p_pctrl_set[(active_level ? 1 : 0)].insert(&pctrl);
00072 }
00073 
00074 void reset_buffer::unregister_process_control(
00075     rc_process_control& pctrl) const
00076 {
00077     p_pctrl_set[0].erase(&pctrl);
00078     p_pctrl_set[1].erase(&pctrl);
00079 }
00080 
00081 void reset_buffer::update()
00082 {
00083     base_type::update();
00084     pctrl_set& set_ = p_pctrl_set[(this->read() ? 1 : 0)];
00085     for (pctrl_set::iterator it = set_.begin();
00086         it != set_.end();
00087         ++it)
00088     {
00089         (*it)->deactivate();
00090     }
00091 }
00092 
00093 } // namespace internals
00094 
00095 } // namespace ReChannel
00096 //
00097 // $Id: rc_reset_channel_if.cpp,v 1.5 2007/10/09 21:47:01 felke Exp $
00098 // $Source: /var/cvs/projekte/ReChannel-v2/src/ReChannel/core/rc_reset_channel_if.cpp,v $
00099 //

Generated on Tue Jan 1 23:13:42 2008 for ReChannel by  doxygen 1.5.3