SystemC  2.3.1
Accellera SystemC proof-of-concept library
sc_fxval_observer.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  *****************************************************************************/
17 
18 /*****************************************************************************
19 
20  sc_fxval_observer.h -
21 
22  Original Author: Martin Janssen, Synopsys, Inc.
23 
24  *****************************************************************************/
25 
26 /*****************************************************************************
27 
28  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
29  changes you are making here.
30 
31  Name, Affiliation, Date:
32  Description of Modification:
33 
34  *****************************************************************************/
35 
36 // $Log: sc_fxval_observer.h,v $
37 // Revision 1.1.1.1 2006/12/15 20:20:04 acg
38 // SystemC 2.3
39 //
40 // Revision 1.3 2006/01/13 18:53:58 acg
41 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
42 // the source.
43 //
44 
45 #ifndef SC_FXVAL_OBSERVER_H
46 #define SC_FXVAL_OBSERVER_H
47 
48 
50 
51 
52 namespace sc_dt
53 {
54 
55 // classes defined in this module
56 class sc_fxval_observer;
57 class sc_fxval_fast_observer;
58 
59 // forward class declarations
60 class sc_fxval;
61 class sc_fxval_fast;
62 
63 
64 #ifdef SC_ENABLE_OBSERVERS
65 
66 #define SC_FXVAL_OBSERVER_CONSTRUCT_(object) \
67  SC_OBSERVER_(object,sc_fxval_observer*,construct)
68 #define SC_FXVAL_OBSERVER_DESTRUCT_(object) \
69  SC_OBSERVER_(object,sc_fxval_observer*,destruct)
70 #define SC_FXVAL_OBSERVER_READ_(object) \
71  SC_OBSERVER_(object,sc_fxval_observer*,read)
72 #define SC_FXVAL_OBSERVER_WRITE_(object) \
73  SC_OBSERVER_(object,sc_fxval_observer*,write)
74 #define SC_FXVAL_OBSERVER_DEFAULT_ \
75  SC_OBSERVER_DEFAULT_(sc_fxval_observer)
76 
77 #define SC_FXVAL_FAST_OBSERVER_CONSTRUCT_(object) \
78  SC_OBSERVER_(object,sc_fxval_fast_observer*,construct)
79 #define SC_FXVAL_FAST_OBSERVER_DESTRUCT_(object) \
80  SC_OBSERVER_(object,sc_fxval_fast_observer*,destruct)
81 #define SC_FXVAL_FAST_OBSERVER_READ_(object) \
82  SC_OBSERVER_(object,sc_fxval_fast_observer*,read)
83 #define SC_FXVAL_FAST_OBSERVER_WRITE_(object) \
84  SC_OBSERVER_(object,sc_fxval_fast_observer*,write)
85 #define SC_FXVAL_FAST_OBSERVER_DEFAULT_ \
86  SC_OBSERVER_DEFAULT_(sc_fxval_fast_observer)
87 
88 #else
89 
90 #define SC_FXVAL_OBSERVER_CONSTRUCT_(object)
91 #define SC_FXVAL_OBSERVER_DESTRUCT_(object)
92 #define SC_FXVAL_OBSERVER_READ_(object)
93 #define SC_FXVAL_OBSERVER_WRITE_(object)
94 #define SC_FXVAL_OBSERVER_DEFAULT_
95 
96 #define SC_FXVAL_FAST_OBSERVER_CONSTRUCT_(object)
97 #define SC_FXVAL_FAST_OBSERVER_DESTRUCT_(object)
98 #define SC_FXVAL_FAST_OBSERVER_READ_(object)
99 #define SC_FXVAL_FAST_OBSERVER_WRITE_(object)
100 #define SC_FXVAL_FAST_OBSERVER_DEFAULT_
101 
102 #endif
103 
104 
105 // ----------------------------------------------------------------------------
106 // CLASS : sc_fxval_observer
107 //
108 // Abstract base class for fixed-point value type observers;
109 // arbitrary precision.
110 // ----------------------------------------------------------------------------
111 
113 {
114 
115 protected:
116 
118  virtual ~sc_fxval_observer() {}
119 
120 public:
121 
122  virtual void construct( const sc_fxval& );
123  virtual void destruct( const sc_fxval& );
124  virtual void read( const sc_fxval& );
125  virtual void write( const sc_fxval& );
126 
127  static sc_fxval_observer* (*default_observer) ();
128 
129 };
130 
131 
132 // ----------------------------------------------------------------------------
133 // CLASS : sc_fxval_fast_observer
134 //
135 // Abstract base class for fixed-point value type observers;
136 // limited precision.
137 // ----------------------------------------------------------------------------
138 
140 {
141 
142 protected:
143 
146 
147 public:
148 
149  virtual void construct( const sc_fxval_fast& );
150  virtual void destruct( const sc_fxval_fast& );
151  virtual void read( const sc_fxval_fast& );
152  virtual void write( const sc_fxval_fast& );
153 
154  static sc_fxval_fast_observer* (*default_observer) ();
155 
156 };
157 
158 
159 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
160 
161 // ----------------------------------------------------------------------------
162 // CLASS : sc_fxval_observer
163 //
164 // Abstract base class for fixed-point value type observers;
165 // arbitrary precision.
166 // ----------------------------------------------------------------------------
167 
168 inline
169 void
171 {}
172 
173 inline
174 void
176 {}
177 
178 inline
179 void
181 {}
182 
183 inline
184 void
186 {}
187 
188 
189 // ----------------------------------------------------------------------------
190 // CLASS : sc_fxval_fast_observer
191 //
192 // Abstract base class for fixed-point value type observers;
193 // limited precision.
194 // ----------------------------------------------------------------------------
195 
196 inline
197 void
199 {}
200 
201 inline
202 void
204 {}
205 
206 inline
207 void
209 {}
210 
211 inline
212 void
214 {}
215 
216 } // namespace sc_dt
217 
218 
219 #endif
220 
221 // Taf!
virtual void construct(const sc_fxval &)
virtual void construct(const sc_fxval_fast &)
virtual void destruct(const sc_fxval_fast &)
virtual void read(const sc_fxval_fast &)
virtual void read(const sc_fxval &)
virtual void write(const sc_fxval &)
virtual void write(const sc_fxval_fast &)
virtual void destruct(const sc_fxval &)