Mercurial > hg > aimc
comparison src/Support/Module.h @ 160:747ba38b4b1b
- AIMCopy v5 for just smooth NAP features
- Reporting of all modules and versions
author | tomwalters |
---|---|
date | Sun, 11 Jul 2010 03:46:06 +0000 |
parents | bbf4728ffa0e |
children | c155e7fbe76e |
comparison
equal
deleted
inserted
replaced
159:64c3f4e25877 | 160:747ba38b4b1b |
---|---|
99 * input modules which do not take a SignalBank as input, but rather | 99 * input modules which do not take a SignalBank as input, but rather |
100 * generate their own input. In this case, it is better to be able to | 100 * generate their own input. In this case, it is better to be able to |
101 * override the default Initialize function. When creating a new module, do | 101 * override the default Initialize function. When creating a new module, do |
102 * not create a new version of Initialize uness you're sure you know what | 102 * not create a new version of Initialize uness you're sure you know what |
103 * you're doing! | 103 * you're doing! |
104 * | 104 */ |
105 * global_parameters stores things like the input filename, output filenames | 105 virtual bool Initialize(const SignalBank &input); |
106 * and any other metadata that modules might want to share. If present, it | |
107 * is propagated to all children. These parameters are mutable and may | |
108 * change. | |
109 */ | |
110 virtual bool Initialize(const SignalBank &input, | |
111 Parameters *global_parameters); | |
112 | 106 |
113 /*! \brief Returns true if the module has been correctly initialized | 107 /*! \brief Returns true if the module has been correctly initialized |
114 * \return true if module has been initialized, false otherwise | 108 * \return true if module has been initialized, false otherwise |
115 */ | 109 */ |
116 bool initialized() const; | 110 bool initialized() const; |
166 * output. | 160 * output. |
167 */ | 161 */ |
168 const SignalBank* GetOutputBank() const; | 162 const SignalBank* GetOutputBank() const; |
169 | 163 |
170 void PrintTargets(ostream &out); | 164 void PrintTargets(ostream &out); |
171 void PrintTargetsForDot(ostream &out); | 165 |
172 void PrintConfiguration(ostream &out); | 166 void PrintVersions(ostream &out); |
173 | 167 |
174 string version() const { | 168 string version() const { |
175 return module_version_; | 169 return module_version_; |
176 } | 170 } |
177 | 171 |
184 } | 178 } |
185 | 179 |
186 string type() const { | 180 string type() const { |
187 return module_type_; | 181 return module_type_; |
188 } | 182 } |
189 | |
190 bool done() { | |
191 return done_; | |
192 } | |
193 | |
194 void set_instance_name(string instance_name) { | |
195 instance_name_ = instance_name; | |
196 } | |
197 | |
198 string instance_name() { | |
199 return instance_name_; | |
200 } | |
201 | 183 |
202 protected: | 184 protected: |
203 void PushOutput(); | 185 void PushOutput(); |
204 | 186 |
205 virtual void ResetInternal() = 0; | 187 virtual void ResetInternal() = 0; |
206 | 188 |
207 virtual bool InitializeInternal(const SignalBank &input) = 0; | 189 virtual bool InitializeInternal(const SignalBank &input) = 0; |
208 | 190 |
209 bool initialized_; | 191 bool initialized_; |
210 bool done_; | |
211 set<Module*> targets_; | 192 set<Module*> targets_; |
212 SignalBank output_; | 193 SignalBank output_; |
213 Parameters* parameters_; | 194 Parameters* parameters_; |
214 Parameters* global_parameters_; | |
215 | 195 |
216 string module_identifier_; | 196 string module_identifier_; |
217 string module_type_; | 197 string module_type_; |
218 string module_description_; | 198 string module_description_; |
219 string module_version_; | 199 string module_version_; |
220 | |
221 string instance_name_; | |
222 | 200 |
223 private: | 201 private: |
224 DISALLOW_COPY_AND_ASSIGN(Module); | 202 DISALLOW_COPY_AND_ASSIGN(Module); |
225 }; | 203 }; |
226 } | 204 } |