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
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef SC_FXVAL_OBSERVER_H
00037 #define SC_FXVAL_OBSERVER_H
00038
00039
00040 #include "systemc/datatypes/fx/sc_fxdefs.h"
00041
00042
00043 namespace sc_dt
00044 {
00045
00046
00047 class sc_fxval_observer;
00048 class sc_fxval_fast_observer;
00049
00050
00051 class sc_fxval;
00052 class sc_fxval_fast;
00053
00054
00055 #ifdef SC_ENABLE_OBSERVERS
00056
00057 #define SC_FXVAL_OBSERVER_CONSTRUCT_(object) \
00058 SC_OBSERVER_(object,sc_fxval_observer*,construct)
00059 #define SC_FXVAL_OBSERVER_DESTRUCT_(object) \
00060 SC_OBSERVER_(object,sc_fxval_observer*,destruct)
00061 #define SC_FXVAL_OBSERVER_READ_(object) \
00062 SC_OBSERVER_(object,sc_fxval_observer*,read)
00063 #define SC_FXVAL_OBSERVER_WRITE_(object) \
00064 SC_OBSERVER_(object,sc_fxval_observer*,write)
00065 #define SC_FXVAL_OBSERVER_DEFAULT_ \
00066 SC_OBSERVER_DEFAULT_(sc_fxval_observer)
00067
00068 #define SC_FXVAL_FAST_OBSERVER_CONSTRUCT_(object) \
00069 SC_OBSERVER_(object,sc_fxval_fast_observer*,construct)
00070 #define SC_FXVAL_FAST_OBSERVER_DESTRUCT_(object) \
00071 SC_OBSERVER_(object,sc_fxval_fast_observer*,destruct)
00072 #define SC_FXVAL_FAST_OBSERVER_READ_(object) \
00073 SC_OBSERVER_(object,sc_fxval_fast_observer*,read)
00074 #define SC_FXVAL_FAST_OBSERVER_WRITE_(object) \
00075 SC_OBSERVER_(object,sc_fxval_fast_observer*,write)
00076 #define SC_FXVAL_FAST_OBSERVER_DEFAULT_ \
00077 SC_OBSERVER_DEFAULT_(sc_fxval_fast_observer)
00078
00079 #else
00080
00081 #define SC_FXVAL_OBSERVER_CONSTRUCT_(object)
00082 #define SC_FXVAL_OBSERVER_DESTRUCT_(object)
00083 #define SC_FXVAL_OBSERVER_READ_(object)
00084 #define SC_FXVAL_OBSERVER_WRITE_(object)
00085 #define SC_FXVAL_OBSERVER_DEFAULT_
00086
00087 #define SC_FXVAL_FAST_OBSERVER_CONSTRUCT_(object)
00088 #define SC_FXVAL_FAST_OBSERVER_DESTRUCT_(object)
00089 #define SC_FXVAL_FAST_OBSERVER_READ_(object)
00090 #define SC_FXVAL_FAST_OBSERVER_WRITE_(object)
00091 #define SC_FXVAL_FAST_OBSERVER_DEFAULT_
00092
00093 #endif
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103 class sc_fxval_observer
00104 {
00105
00106 protected:
00107
00108 sc_fxval_observer() {}
00109 virtual ~sc_fxval_observer() {}
00110
00111 public:
00112
00113 virtual void construct( const sc_fxval& );
00114 virtual void destruct( const sc_fxval& );
00115 virtual void read( const sc_fxval& );
00116 virtual void write( const sc_fxval& );
00117
00118 static sc_fxval_observer* (*default_observer) ();
00119
00120 };
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 class sc_fxval_fast_observer
00131 {
00132
00133 protected:
00134
00135 sc_fxval_fast_observer() {}
00136 virtual ~sc_fxval_fast_observer() {}
00137
00138 public:
00139
00140 virtual void construct( const sc_fxval_fast& );
00141 virtual void destruct( const sc_fxval_fast& );
00142 virtual void read( const sc_fxval_fast& );
00143 virtual void write( const sc_fxval_fast& );
00144
00145 static sc_fxval_fast_observer* (*default_observer) ();
00146
00147 };
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 inline
00160 void
00161 sc_fxval_observer::construct( const sc_fxval& )
00162 {}
00163
00164 inline
00165 void
00166 sc_fxval_observer::destruct( const sc_fxval& )
00167 {}
00168
00169 inline
00170 void
00171 sc_fxval_observer::read( const sc_fxval& )
00172 {}
00173
00174 inline
00175 void
00176 sc_fxval_observer::write( const sc_fxval& )
00177 {}
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187 inline
00188 void
00189 sc_fxval_fast_observer::construct( const sc_fxval_fast& )
00190 {}
00191
00192 inline
00193 void
00194 sc_fxval_fast_observer::destruct( const sc_fxval_fast& )
00195 {}
00196
00197 inline
00198 void
00199 sc_fxval_fast_observer::read( const sc_fxval_fast& )
00200 {}
00201
00202 inline
00203 void
00204 sc_fxval_fast_observer::write( const sc_fxval_fast& )
00205 {}
00206
00207 }
00208
00209
00210 #endif
00211
00212