rc_fifo_exportals.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  */
00039 #ifndef RC_FIFO_EXPORTALS_H_
00040 #define RC_FIFO_EXPORTALS_H_
00041 
00042 #include "ReChannel/communication/exportals/rc_exportal.h"
00043 #include "ReChannel/communication/accessors/rc_fifo_accessors.h"
00044 
00045 namespace ReChannel {
00046 
00050 template<class T>
00051 RC_EXPORTAL_TEMPLATE(sc_fifo_in_if<T>)
00052 {
00053     RC_EXPORTAL_TEMPLATE_CTOR(sc_fifo_in_if<T>)
00054     {
00055         RC_EXPORTAL_FORWARD_EVENT(data_written_event);
00056     }
00057 
00058     RC_ON_OPEN()
00059     {
00060         this->refresh_notify();
00061     }
00062 
00063     RC_ON_REFRESH_NOTIFY()
00064     {
00065         if_type* const interface_ = this->get_interface();
00066         if (interface_ != NULL) {
00067             if (interface_->num_available() > 0) {
00068                 this->notify_event("data_written_event");
00069             }
00070         }
00071     }
00072 };
00073 
00077 template<class T>
00078 RC_EXPORTAL_TEMPLATE(sc_fifo_out_if<T>)
00079 {
00080     RC_EXPORTAL_TEMPLATE_CTOR(sc_fifo_out_if<T>)
00081     {
00082         RC_EXPORTAL_FORWARD_EVENT(data_read_event);
00083     }
00084 
00085     RC_ON_OPEN()
00086     {
00087         this->refresh_notify();
00088     }
00089 
00090     RC_ON_REFRESH_NOTIFY()
00091     {
00092         if_type* const interface_ = this->get_interface();
00093         if (interface_ != NULL) {
00094             if (interface_->num_free() > 0) {
00095                 this->notify_event("data_read_event");
00096             }
00097         }
00098     }
00099 };
00100 
00101 } // namespace ReChannel
00102 
00103 #endif // RC_FIFO_EXPORTALS_H_
00104 //
00105 // $Id: rc_fifo_exportals.h,v 1.6 2007/11/23 13:24:55 felke Exp $
00106 // $Source: /var/cvs/projekte/ReChannel-v2/src/ReChannel/communication/exportals/rc_fifo_exportals.h,v $
00107 //
00108 

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