sc_fxval_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_fxval_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_fxval_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_FXVAL_OBSERVER_H
00046 #define SC_FXVAL_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_fxval_observer;
00057 class sc_fxval_fast_observer;
00058 
00059 // forward class declarations
00060 class sc_fxval;
00061 class sc_fxval_fast;
00062 
00063 
00064 #ifdef SC_ENABLE_OBSERVERS
00065 
00066 #define SC_FXVAL_OBSERVER_CONSTRUCT_(object)                                  \
00067     SC_OBSERVER_(object,sc_fxval_observer*,construct)
00068 #define SC_FXVAL_OBSERVER_DESTRUCT_(object)                                   \
00069     SC_OBSERVER_(object,sc_fxval_observer*,destruct)
00070 #define SC_FXVAL_OBSERVER_READ_(object)                                       \
00071     SC_OBSERVER_(object,sc_fxval_observer*,read)
00072 #define SC_FXVAL_OBSERVER_WRITE_(object)                                      \
00073     SC_OBSERVER_(object,sc_fxval_observer*,write)
00074 #define SC_FXVAL_OBSERVER_DEFAULT_                                            \
00075     SC_OBSERVER_DEFAULT_(sc_fxval_observer)
00076 
00077 #define SC_FXVAL_FAST_OBSERVER_CONSTRUCT_(object)                             \
00078     SC_OBSERVER_(object,sc_fxval_fast_observer*,construct)
00079 #define SC_FXVAL_FAST_OBSERVER_DESTRUCT_(object)                              \
00080     SC_OBSERVER_(object,sc_fxval_fast_observer*,destruct)
00081 #define SC_FXVAL_FAST_OBSERVER_READ_(object)                                  \
00082     SC_OBSERVER_(object,sc_fxval_fast_observer*,read)
00083 #define SC_FXVAL_FAST_OBSERVER_WRITE_(object)                                 \
00084     SC_OBSERVER_(object,sc_fxval_fast_observer*,write)
00085 #define SC_FXVAL_FAST_OBSERVER_DEFAULT_                                       \
00086     SC_OBSERVER_DEFAULT_(sc_fxval_fast_observer)
00087 
00088 #else
00089 
00090 #define SC_FXVAL_OBSERVER_CONSTRUCT_(object)
00091 #define SC_FXVAL_OBSERVER_DESTRUCT_(object)
00092 #define SC_FXVAL_OBSERVER_READ_(object)
00093 #define SC_FXVAL_OBSERVER_WRITE_(object)
00094 #define SC_FXVAL_OBSERVER_DEFAULT_
00095 
00096 #define SC_FXVAL_FAST_OBSERVER_CONSTRUCT_(object)
00097 #define SC_FXVAL_FAST_OBSERVER_DESTRUCT_(object)
00098 #define SC_FXVAL_FAST_OBSERVER_READ_(object)
00099 #define SC_FXVAL_FAST_OBSERVER_WRITE_(object)
00100 #define SC_FXVAL_FAST_OBSERVER_DEFAULT_
00101 
00102 #endif
00103 
00104 
00105 // ----------------------------------------------------------------------------
00106 //  CLASS : sc_fxval_observer
00107 //
00108 //  Abstract base class for fixed-point value type observers;
00109 //  arbitrary precision.
00110 // ----------------------------------------------------------------------------
00111 
00112 class sc_fxval_observer
00113 {
00114 
00115 protected:
00116     
00117     sc_fxval_observer() {}
00118     virtual ~sc_fxval_observer() {}
00119 
00120 public:
00121 
00122     virtual void construct( const sc_fxval& );
00123     virtual void  destruct( const sc_fxval& );
00124     virtual void      read( const sc_fxval& );
00125     virtual void     write( const sc_fxval& );
00126 
00127     static sc_fxval_observer* (*default_observer) ();
00128 
00129 };
00130 
00131 
00132 // ----------------------------------------------------------------------------
00133 //  CLASS : sc_fxval_fast_observer
00134 //
00135 //  Abstract base class for fixed-point value type observers;
00136 //  limited precision.
00137 // ----------------------------------------------------------------------------
00138 
00139 class sc_fxval_fast_observer
00140 {
00141 
00142 protected:
00143     
00144     sc_fxval_fast_observer() {}
00145     virtual ~sc_fxval_fast_observer() {}
00146 
00147 public:
00148 
00149     virtual void construct( const sc_fxval_fast& );
00150     virtual void  destruct( const sc_fxval_fast& );
00151     virtual void      read( const sc_fxval_fast& );
00152     virtual void     write( const sc_fxval_fast& );
00153 
00154     static sc_fxval_fast_observer* (*default_observer) ();
00155 
00156 };
00157 
00158 
00159 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
00160 
00161 // ----------------------------------------------------------------------------
00162 //  CLASS : sc_fxval_observer
00163 //
00164 //  Abstract base class for fixed-point value type observers;
00165 //  arbitrary precision.
00166 // ----------------------------------------------------------------------------
00167 
00168 inline
00169 void
00170 sc_fxval_observer::construct( const sc_fxval& )
00171 {}
00172 
00173 inline
00174 void
00175 sc_fxval_observer::destruct( const sc_fxval& )
00176 {}
00177 
00178 inline
00179 void
00180 sc_fxval_observer::read( const sc_fxval& )
00181 {}
00182 
00183 inline
00184 void
00185 sc_fxval_observer::write( const sc_fxval& )
00186 {}
00187 
00188 
00189 // ----------------------------------------------------------------------------
00190 //  CLASS : sc_fxval_fast_observer
00191 //
00192 //  Abstract base class for fixed-point value type observers;
00193 //  limited precision.
00194 // ----------------------------------------------------------------------------
00195 
00196 inline
00197 void
00198 sc_fxval_fast_observer::construct( const sc_fxval_fast& )
00199 {}
00200 
00201 inline
00202 void
00203 sc_fxval_fast_observer::destruct( const sc_fxval_fast& )
00204 {}
00205 
00206 inline
00207 void
00208 sc_fxval_fast_observer::read( const sc_fxval_fast& )
00209 {}
00210 
00211 inline
00212 void
00213 sc_fxval_fast_observer::write( const sc_fxval_fast& )
00214 {}
00215 
00216 } // namespace sc_dt
00217 
00218 
00219 #endif
00220 
00221 // Taf!

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