00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2006 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 //$Log: sc_interface.h,v $ 00036 //Revision 1.1.1.1 2006/12/15 20:31:35 acg 00037 //SystemC 2.2 00038 // 00039 //Revision 1.2 2006/01/03 23:18:26 acg 00040 //Changed copyright to include 2006. 00041 // 00042 //Revision 1.1.1.1 2005/12/19 23:16:43 acg 00043 //First check in of SystemC 2.1 into its own archive. 00044 // 00045 //Revision 1.7 2005/06/10 22:43:55 acg 00046 //Added CVS change log annotation. 00047 // 00048 00049 #ifndef SC_INTERFACE_H 00050 #define SC_INTERFACE_H 00051 00052 namespace sc_core { 00053 00054 class sc_event; 00055 class sc_port_base; 00056 00057 00058 // ---------------------------------------------------------------------------- 00059 // CLASS : sc_interface 00060 // 00061 // Abstract base class of all interface classes. 00062 // BEWARE: Direct inheritance from this class must be done virtual. 00063 // ---------------------------------------------------------------------------- 00064 00065 class sc_interface 00066 { 00067 public: 00068 00069 /// register a port with this interface (does nothing by default); 00070 /// define this for static design rule checking 00071 virtual void register_port( sc_port_base& port_, 00072 const char* if_typename_ ); 00073 00074 /// get the default event (default: return event that is never 00075 /// notified) 00076 virtual const sc_event& default_event() const; 00077 00078 /// destructor (does nothing) 00079 virtual ~sc_interface(); 00080 00081 protected: 00082 00083 // constructor (does nothing) 00084 sc_interface(); 00085 00086 private: 00087 00088 // disabled 00089 sc_interface( const sc_interface& ); 00090 sc_interface& operator = ( const sc_interface& ); 00091 00092 private: 00093 00094 static sc_event m_never_notified; 00095 00096 #if __SUNPRO_CC == 0x520 00097 // Workaround for a bug in the Sun WorkShop 6 update 2 compiler. 00098 // An empty virtual base class can cause the optimizer to 00099 // generate wrong code. 00100 char dummy; 00101 #endif 00102 }; 00103 00104 } // namespace sc_core 00105 00106 #endif 00107 00108 // Taf!
1.5.5