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