SystemC  Recoding Infrastructure for SystemC v0.6.2 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
sc_module_registry.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  *****************************************************************************/
17 
18 /*****************************************************************************
19 
20  sc_module_registry.h -- Registry for all modules.
21  FOR INTERNAL USE ONLY.
22 
23  Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21
24 
25  CHANGE LOG AT THE END OF THE FILE
26  *****************************************************************************/
27 
28 
29 #ifndef SC_MODULE_REGISTRY_H
30 #define SC_MODULE_REGISTRY_H
31 
32 
33 namespace sc_core {
34 
35 class sc_module;
36 class sc_simcontext;
37 
38 
39 /**************************************************************************/
48 {
49  friend class sc_simcontext;
50 
51 public:
52 
53  void insert( sc_module& );
54  void remove( sc_module& );
55 
56  int size() const
57  { return m_module_vec.size(); }
58 
59 private:
60 
61  // constructor
62  explicit sc_module_registry( sc_simcontext& simc_ );
63 
64  // destructor
66 
67  // called when construction is done
68  bool construction_done();
69 
70  // called when elaboration is done
71  void elaboration_done();
72 
73  // called before simulation begins
74  void start_simulation();
75 
76  // called after simulation ends
77  void simulation_done();
78 
79 
80 private:
81 
82  int m_construction_done;
83  std::vector<sc_module*> m_module_vec;
84  sc_simcontext* m_simc;
85 
86 private:
87 
88  // disabled
91  sc_module_registry& operator = ( const sc_module_registry& );
92 };
93 
94 } // namespace sc_core
95 
96 #endif
97 
98 // $Log: sc_module_registry.h,v $
99 // Revision 1.6 2011/08/26 20:46:10 acg
100 // Andy Goodrich: moved the modification log to the end of the file to
101 // eliminate source line number skew when check-ins are done.
102 //
103 // Revision 1.5 2011/05/09 04:07:49 acg
104 // Philipp A. Hartmann:
105 // (1) Restore hierarchy in all phase callbacks.
106 // (2) Ensure calls to before_end_of_elaboration.
107 //
108 // Revision 1.4 2011/02/18 20:27:14 acg
109 // Andy Goodrich: Updated Copyrights.
110 //
111 // Revision 1.3 2011/02/13 21:47:37 acg
112 // Andy Goodrich: update copyright notice.
113 //
114 // Revision 1.2 2008/05/22 17:06:26 acg
115 // Andy Goodrich: updated copyright notice to include 2008.
116 //
117 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
118 // SystemC 2.3
119 //
120 // Revision 1.3 2006/01/13 18:44:30 acg
121 // Added $Log to record CVS changes into the source.
122 
123 // Taf!
Registry for all modules.
The simulation context.
void insert(sc_module &)
Base class for all structural entities.
Definition: sc_module.h:83