src/sysc/communication/sc_interface.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003   The following code is derived, directly or indirectly, from the SystemC
00004   source code Copyright (c) 1996-2005 by all Contributors.
00005   All Rights reserved.
00006 
00007   The contents of this file are subject to the restrictions and limitations
00008   set forth in the SystemC Open Source License Version 2.4 (the "License");
00009   You may not use this file except in compliance with such restrictions and
00010   limitations. You may obtain instructions on how to receive a copy of the
00011   License at http://www.systemc.org/. Software distributed by Contributors
00012   under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
00013   ANY KIND, either express or implied. See the License for the specific
00014   language governing rights and limitations under the License.
00015 
00016  *****************************************************************************/
00017 
00018 /*****************************************************************************
00019 
00020   sc_interface.h -- Abstract base class of all interface classes.
00021 
00022   Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21
00023 
00024  *****************************************************************************/
00025 
00026 /*****************************************************************************
00027 
00028   MODIFICATION LOG - modifiers, enter your name, affiliation, date and
00029   changes you are making here.
00030 
00031       Name, Affiliation, Date:
00032   Description of Modification:
00033     
00034  *****************************************************************************/
00035 
00036 #ifndef SC_INTERFACE_H
00037 #define SC_INTERFACE_H
00038 
00039 namespace sc_core {
00040 
00041 class sc_event;
00042 class sc_port_base;
00043 
00044 
00045 // ----------------------------------------------------------------------------
00046 //  CLASS : sc_interface
00047 //
00048 //  Abstract base class of all interface classes.
00049 //  BEWARE: Direct inheritance from this class must be done virtual.
00050 // ----------------------------------------------------------------------------
00051 
00052 class sc_interface
00053 {
00054 public:
00055 
00056     // register a port with this interface (does nothing by default)
00057     virtual void register_port( sc_port_base& port_,
00058                                 const char*    if_typename_ );
00059 
00060     // get the default event
00061     virtual const sc_event& default_event() const;
00062 
00063     // destructor (does nothing)
00064     virtual ~sc_interface();
00065 
00066 protected:
00067 
00068     // constructor (does nothing)
00069     sc_interface();
00070 
00071 private:
00072 
00073     // disabled
00074     sc_interface( const sc_interface& );
00075     sc_interface& operator = ( const sc_interface& );
00076 
00077 private:
00078 
00079     static sc_event m_never_notified;
00080 
00081 #if __SUNPRO_CC == 0x520
00082     // Workaround for a bug in the Sun WorkShop 6 update 2 compiler.
00083     // An empty virtual base class can cause the optimizer to
00084     // generate wrong code.
00085     char dummy;
00086 #endif
00087 };
00088 
00089 } // namespace sc_core
00090 
00091 #endif
00092 
00093 // Taf!

Generated on Wed Apr 25 13:53:25 2007 for SystemC by  doxygen 1.5.1