SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_module_registry.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements. See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied. See the License for the specific language governing
16  permissions and limitations under the License.
17 
18  *****************************************************************************/
19 
20 /*****************************************************************************
21 
22  sc_module_registry.h -- Registry for all modules.
23 */
35 #ifndef SC_MODULE_REGISTRY_H
36 #define SC_MODULE_REGISTRY_H
37 
38 
39 namespace sc_core {
40 
41 class sc_module;
42 class sc_simcontext;
43 
44 
53 {
54  friend class sc_simcontext;
55 
56 public:
57 
58  void insert( sc_module& );
59  void remove( sc_module& );
60 
61  int size() const
62  { return m_module_vec.size(); }
63 
64 private:
65 
66  // constructor
67  explicit sc_module_registry( sc_simcontext& simc_ );
68 
69  // destructor
71 
72  // called when construction is done
73  bool construction_done();
74 
75  // called when elaboration is done
76  void elaboration_done();
77 
78  // called before simulation begins
79  void start_simulation();
80 
81  // called after simulation ends
82  void simulation_done();
83 
84 
85 private:
86 
87  int m_construction_done;
88  std::vector<sc_module*> m_module_vec;
89  sc_simcontext* m_simc;
90 
91 private:
92 
93  // disabled
96  sc_module_registry& operator = ( const sc_module_registry& );
97 };
98 
99 } // namespace sc_core
100 
101 #endif
102 
103 // $Log: sc_module_registry.h,v $
104 // Revision 1.6 2011/08/26 20:46:10 acg
105 // Andy Goodrich: moved the modification log to the end of the file to
106 // eliminate source line number skew when check-ins are done.
107 //
108 // Revision 1.5 2011/05/09 04:07:49 acg
109 // Philipp A. Hartmann:
110 // (1) Restore hierarchy in all phase callbacks.
111 // (2) Ensure calls to before_end_of_elaboration.
112 //
113 // Revision 1.4 2011/02/18 20:27:14 acg
114 // Andy Goodrich: Updated Copyrights.
115 //
116 // Revision 1.3 2011/02/13 21:47:37 acg
117 // Andy Goodrich: update copyright notice.
118 //
119 // Revision 1.2 2008/05/22 17:06:26 acg
120 // Andy Goodrich: updated copyright notice to include 2008.
121 //
122 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
123 // SystemC 2.3
124 //
125 // Revision 1.3 2006/01/13 18:44:30 acg
126 // Added $Log to record CVS changes into the source.
127 
128 // Taf!
void insert(sc_module &)
Base class for all structural entities.
Definition: sc_module.h:83
Registry for all modules.
The simulation context.
class SC_API sc_module
Definition: sc_object.h:48
class SC_API sc_simcontext
Definition: sc_object.h:51