00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2004 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.3 (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_module_registry.h -- Registry for all modules. 00021 FOR INTERNAL USE ONLY. 00022 00023 Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21 00024 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 00029 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00030 changes you are making here. 00031 00032 Name, Affiliation, Date: Andy Goodrich, Forte 00033 Bishnupriya Bhattacharya, Cadence Design Systems, 00034 25 August, 2003 00035 Description of Modification: phase callbacks 00036 00037 *****************************************************************************/ 00038 00039 #ifndef SC_MODULE_REGISTRY_H 00040 #define SC_MODULE_REGISTRY_H 00041 00042 00043 #include "systemc/utils/sc_vector.h" 00044 00045 class sc_module; 00046 class sc_simcontext; 00047 00048 00049 // ---------------------------------------------------------------------------- 00050 // CLASS : sc_module_registry 00051 // 00052 // Registry for all modules. 00053 // FOR INTERNAL USE ONLY! 00054 // ---------------------------------------------------------------------------- 00055 00056 class sc_module_registry 00057 { 00058 friend class sc_simcontext; 00059 00060 public: 00061 00062 void insert( sc_module& ); 00063 void remove( sc_module& ); 00064 00065 int size() const 00066 { return m_module_vec.size(); } 00067 00068 private: 00069 00070 // constructor 00071 explicit sc_module_registry( sc_simcontext& simc_ ); 00072 00073 // destructor 00074 ~sc_module_registry(); 00075 00076 // called when construction is done 00077 void construction_done(); 00078 00079 // called when elaboration is done 00080 void elaboration_done(); 00081 00082 // called before simulation begins 00083 void start_simulation(); 00084 00085 // called after simulation ends 00086 void simulation_done(); 00087 00088 00089 private: 00090 00091 sc_simcontext* m_simc; 00092 sc_pvector<sc_module*> m_module_vec; 00093 00094 private: 00095 00096 // disabled 00097 sc_module_registry(); 00098 sc_module_registry( const sc_module_registry& ); 00099 sc_module_registry& operator = ( const sc_module_registry& ); 00100 }; 00101 00102 00103 #endif 00104 00105 // Taf!
1.2.18