SystemC  2.3.1
Accellera SystemC proof-of-concept library
sc_interface.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_interface.h -- Abstract base class of all interface classes.
21 
22  Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21
23 
24  CHANGE LOG IS AT THE END OF THE FILE
25  *****************************************************************************/
26 
27 #ifndef SC_INTERFACE_H
28 #define SC_INTERFACE_H
29 
30 namespace sc_core {
31 
32 class sc_event;
33 class sc_port_base;
34 
35 
36 // ----------------------------------------------------------------------------
37 // CLASS : sc_interface
38 //
39 // Abstract base class of all interface classes.
40 // BEWARE: Direct inheritance from this class must be done virtual.
41 // ----------------------------------------------------------------------------
42 
44 {
45 public:
46 
47  // register a port with this interface (does nothing by default)
48  virtual void register_port( sc_port_base& port_,
49  const char* if_typename_ );
50 
51  // get the default event
52  virtual const sc_event& default_event() const;
53 
54  // destructor (does nothing)
55  virtual ~sc_interface();
56 
57 protected:
58 
59  // constructor (does nothing)
60  sc_interface();
61 
62 private:
63 
64  // disabled
65  sc_interface( const sc_interface& );
66  sc_interface& operator = ( const sc_interface& );
67 
68 private:
69 
70  static sc_event m_never_notified;
71 
72 #if defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x520)
73  // Workaround for a bug in the Sun WorkShop 6 update 2 compiler.
74  // An empty virtual base class can cause the optimizer to
75  // generate wrong code.
76  char dummy;
77 #endif
78 };
79 
80 } // namespace sc_core
81 
82 //$Log: sc_interface.h,v $
83 //Revision 1.3 2011/08/26 20:45:40 acg
84 // Andy Goodrich: moved the modification log to the end of the file to
85 // eliminate source line number skew when check-ins are done.
86 //
87 //Revision 1.2 2011/02/18 20:23:45 acg
88 // Andy Goodrich: Copyright update.
89 //
90 //Revision 1.1.1.1 2006/12/15 20:20:04 acg
91 //SystemC 2.3
92 //
93 //Revision 1.2 2006/01/03 23:18:26 acg
94 //Changed copyright to include 2006.
95 //
96 //Revision 1.1.1.1 2005/12/19 23:16:43 acg
97 //First check in of SystemC 2.1 into its own archive.
98 //
99 //Revision 1.7 2005/06/10 22:43:55 acg
100 //Added CVS change log annotation.
101 //
102 
103 #endif
104 
105 // Taf!
virtual const sc_event & default_event() const
virtual void register_port(sc_port_base &port_, const char *if_typename_)