Mercurial > hg > aimc
diff src/Support/Module.cc @ 3:decdac21cfc2
- Imported file input using libsndfile from old AIM-C and updated to the new API
- Modified the Module base class to propogate Reset() calls down the module chain.
- This required changing all Reset() functions in subclasses to ResetInternal()
- Removed some unneeded imports from the Gaussians test
author | tomwalters |
---|---|
date | Tue, 16 Feb 2010 18:00:16 +0000 |
parents | bc394a985042 |
children | 8c859ef1fb75 |
line wrap: on
line diff
--- a/src/Support/Module.cc Tue Feb 16 13:23:23 2010 +0000 +++ b/src/Support/Module.cc Tue Feb 16 18:00:16 2010 +0000 @@ -78,6 +78,19 @@ return true; } +void Module::Reset() { + if (!initialized_) + return; + + ResetInternal(); + + // Iterate through all the targets of this module, resetting + // them. + set<Module*>::const_iterator it; + for (it = targets_.begin(); it != targets_.end(); ++it) + (*it)->Reset(); +} + bool Module::initialized() const { return initialized_; }