rc_exportal.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_EXPORTAL_H_
00038 #define RC_EXPORTAL_H_
00039 
00040 #include "ReChannel/communication/exportals/rc_abstract_exportal.h"
00041 
00042 namespace ReChannel {
00043 
00049 template<class IF>
00050 class rc_exportal
00051     : public rc_abstract_exportal<IF>
00052 {
00053 public:
00054     typedef IF              if_type;
00055     typedef rc_accessor<IF> accessor_type;
00056 
00057 private:
00058     rc_exportal();
00059     explicit rc_exportal(const sc_module_name& module_name_);
00060 };
00061 
00062 } // namespace ReChannel
00063 
00064 /* exportal construction macros */
00065 
00066 #define RC_EXPORTAL(interface_name) \
00067     template<> \
00068     struct rc_exportal<interface_name > \
00069         : public rc_abstract_exportal<interface_name >
00070 
00071 #define RC_EXPORTAL_TEMPLATE(interface_name) \
00072     struct rc_exportal<interface_name > \
00073         : public rc_abstract_exportal<interface_name >
00074 
00075 #define RC_EXPORTAL_CTOR(interface_name) \
00076     typedef interface_name if_type; \
00077     typedef rc_accessor<interface_name > accessor_type; \
00078     explicit rc_exportal( \
00079         const sc_module_name& module_name_ \
00080         = sc_gen_unique_name("rc_exportal")) \
00081         : rc_abstract_exportal<interface_name >(module_name_)
00082 
00083 #define RC_EXPORTAL_TEMPLATE_CTOR(interface_name) \
00084     RC_EXPORTAL_CTOR(interface_name)
00085 
00086 // note: using this macro requires the definition of 
00087 //       the typedef 'if_type' at class scope
00088 //       or the use of RC_EXPORTAL_CTOR
00089 #define RC_EXPORTAL_FORWARD_EVENT(event_method_name) \
00090     this->add_event_forwarder( \
00091         &if_type::event_method_name, #event_method_name)
00092 
00093 #endif // RC_EXPORTAL_H_
00094 //
00095 // $Id: rc_exportal.h,v 1.6 2007/11/23 13:24:55 felke Exp $
00096 // $Source: /var/cvs/projekte/ReChannel-v2/src/ReChannel/communication/exportals/rc_exportal.h,v $
00097 //

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