sc_fxnum_observer.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003   The following code is derived, directly or indirectly, from the SystemC
00004   source code Copyright (c) 1996-2006 by all Contributors.
00005   All Rights reserved.
00006 
00007   The contents of this file are subject to the restrictions and limitations
00008   set forth in the SystemC Open Source License Version 2.4 (the "License");
00009   You may not use this file except in compliance with such restrictions and
00010   limitations. You may obtain instructions on how to receive a copy of the
00011   License at http://www.systemc.org/. Software distributed by Contributors
00012   under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
00013   ANY KIND, either express or implied. See the License for the specific
00014   language governing rights and limitations under the License.
00015 
00016  *****************************************************************************/
00017 
00018 /*****************************************************************************
00019 
00020   sc_fxnum_observer.h - 
00021 
00022   Original Author: Martin Janssen, Synopsys, Inc.
00023 
00024  *****************************************************************************/
00025 
00026 /*****************************************************************************
00027 
00028   MODIFICATION LOG - modifiers, enter your name, affiliation, date and
00029   changes you are making here.
00030 
00031       Name, Affiliation, Date:
00032   Description of Modification:
00033 
00034  *****************************************************************************/
00035 
00036 // $Log: sc_fxnum_observer.h,v $
00037 // Revision 1.1.1.1  2006/12/15 20:31:36  acg
00038 // SystemC 2.2
00039 //
00040 // Revision 1.3  2006/01/13 18:53:58  acg
00041 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
00042 // the source.
00043 //
00044 
00045 #ifndef SC_FXNUM_OBSERVER_H
00046 #define SC_FXNUM_OBSERVER_H
00047 
00048 
00049 #include "sysc/datatypes/fx/sc_fxdefs.h"
00050 
00051 
00052 namespace sc_dt
00053 {
00054 
00055 // classes defined in this module
00056 class sc_fxnum_observer;
00057 class sc_fxnum_fast_observer;
00058 
00059 // forward class declarations
00060 class sc_fxnum;
00061 class sc_fxnum_fast;
00062 
00063 
00064 #ifdef SC_ENABLE_OBSERVERS
00065 
00066 #define SC_FXNUM_OBSERVER_CONSTRUCT_(object)                                  \
00067     SC_OBSERVER_(object,sc_fxnum_observer*,construct)
00068 #define SC_FXNUM_OBSERVER_DESTRUCT_(object)                                   \
00069     SC_OBSERVER_(object,sc_fxnum_observer*,destruct)
00070 #define SC_FXNUM_OBSERVER_READ_(object)                                       \
00071     SC_OBSERVER_(object,sc_fxnum_observer*,read)
00072 #define SC_FXNUM_OBSERVER_WRITE_(object)                                      \
00073     SC_OBSERVER_(object,sc_fxnum_observer*,write)
00074 #define SC_FXNUM_OBSERVER_DEFAULT_                                            \
00075     SC_OBSERVER_DEFAULT_(sc_fxnum_observer)
00076 
00077 #define SC_FXNUM_FAST_OBSERVER_CONSTRUCT_(object)                             \
00078     SC_OBSERVER_(object,sc_fxnum_fast_observer*,construct)
00079 #define SC_FXNUM_FAST_OBSERVER_DESTRUCT_(object)                              \
00080     SC_OBSERVER_(object,sc_fxnum_fast_observer*,destruct)
00081 #define SC_FXNUM_FAST_OBSERVER_READ_(object)                                  \
00082     SC_OBSERVER_(object,sc_fxnum_fast_observer*,read)
00083 #define SC_FXNUM_FAST_OBSERVER_WRITE_(object)                                 \
00084     SC_OBSERVER_(object,sc_fxnum_fast_observer*,write)
00085 #define SC_FXNUM_FAST_OBSERVER_DEFAULT_                                       \
00086     SC_OBSERVER_DEFAULT_(sc_fxnum_fast_observer)
00087 
00088 #else
00089 
00090 #define SC_FXNUM_OBSERVER_CONSTRUCT_(object)
00091 #define SC_FXNUM_OBSERVER_DESTRUCT_(object)
00092 #define SC_FXNUM_OBSERVER_READ_(object)
00093 #define SC_FXNUM_OBSERVER_WRITE_(object)
00094 #define SC_FXNUM_OBSERVER_DEFAULT_
00095 
00096 #define SC_FXNUM_FAST_OBSERVER_CONSTRUCT_(object)
00097 #define SC_FXNUM_FAST_OBSERVER_DESTRUCT_(object)
00098 #define SC_FXNUM_FAST_OBSERVER_READ_(object)
00099 #define SC_FXNUM_FAST_OBSERVER_WRITE_(object)
00100 #define SC_FXNUM_FAST_OBSERVER_DEFAULT_
00101 
00102 #endif
00103 
00104 
00105 // ----------------------------------------------------------------------------
00106 //  CLASS : sc_fxnum_observer
00107 //
00108 //  Abstract base class for fixed-point types observers; arbitrary precision.
00109 // ----------------------------------------------------------------------------
00110 
00111 class sc_fxnum_observer
00112 {
00113 
00114 protected:
00115     
00116     sc_fxnum_observer() {}
00117     virtual ~sc_fxnum_observer() {}
00118 
00119 public:
00120 
00121     virtual void construct( const sc_fxnum& );
00122     virtual void  destruct( const sc_fxnum& );
00123     virtual void      read( const sc_fxnum& );
00124     virtual void     write( const sc_fxnum& );
00125 
00126     static sc_fxnum_observer* (*default_observer) ();
00127 
00128 };
00129 
00130 
00131 // ----------------------------------------------------------------------------
00132 //  CLASS : sc_fxnum_fast_observer
00133 //
00134 //  Abstract base class for fixed-point types observers; limited precision.
00135 // ----------------------------------------------------------------------------
00136 
00137 class sc_fxnum_fast_observer
00138 {
00139 
00140 protected:
00141     
00142     sc_fxnum_fast_observer() {}
00143     virtual ~sc_fxnum_fast_observer() {}
00144 
00145 public:
00146 
00147     virtual void construct( const sc_fxnum_fast& );
00148     virtual void  destruct( const sc_fxnum_fast& );
00149     virtual void      read( const sc_fxnum_fast& );
00150     virtual void     write( const sc_fxnum_fast& );
00151 
00152     static sc_fxnum_fast_observer* (*default_observer) ();
00153 
00154 };
00155 
00156 
00157 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
00158 
00159 // ----------------------------------------------------------------------------
00160 //  CLASS : sc_fxnum_observer
00161 //
00162 //  Abstract base class for fixed-point types observers; arbitrary precision.
00163 // ----------------------------------------------------------------------------
00164 
00165 inline
00166 void
00167 sc_fxnum_observer::construct( const sc_fxnum& )
00168 {}
00169 
00170 inline
00171 void
00172 sc_fxnum_observer::destruct( const sc_fxnum& )
00173 {}
00174 
00175 inline
00176 void
00177 sc_fxnum_observer::read( const sc_fxnum& )
00178 {}
00179 
00180 inline
00181 void
00182 sc_fxnum_observer::write( const sc_fxnum& )
00183 {}
00184 
00185 
00186 // ----------------------------------------------------------------------------
00187 //  CLASS : sc_fxnum_fast_observer
00188 //
00189 //  Abstract base class for fixed-point types observers; limited precision.
00190 // ----------------------------------------------------------------------------
00191 
00192 inline
00193 void
00194 sc_fxnum_fast_observer::construct( const sc_fxnum_fast& )
00195 {}
00196 
00197 inline
00198 void
00199 sc_fxnum_fast_observer::destruct( const sc_fxnum_fast& )
00200 {}
00201 
00202 inline
00203 void
00204 sc_fxnum_fast_observer::read( const sc_fxnum_fast& )
00205 {}
00206 
00207 inline
00208 void
00209 sc_fxnum_fast_observer::write( const sc_fxnum_fast& )
00210 {}
00211 
00212 } // namespace sc_dt
00213 
00214 
00215 #endif
00216 
00217 // Taf!

Generated on Wed Jan 21 15:32:07 2009 for SystemC by  doxygen 1.5.5