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
51#include "sysc/datatypes/fx/sc_fxdefs.h"
52
53
54namespace sc_dt
55{
56
57// classes defined in this module
58class sc_fxval_observer;
59class sc_fxval_fast_observer;
60
61// forward class declarations
62class sc_fxval;
63class sc_fxval_fast;
64
65
66#ifdef SC_ENABLE_OBSERVERS
67
68#define SC_FXVAL_OBSERVER_CONSTRUCT_(object)                                  \
69    SC_OBSERVER_(object,sc_fxval_observer*,construct)
70#define SC_FXVAL_OBSERVER_DESTRUCT_(object)                                   \
71    SC_OBSERVER_(object,sc_fxval_observer*,destruct)
72#define SC_FXVAL_OBSERVER_READ_(object)                                       \
73    SC_OBSERVER_(object,sc_fxval_observer*,read)
74#define SC_FXVAL_OBSERVER_WRITE_(object)                                      \
75    SC_OBSERVER_(object,sc_fxval_observer*,write)
76#define SC_FXVAL_OBSERVER_DEFAULT_                                            \
77    SC_OBSERVER_DEFAULT_(sc_fxval_observer)
78
79#define SC_FXVAL_FAST_OBSERVER_CONSTRUCT_(object)                             \
80    SC_OBSERVER_(object,sc_fxval_fast_observer*,construct)
81#define SC_FXVAL_FAST_OBSERVER_DESTRUCT_(object)                              \
82    SC_OBSERVER_(object,sc_fxval_fast_observer*,destruct)
83#define SC_FXVAL_FAST_OBSERVER_READ_(object)                                  \
84    SC_OBSERVER_(object,sc_fxval_fast_observer*,read)
85#define SC_FXVAL_FAST_OBSERVER_WRITE_(object)                                 \
86    SC_OBSERVER_(object,sc_fxval_fast_observer*,write)
87#define SC_FXVAL_FAST_OBSERVER_DEFAULT_                                       \
88    SC_OBSERVER_DEFAULT_(sc_fxval_fast_observer)
89
90#else
91
92#define SC_FXVAL_OBSERVER_CONSTRUCT_(object)
93#define SC_FXVAL_OBSERVER_DESTRUCT_(object)
94#define SC_FXVAL_OBSERVER_READ_(object)
95#define SC_FXVAL_OBSERVER_WRITE_(object)
96#define SC_FXVAL_OBSERVER_DEFAULT_
97
98#define SC_FXVAL_FAST_OBSERVER_CONSTRUCT_(object)
99#define SC_FXVAL_FAST_OBSERVER_DESTRUCT_(object)
100#define SC_FXVAL_FAST_OBSERVER_READ_(object)
101#define SC_FXVAL_FAST_OBSERVER_WRITE_(object)
102#define SC_FXVAL_FAST_OBSERVER_DEFAULT_
103
104#endif
105
106
107// ----------------------------------------------------------------------------
108//  CLASS : sc_fxval_observer
109//
110//  Abstract base class for fixed-point value type observers;
111//  arbitrary precision.
112// ----------------------------------------------------------------------------
113
114class sc_fxval_observer
115{
116
117protected:
118
119    sc_fxval_observer() {}
120    virtual ~sc_fxval_observer() {}
121
122public:
123
124    virtual void construct( const sc_fxval& );
125    virtual void  destruct( const sc_fxval& );
126    virtual void      read( const sc_fxval& );
127    virtual void     write( const sc_fxval& );
128
129    static sc_fxval_observer* (*default_observer) ();
130
131};
132
133
134// ----------------------------------------------------------------------------
135//  CLASS : sc_fxval_fast_observer
136//
137//  Abstract base class for fixed-point value type observers;
138//  limited precision.
139// ----------------------------------------------------------------------------
140
141class sc_fxval_fast_observer
142{
143
144protected:
145
146    sc_fxval_fast_observer() {}
147    virtual ~sc_fxval_fast_observer() {}
148
149public:
150
151    virtual void construct( const sc_fxval_fast& );
152    virtual void  destruct( const sc_fxval_fast& );
153    virtual void      read( const sc_fxval_fast& );
154    virtual void     write( const sc_fxval_fast& );
155
156    static sc_fxval_fast_observer* (*default_observer) ();
157
158};
159
160
161// IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
162
163// ----------------------------------------------------------------------------
164//  CLASS : sc_fxval_observer
165//
166//  Abstract base class for fixed-point value type observers;
167//  arbitrary precision.
168// ----------------------------------------------------------------------------
169
170inline
171void
172sc_fxval_observer::construct( const sc_fxval& )
173{}
174
175inline
176void
177sc_fxval_observer::destruct( const sc_fxval& )
178{}
179
180inline
181void
182sc_fxval_observer::read( const sc_fxval& )
183{}
184
185inline
186void
187sc_fxval_observer::write( const sc_fxval& )
188{}
189
190
191// ----------------------------------------------------------------------------
192//  CLASS : sc_fxval_fast_observer
193//
194//  Abstract base class for fixed-point value type observers;
195//  limited precision.
196// ----------------------------------------------------------------------------
197
198inline
199void
200sc_fxval_fast_observer::construct( const sc_fxval_fast& )
201{}
202
203inline
204void
205sc_fxval_fast_observer::destruct( const sc_fxval_fast& )
206{}
207
208inline
209void
210sc_fxval_fast_observer::read( const sc_fxval_fast& )
211{}
212
213inline
214void
215sc_fxval_fast_observer::write( const sc_fxval_fast& )
216{}
217
218} // namespace sc_dt
219
220
221#endif
222
223// Taf!
224