SystemC  2.3.1
Accellera SystemC proof-of-concept library
sc_fxcast_switch.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_fxcast_switch.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_fxcast_switch.h,v $
37 // Revision 1.2 2011/08/24 22:05:43 acg
38 // Torsten Maehne: initialization changes to remove warnings.
39 //
40 // Revision 1.1.1.1 2006/12/15 20:20:04 acg
41 // SystemC 2.3
42 //
43 // Revision 1.3 2006/01/13 18:53:57 acg
44 // Andy Goodrich: added $Log command so that CVS comments are reproduced in
45 // the source.
46 //
47 
48 #ifndef SC_FXCAST_SWITCH_H
49 #define SC_FXCAST_SWITCH_H
50 
51 
53 
54 
55 namespace sc_dt
56 {
57 
58 // classes defined in this module
59 class sc_fxcast_switch;
60 
61 
62 // ----------------------------------------------------------------------------
63 // CLASS : sc_fxcast_switch
64 //
65 // Fixed-point cast switch class.
66 // ----------------------------------------------------------------------------
67 
69 {
70 
71 public:
72 
77 
79 
80  friend bool operator == ( const sc_fxcast_switch&,
81  const sc_fxcast_switch& );
82  friend bool operator != ( const sc_fxcast_switch&,
83  const sc_fxcast_switch& );
84 
85  const std::string to_string() const;
86 
87  void print( ::std::ostream& = ::std::cout ) const;
88  void dump( ::std::ostream& = ::std::cout ) const;
89 
90 private:
91 
92  sc_switch m_sw;
93 
94 };
95 
96 
97 // ----------------------------------------------------------------------------
98 // TYPEDEF : sc_fxcast_context
99 //
100 // Context type for the fixed-point cast switch parameter.
101 // ----------------------------------------------------------------------------
102 
104 
105 
106 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
107 
108 inline
110 : m_sw()
111 {
113 }
114 
115 inline
117 : m_sw( sw_ )
118 {}
119 
120 inline
122 : m_sw( a.m_sw )
123 {}
124 
125 inline
127 : m_sw( SC_DEFAULT_CAST_SWITCH_ )
128 {}
129 
130 
131 inline
134 {
135  if( &a != this )
136  {
137  m_sw = a.m_sw;
138  }
139  return *this;
140 }
141 
142 
143 inline
144 bool
146 {
147  return ( a.m_sw == b.m_sw );
148 }
149 
150 
151 inline
152 bool
154 {
155  return ( a.m_sw != b.m_sw );
156 }
157 
158 
159 inline
160 ::std::ostream&
161 operator << ( ::std::ostream& os, const sc_fxcast_switch& a )
162 {
163  a.print( os );
164  return os;
165 }
166 
167 } // namespace sc_dt
168 
169 
170 #endif
171 
172 // Taf!
friend bool operator!=(const sc_fxcast_switch &, const sc_fxcast_switch &)
uint64 const sc_uint_base int b
Definition: sc_fxval.h:1003
friend bool operator==(const sc_fxcast_switch &, const sc_fxcast_switch &)
void print(::std::ostream &=::std::cout) const
const std::string to_string() const
sc_context< sc_fxcast_switch > sc_fxcast_context
sc_fxcast_switch & operator=(const sc_fxcast_switch &)
sc_switch
Definition: sc_fxdefs.h:145
bool operator!=(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:286
static const T & default_value()
Definition: sc_context.h:296
bool operator==(const sc_bit &a, const sc_bit &b)
Definition: sc_bit.h:283
void dump(::std::ostream &=::std::cout) const
const sc_switch SC_DEFAULT_CAST_SWITCH_
Definition: sc_fxdefs.h:212
inline::std::ostream & operator<<(::std::ostream &os, const sc_bit &a)
Definition: sc_bit.h:386