rc_accessor.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_ACCESSOR_H_
00038 #define RC_ACCESSOR_H_
00039 
00040 #include "ReChannel/communication/accessors/rc_abstract_accessor.h"
00041 
00042 namespace ReChannel {
00043 
00049 template<class IF>
00050 class rc_accessor
00051     : public rc_abstract_accessor<IF>
00052 {
00053 public:
00054     typedef IF if_type;
00055 
00056 private:
00057     rc_accessor();
00058 };
00059 
00060 } // namespace ReChannel
00061 
00062 #define RC_ACCESSOR(interface_type) \
00063     template<> \
00064     struct rc_accessor<interface_type > \
00065         : public rc_abstract_accessor<interface_type > \
00066 
00067 #define RC_ACCESSOR_TEMPLATE(interface_type) \
00068     struct rc_accessor<interface_type > \
00069         : public rc_abstract_accessor<interface_type > \
00070 
00071 #define RC_ACCESSOR_CTOR(interface_type) \
00072     typedef interface_type if_type; \
00073     rc_accessor() \
00074         : rc_abstract_accessor<if_type >()
00075 
00076 #define RC_ACCESSOR_TEMPLATE_CTOR(interface_type) \
00077     RC_ACCESSOR_CTOR(interface_type)
00078 
00079 #define RC_ON_TARGET_CHANGED() \
00080     virtual void rc_on_target_changed()
00081 
00082 #define _RECHANNEL_EVENT_MEMBER(event_method_name) \
00083     _rc_p_event_##event_method_name
00084 
00085 #define RC_EVENT(event_method_name) \
00086     virtual const sc_event& event_method_name() const \
00087     { \
00088         return _RECHANNEL_EVENT_MEMBER(event_method_name); \
00089     } \
00090 private: \
00091     sc_event _RECHANNEL_EVENT_MEMBER(event_method_name); \
00092 public: \
00093     /*dummy*/typedef sc_event _rc_event_dummy_##event_method_name##_type
00094 
00095 #define RC_EVENT_ALIAS(event_method_name, alias) \
00096     virtual const sc_event& alias() const \
00097     { \
00098         return this->event_method_name(); \
00099     } \
00100     /*dummy*/typedef sc_event _rc_event_dummy_##alias##_type
00101 
00102 #endif // RC_ACCESSOR_H_
00103 
00104 //
00105 // $Id: rc_accessor.h,v 1.4 2007/11/23 13:24:55 felke Exp $
00106 // $Source: /var/cvs/projekte/ReChannel-v2/src/ReChannel/communication/accessors/rc_accessor.h,v $
00107 //

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