src/sysc/kernel/sc_module_registry.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_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 "sysc/utils/sc_vector.h"
00044 
00045 namespace sc_core {
00046 
00047 class sc_module;
00048 class sc_simcontext;
00049 
00050 
00051 // ----------------------------------------------------------------------------
00052 //  CLASS : sc_module_registry
00053 //
00054 //  Registry for all modules.
00055 //  FOR INTERNAL USE ONLY!
00056 // ----------------------------------------------------------------------------
00057 
00058 class sc_module_registry
00059 {
00060     friend class sc_simcontext;
00061 
00062 public:
00063 
00064     void insert( sc_module& );
00065     void remove( sc_module& );
00066 
00067     int size() const
00068         { return m_module_vec.size(); }
00069 
00070 private:
00071 
00072     // constructor
00073     explicit sc_module_registry( sc_simcontext& simc_ );
00074 
00075     // destructor
00076     ~sc_module_registry();
00077 
00078     // called when construction is done
00079     void construction_done();
00080 
00081     // called when elaboration is done
00082     void elaboration_done();
00083 
00084     // called before simulation begins
00085     void start_simulation();
00086 
00087     // called after simulation ends
00088     void simulation_done();
00089 
00090 
00091 private:
00092 
00093     sc_simcontext*         m_simc;
00094     sc_pvector<sc_module*> m_module_vec;
00095 
00096 private:
00097 
00098     // disabled
00099     sc_module_registry();
00100     sc_module_registry( const sc_module_registry& );
00101     sc_module_registry& operator = ( const sc_module_registry& );
00102 };
00103 
00104 } // namespace sc_core
00105 
00106 #endif
00107 
00108 // Taf!

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