SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_fxval_observer.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements. See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied. See the License for the specific language governing
16  permissions and limitations under the License.
17 
18  *****************************************************************************/
19 
20 /*****************************************************************************
21 
22  sc_fxval_observer.h -
23 
24  Original Author: Martin Janssen, Synopsys, Inc.
25 
26  *****************************************************************************/
27 
28 /*****************************************************************************
29 
30  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
31  changes you are making here.
32 
33  Name, Affiliation, Date:
34  Description of Modification:
35 
36  *****************************************************************************/
37 
38 // $Log: sc_fxval_observer.h,v $
39 // Revision 1.1.1.1 2006/12/15 20:20:04 acg
40 // SystemC 2.3
41 //
42 // Revision 1.3 2006/01/13 18:53:58 acg
43 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
44 // the source.
45 //
46 
47 #ifndef SC_FXVAL_OBSERVER_H
48 #define SC_FXVAL_OBSERVER_H
49 
50 
52 
53 
54 namespace sc_dt
55 {
56 
57 // classes defined in this module
58 class sc_fxval_observer;
59 class sc_fxval_fast_observer;
60 
61 // forward class declarations
62 class sc_fxval;
63 class sc_fxval_fast;
64 
65 
66 #ifdef SC_ENABLE_OBSERVERS
67 
69 #define SC_FXVAL_OBSERVER_CONSTRUCT_(object) \
70  SC_OBSERVER_(object,sc_fxval_observer*,construct)
71 
72 #define SC_FXVAL_OBSERVER_DESTRUCT_(object) \
73  SC_OBSERVER_(object,sc_fxval_observer*,destruct)
74 
75 #define SC_FXVAL_OBSERVER_READ_(object) \
76  SC_OBSERVER_(object,sc_fxval_observer*,read)
77 
78 #define SC_FXVAL_OBSERVER_WRITE_(object) \
79  SC_OBSERVER_(object,sc_fxval_observer*,write)
80 #define SC_FXVAL_OBSERVER_DEFAULT_ \
81  SC_OBSERVER_DEFAULT_(sc_fxval_observer)
82 
84 #define SC_FXVAL_FAST_OBSERVER_CONSTRUCT_(object) \
85  SC_OBSERVER_(object,sc_fxval_fast_observer*,construct)
86 
87 #define SC_FXVAL_FAST_OBSERVER_DESTRUCT_(object) \
88  SC_OBSERVER_(object,sc_fxval_fast_observer*,destruct)
89 
90 #define SC_FXVAL_FAST_OBSERVER_READ_(object) \
91  SC_OBSERVER_(object,sc_fxval_fast_observer*,read)
92 
93 #define SC_FXVAL_FAST_OBSERVER_WRITE_(object) \
94  SC_OBSERVER_(object,sc_fxval_fast_observer*,write)
95 #define SC_FXVAL_FAST_OBSERVER_DEFAULT_ \
96  SC_OBSERVER_DEFAULT_(sc_fxval_fast_observer)
97 
98 #else
99 
101 #define SC_FXVAL_OBSERVER_CONSTRUCT_(object)
102 
103 #define SC_FXVAL_OBSERVER_DESTRUCT_(object)
104 
105 #define SC_FXVAL_OBSERVER_READ_(object)
106 
107 #define SC_FXVAL_OBSERVER_WRITE_(object)
108 #define SC_FXVAL_OBSERVER_DEFAULT_
109 
111 #define SC_FXVAL_FAST_OBSERVER_CONSTRUCT_(object)
112 
113 #define SC_FXVAL_FAST_OBSERVER_DESTRUCT_(object)
114 
115 #define SC_FXVAL_FAST_OBSERVER_READ_(object)
116 
117 #define SC_FXVAL_FAST_OBSERVER_WRITE_(object)
118 #define SC_FXVAL_FAST_OBSERVER_DEFAULT_
119 
120 #endif
121 
122 
131 {
132 
133 protected:
134 
136  virtual ~sc_fxval_observer() {}
137 
138 public:
139 
140  virtual void construct( const sc_fxval& );
141  virtual void destruct( const sc_fxval& );
142  virtual void read( const sc_fxval& );
143  virtual void write( const sc_fxval& );
144 
145  static sc_fxval_observer* (*default_observer) ();
146 
147 };
148 
149 
158 {
159 
160 protected:
161 
164 
165 public:
166 
167  virtual void construct( const sc_fxval_fast& );
168  virtual void destruct( const sc_fxval_fast& );
169  virtual void read( const sc_fxval_fast& );
170  virtual void write( const sc_fxval_fast& );
171 
172  static sc_fxval_fast_observer* (*default_observer) ();
173 
174 };
175 
176 
177 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
178 
186 inline
187 void
189 {}
190 
191 inline
192 void
194 {}
195 
196 inline
197 void
199 {}
200 
201 inline
202 void
204 {}
205 
206 
214 inline
215 void
217 {}
218 
219 inline
220 void
222 {}
223 
224 inline
225 void
227 {}
228 
229 inline
230 void
232 {}
233 
234 } // namespace sc_dt
235 
236 
237 #endif
238 
239 // Taf!
virtual void construct(const sc_fxval &)
virtual void write(const sc_fxval_fast &)
virtual void read(const sc_fxval_fast &)
Fixed-point value types; limited precision.
Definition: sc_fxval.h:439
Abstract base class for fixed-point value type observers;.
Fixed-point value type; arbitrary precision.
Definition: sc_fxval.h:95
virtual void destruct(const sc_fxval &)
Abstract base class for fixed-point value type observers;.
virtual void destruct(const sc_fxval_fast &)
virtual void write(const sc_fxval &)
virtual void construct(const sc_fxval_fast &)
virtual void read(const sc_fxval &)
#define SC_API
Definition: sc_cmnhdr.h:168