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 // ----------------------------------------------------------------------------
40 // CLASS : sc_module_registry
41 //
42 // Registry for all modules.
43 // FOR INTERNAL USE ONLY!
44 // ----------------------------------------------------------------------------
45 
47 {
48  friend class sc_simcontext;
49 
50 public:
51 
52  void insert( sc_module& );
53  void remove( sc_module& );
54 
55  int size() const
56  { return m_module_vec.size(); }
57 
58 private:
59 
60  // constructor
61  explicit sc_module_registry( sc_simcontext& simc_ );
62 
63  // destructor
65 
66  // called when construction is done
67  bool construction_done();
68 
69  // called when elaboration is done
70  void elaboration_done();
71 
72  // called before simulation begins
73  void start_simulation();
74 
75  // called after simulation ends
76  void simulation_done();
77 
78 
79 private:
80 
81  int m_construction_done;
82  std::vector<sc_module*> m_module_vec;
83  sc_simcontext* m_simc;
84 
85 private:
86 
87  // disabled
90  sc_module_registry& operator = ( const sc_module_registry& );
91 };
92 
93 } // namespace sc_core
94 
95 #endif
96 
97 // $Log: sc_module_registry.h,v $
98 // Revision 1.6 2011/08/26 20:46:10 acg
99 // Andy Goodrich: moved the modification log to the end of the file to
100 // eliminate source line number skew when check-ins are done.
101 //
102 // Revision 1.5 2011/05/09 04:07:49 acg
103 // Philipp A. Hartmann:
104 // (1) Restore hierarchy in all phase callbacks.
105 // (2) Ensure calls to before_end_of_elaboration.
106 //
107 // Revision 1.4 2011/02/18 20:27:14 acg
108 // Andy Goodrich: Updated Copyrights.
109 //
110 // Revision 1.3 2011/02/13 21:47:37 acg
111 // Andy Goodrich: update copyright notice.
112 //
113 // Revision 1.2 2008/05/22 17:06:26 acg
114 // Andy Goodrich: updated copyright notice to include 2008.
115 //
116 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
117 // SystemC 2.3
118 //
119 // Revision 1.3 2006/01/13 18:44:30 acg
120 // Added $Log to record CVS changes into the source.
121 
122 // Taf!
void insert(sc_module &)