00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00037 #ifndef RC_PORTAL_H_
00038 #define RC_PORTAL_H_
00039
00040 #include "ReChannel/communication/portals/rc_abstract_portal.h"
00041
00042 namespace ReChannel {
00043
00049 template<class PORT>
00050 class rc_portal
00051 : public rc_abstract_portal<PORT>
00052 {
00053 private:
00054 typedef rc_abstract_portal<PORT> base_type;
00055 public:
00056 typedef PORT port_type;
00057 typedef typename base_type::if_type if_type;
00058 typedef typename base_type::accessor_type accessor_type;
00059
00060 public:
00061 explicit rc_portal(
00062 const sc_module_name& module_name_ =
00063 sc_gen_unique_name("rc_portal"))
00064 : base_type(module_name_)
00065 { }
00066 };
00067
00068 }
00069
00070
00071
00072 #define RC_PORTAL(port_class_name) \
00073 template<> \
00074 struct rc_portal<port_class_name > \
00075 : public rc_abstract_portal<port_class_name >
00076
00077 #define RC_PORTAL_TEMPLATE(port_class_name) \
00078 struct rc_portal<port_class_name > \
00079 : public rc_abstract_portal<port_class_name >
00080
00081 #define RC_PORTAL_CTOR(port_class_name) \
00082 typedef port_class_name port_type; \
00083 typedef rc_abstract_portal<port_class_name >::if_type if_type; \
00084 typedef rc_abstract_portal<port_class_name >::accessor_type \
00085 accessor_type; \
00086 explicit rc_portal(const sc_module_name& module_name_ \
00087 = sc_gen_unique_name("rc_portal")) \
00088 : rc_abstract_portal<port_class_name >(module_name_)
00089
00090 #define RC_PORTAL_TEMPLATE_CTOR(port_class_name) \
00091 typedef port_class_name port_type; \
00092 typedef typename rc_abstract_portal<port_class_name >::if_type \
00093 if_type; \
00094 typedef typename rc_abstract_portal<port_class_name >::accessor_type \
00095 accessor_type; \
00096 explicit rc_portal(const sc_module_name& module_name_ \
00097 = sc_gen_unique_name("rc_portal")) \
00098 : rc_abstract_portal<port_class_name >(module_name_)
00099
00100
00101
00102
00103 #define RC_PORTAL_FORWARD_EVENT(event_method_name) \
00104 this->add_event_forwarder( \
00105 &if_type::event_method_name, #event_method_name)
00106
00107 #endif // RC_PORTAL_H_
00108
00109
00110
00111