rc_sc_event.h

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 #ifndef RC_SC_EVENT_H_
00038 #define RC_SC_EVENT_H_
00039 
00040 #include "ReChannel/core/rc_reconfigurable.h"
00041 #include "ReChannel/core/rc_resettable.h"
00042 
00043 namespace ReChannel {
00044 
00048 class rc_sc_event
00049     : protected sc_prim_channel, virtual public rc_resettable
00050 {
00051 public:
00052     rc_sc_event()
00053         : sc_prim_channel(sc_gen_unique_name("_rc_sc_event"))
00054     {
00055         rc_register_resettable(*this, this->get_parent_object());
00056     }
00057 
00058     RC_ON_INIT_RESETTABLE() { }
00059 
00060     RC_ON_RESET()
00061         { p_event.cancel(); }
00062 
00063     inline void notify()
00064         { p_event.notify(); }
00065 
00066     inline void notify(const sc_time& t)
00067         { p_event.notify(t); }
00068 
00069     inline void notify(double t, sc_time_unit tu)
00070         { p_event.notify(t, tu); }
00071 
00072     inline void cancel()
00073         { p_event.cancel(); }
00074 
00075     inline sc_event_or_list& operator|(const sc_event& e) const
00076         { return p_event.operator|(e); }
00077 
00078     inline sc_event_and_list& operator&(const sc_event& e) const
00079         { return p_event.operator&(e); }
00080 
00081     operator sc_event&()
00082         { return p_event; }
00083 
00084     operator const sc_event&() const
00085         { return p_event; }
00086 
00087 private:
00088     sc_event p_event;
00089 };
00090 
00091 } // namespace ReChannel
00092 
00093 #endif //RC_SC_EVENT_H_
00094 
00095 //
00096 // $Id: rc_sc_event.h,v 1.7 2007/11/23 13:25:45 felke Exp $
00097 // $Source: /var/cvs/projekte/ReChannel-v2/src/ReChannel/components/rc_sc_event.h,v $
00098 //

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