Deleted Added
sdiff udiff text old ( 12837:413a7b490b1b ) new ( 12842:79e4e6e731fe )
full compact
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * Authors: Gabe Black
28 */
29
30#ifndef __SYSTEMC_EXT_CORE_SC_PORT_HH__
31#define __SYSTEMC_EXT_CORE_SC_PORT_HH__
32
33#include "sc_object.hh"
34
35namespace sc_core
36{
37
38class sc_interface;
39
40enum sc_port_policy
41{
42 SC_ONE_OR_MORE_BOUND, // Default
43 SC_ZERO_OR_MORE_BOUND,
44 SC_ALL_BOUND
45};
46
47class sc_port_base : public sc_object
48{
49 public:
50 void warn_unimpl(const char *func);
51};
52
53template <class IF>
54class sc_port_b : public sc_port_base
55{
56 public:
57 void
58 operator () (IF &)

--- 69 unchanged lines hidden (view full) ---

128 }
129
130 protected:
131 virtual void before_end_of_elaboration() {}
132 virtual void end_of_elaboration() {}
133 virtual void start_of_elaboration() {}
134 virtual void end_of_simulation() {}
135
136 explicit sc_port_b(int, sc_port_policy)
137 {
138 warn_unimpl(__PRETTY_FUNCTION__);
139 }
140
141 sc_port_b(const char *, int, sc_port_policy)
142 {
143 warn_unimpl(__PRETTY_FUNCTION__);
144 }
145
146 virtual ~sc_port_b()
147 {
148 warn_unimpl(__PRETTY_FUNCTION__);
149 }
150
151 private:
152 // Disabled
153 sc_port_b() {}
154 sc_port_b(const sc_port_b<IF> &) {}
155 sc_port_b<IF> &operator = (const sc_port_b<IF> &) { return *this; }
156};
157
158template <class IF, int N=1, sc_port_policy P=SC_ONE_OR_MORE_BOUND>
159class sc_port : public sc_port_b<IF>
160{
161 public:
162 sc_port()
163 {
164 warn_unimpl(__PRETTY_FUNCTION__);
165 }
166
167 explicit sc_port(const char *)
168 {
169 warn_unimpl(__PRETTY_FUNCTION__);
170 }
171
172 virtual ~sc_port()
173 {
174 warn_unimpl(__PRETTY_FUNCTION__);
175 }
176
177 virtual const char *
178 kind() const
179 {
180 warn_unimpl(__PRETTY_FUNCTION__);
181 return "";
182 }
183
184 private:
185 // Disabled
186 sc_port(const sc_port<IF, N, P> &) {}
187 sc_port<IF, N, P> &operator = (const sc_port<IF, N, P> &) { return *this; }
188};
189
190} // namespace sc_core
191
192#endif //__SYSTEMC_EXT_CORE_SC_PORT_HH__