SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_fxnum_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_fxnum_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_fxnum_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_FXNUM_OBSERVER_H
48 #define SC_FXNUM_OBSERVER_H
49 
50 
52 
53 
54 namespace sc_dt
55 {
56 
57 // classes defined in this module
58 class sc_fxnum_observer;
59 class sc_fxnum_fast_observer;
60 
61 // forward class declarations
62 class sc_fxnum;
63 class sc_fxnum_fast;
64 
65 
66 #ifdef SC_ENABLE_OBSERVERS
67 
69 #define SC_FXNUM_OBSERVER_CONSTRUCT_(object) \
70  SC_OBSERVER_(object,sc_fxnum_observer*,construct)
71 
72 #define SC_FXNUM_OBSERVER_DESTRUCT_(object) \
73  SC_OBSERVER_(object,sc_fxnum_observer*,destruct)
74 
75 #define SC_FXNUM_OBSERVER_READ_(object) \
76  SC_OBSERVER_(object,sc_fxnum_observer*,read)
77 
78 #define SC_FXNUM_OBSERVER_WRITE_(object) \
79  SC_OBSERVER_(object,sc_fxnum_observer*,write)
80 #define SC_FXNUM_OBSERVER_DEFAULT_ \
81  SC_OBSERVER_DEFAULT_(sc_fxnum_observer)
82 
84 #define SC_FXNUM_FAST_OBSERVER_CONSTRUCT_(object) \
85  SC_OBSERVER_(object,sc_fxnum_fast_observer*,construct)
86 
87 #define SC_FXNUM_FAST_OBSERVER_DESTRUCT_(object) \
88  SC_OBSERVER_(object,sc_fxnum_fast_observer*,destruct)
89 
90 #define SC_FXNUM_FAST_OBSERVER_READ_(object) \
91  SC_OBSERVER_(object,sc_fxnum_fast_observer*,read)
92 
93 #define SC_FXNUM_FAST_OBSERVER_WRITE_(object) \
94  SC_OBSERVER_(object,sc_fxnum_fast_observer*,write)
95 #define SC_FXNUM_FAST_OBSERVER_DEFAULT_ \
96  SC_OBSERVER_DEFAULT_(sc_fxnum_fast_observer)
97 
98 #else
99 
101 #define SC_FXNUM_OBSERVER_CONSTRUCT_(object)
102 
103 #define SC_FXNUM_OBSERVER_DESTRUCT_(object)
104 
105 #define SC_FXNUM_OBSERVER_READ_(object)
106 
107 #define SC_FXNUM_OBSERVER_WRITE_(object)
108 #define SC_FXNUM_OBSERVER_DEFAULT_
109 
111 #define SC_FXNUM_FAST_OBSERVER_CONSTRUCT_(object)
112 
113 #define SC_FXNUM_FAST_OBSERVER_DESTRUCT_(object)
114 
115 #define SC_FXNUM_FAST_OBSERVER_READ_(object)
116 
117 #define SC_FXNUM_FAST_OBSERVER_WRITE_(object)
118 #define SC_FXNUM_FAST_OBSERVER_DEFAULT_
119 
120 #endif
121 
122 
130 {
131 
132 protected:
133 
135  virtual ~sc_fxnum_observer() {}
136 
137 public:
138 
139  virtual void construct( const sc_fxnum& );
140  virtual void destruct( const sc_fxnum& );
141  virtual void read( const sc_fxnum& );
142  virtual void write( const sc_fxnum& );
143 
144  static sc_fxnum_observer* (*default_observer) ();
145 
146 };
147 
148 
156 {
157 
158 protected:
159 
162 
163 public:
164 
165  virtual void construct( const sc_fxnum_fast& );
166  virtual void destruct( const sc_fxnum_fast& );
167  virtual void read( const sc_fxnum_fast& );
168  virtual void write( const sc_fxnum_fast& );
169 
170  static sc_fxnum_fast_observer* (*default_observer) ();
171 
172 };
173 
174 
175 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
176 
183 inline
184 void
186 {}
187 
188 inline
189 void
191 {}
192 
193 inline
194 void
196 {}
197 
198 inline
199 void
201 {}
202 
203 
210 inline
211 void
213 {}
214 
215 inline
216 void
218 {}
219 
220 inline
221 void
223 {}
224 
225 inline
226 void
228 {}
229 
230 } // namespace sc_dt
231 
232 
233 #endif
234 
235 // Taf!
Base class for the fixed-point types; limited precision.
Definition: sc_fxnum.h:991
Abstract base class for fixed-point types observers; limited precision.
Base class for the fixed-point types; arbitrary precision.
Definition: sc_fxnum.h:564
virtual void construct(const sc_fxnum_fast &)
virtual void read(const sc_fxnum &)
virtual void destruct(const sc_fxnum &)
Abstract base class for fixed-point types observers; arbitrary precision.
virtual void write(const sc_fxnum_fast &)
virtual void construct(const sc_fxnum &)
virtual void destruct(const sc_fxnum_fast &)
virtual void write(const sc_fxnum &)
virtual void read(const sc_fxnum_fast &)
#define SC_API
Definition: sc_cmnhdr.h:168