SystemC  Recoding Infrastructure for SystemC v0.6.2 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
sc_fxnum_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_fxnum_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_fxnum_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_FXNUM_OBSERVER_H
46 #define SC_FXNUM_OBSERVER_H
47 
48 
50 
51 
52 namespace sc_dt
53 {
54 
55 // classes defined in this module
56 class sc_fxnum_observer;
57 class sc_fxnum_fast_observer;
58 
59 // forward class declarations
60 class sc_fxnum;
61 class sc_fxnum_fast;
62 
63 
64 #ifdef SC_ENABLE_OBSERVERS
65 
66 #define SC_FXNUM_OBSERVER_CONSTRUCT_(object) \
67  SC_OBSERVER_(object,sc_fxnum_observer*,construct)
68 #define SC_FXNUM_OBSERVER_DESTRUCT_(object) \
69  SC_OBSERVER_(object,sc_fxnum_observer*,destruct)
70 #define SC_FXNUM_OBSERVER_READ_(object) \
71  SC_OBSERVER_(object,sc_fxnum_observer*,read)
72 #define SC_FXNUM_OBSERVER_WRITE_(object) \
73  SC_OBSERVER_(object,sc_fxnum_observer*,write)
74 #define SC_FXNUM_OBSERVER_DEFAULT_ \
75  SC_OBSERVER_DEFAULT_(sc_fxnum_observer)
76 
77 #define SC_FXNUM_FAST_OBSERVER_CONSTRUCT_(object) \
78  SC_OBSERVER_(object,sc_fxnum_fast_observer*,construct)
79 #define SC_FXNUM_FAST_OBSERVER_DESTRUCT_(object) \
80  SC_OBSERVER_(object,sc_fxnum_fast_observer*,destruct)
81 #define SC_FXNUM_FAST_OBSERVER_READ_(object) \
82  SC_OBSERVER_(object,sc_fxnum_fast_observer*,read)
83 #define SC_FXNUM_FAST_OBSERVER_WRITE_(object) \
84  SC_OBSERVER_(object,sc_fxnum_fast_observer*,write)
85 #define SC_FXNUM_FAST_OBSERVER_DEFAULT_ \
86  SC_OBSERVER_DEFAULT_(sc_fxnum_fast_observer)
87 
88 #else
89 
90 #define SC_FXNUM_OBSERVER_CONSTRUCT_(object)
91 #define SC_FXNUM_OBSERVER_DESTRUCT_(object)
92 #define SC_FXNUM_OBSERVER_READ_(object)
93 #define SC_FXNUM_OBSERVER_WRITE_(object)
94 #define SC_FXNUM_OBSERVER_DEFAULT_
95 
96 #define SC_FXNUM_FAST_OBSERVER_CONSTRUCT_(object)
97 #define SC_FXNUM_FAST_OBSERVER_DESTRUCT_(object)
98 #define SC_FXNUM_FAST_OBSERVER_READ_(object)
99 #define SC_FXNUM_FAST_OBSERVER_WRITE_(object)
100 #define SC_FXNUM_FAST_OBSERVER_DEFAULT_
101 
102 #endif
103 
104 
105 // ----------------------------------------------------------------------------
106 // CLASS : sc_fxnum_observer
107 //
108 // Abstract base class for fixed-point types observers; arbitrary precision.
109 // ----------------------------------------------------------------------------
110 
112 {
113 
114 protected:
115 
117  virtual ~sc_fxnum_observer() {}
118 
119 public:
120 
121  virtual void construct( const sc_fxnum& );
122  virtual void destruct( const sc_fxnum& );
123  virtual void read( const sc_fxnum& );
124  virtual void write( const sc_fxnum& );
125 
126  static sc_fxnum_observer* (*default_observer) ();
127 
128 };
129 
130 
131 // ----------------------------------------------------------------------------
132 // CLASS : sc_fxnum_fast_observer
133 //
134 // Abstract base class for fixed-point types observers; limited precision.
135 // ----------------------------------------------------------------------------
136 
138 {
139 
140 protected:
141 
144 
145 public:
146 
147  virtual void construct( const sc_fxnum_fast& );
148  virtual void destruct( const sc_fxnum_fast& );
149  virtual void read( const sc_fxnum_fast& );
150  virtual void write( const sc_fxnum_fast& );
151 
152  static sc_fxnum_fast_observer* (*default_observer) ();
153 
154 };
155 
156 
157 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
158 
159 // ----------------------------------------------------------------------------
160 // CLASS : sc_fxnum_observer
161 //
162 // Abstract base class for fixed-point types observers; arbitrary precision.
163 // ----------------------------------------------------------------------------
164 
165 inline
166 void
168 {}
169 
170 inline
171 void
173 {}
174 
175 inline
176 void
178 {}
179 
180 inline
181 void
183 {}
184 
185 
186 // ----------------------------------------------------------------------------
187 // CLASS : sc_fxnum_fast_observer
188 //
189 // Abstract base class for fixed-point types observers; limited precision.
190 // ----------------------------------------------------------------------------
191 
192 inline
193 void
195 {}
196 
197 inline
198 void
200 {}
201 
202 inline
203 void
205 {}
206 
207 inline
208 void
210 {}
211 
212 } // namespace sc_dt
213 
214 
215 #endif
216 
217 // Taf!
virtual void read(const sc_fxnum_fast &)
virtual void write(const sc_fxnum_fast &)
virtual void write(const sc_fxnum &)
virtual void destruct(const sc_fxnum_fast &)
virtual void read(const sc_fxnum &)
virtual void construct(const sc_fxnum &)
virtual void destruct(const sc_fxnum &)
virtual void construct(const sc_fxnum_fast &)