ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/tengDissertation/Appendix.tex
(Generate patch)

Comparing trunk/tengDissertation/Appendix.tex (file contents):
Revision 2829 by tim, Thu Jun 8 20:24:39 2006 UTC vs.
Revision 2831 by tim, Thu Jun 8 21:02:53 2006 UTC

# Line 179 | Line 179 | class IntegratorFactory {
179    public:
180      typedef std::map<string, IntegratorCreator*> CreatorMapType;
181  
182 <    bool registerIntegrator(IntegratorCreator* creator);
182 >    bool registerIntegrator(IntegratorCreator* creator) {
183 >      return creatorMap_.insert(creator->getIdent(), creator).second;
184 >    }
185  
186 <    Integrator* createIntegrator(const string& id, SimInfo* info);
186 >    Integrator* createIntegrator(const string& id, SimInfo* info) {
187 >      Integrator* result = NULL;
188 >      CreatorMapType::iterator i = creatorMap_.find(id);
189 >      if (i != creatorMap_.end()) {
190 >        result = (i->second)->create(info);
191 >      }
192 >      return result;
193 >    }
194  
195    private:
196      CreatorMapType creatorMap_;
197   };
189
198   \end{lstlisting}
199 <
192 < \begin{lstlisting}[float,caption={[The implementation of Factory pattern (II)].},label={appendixScheme:factoryDeclarationImplementation}]
193 <
194 < bool IntegratorFactory::unregisterIntegrator(const string& id) {
195 <  return creatorMap_.erase(id) == 1;
196 < }
197 <
198 < Integrator* IntegratorFactory::createIntegrator(const string& id,
199 <                                                SimInfo* info) {
200 <  CreatorMapType::iterator i = creatorMap_.find(id);
201 <  if (i != creatorMap_.end()) {
202 <    return (i->second)->create(info);
203 <  } else {
204 <    return NULL;
205 <  }
206 < }
199 > \begin{lstlisting}[float,caption={[The implementation of Factory pattern (III)]Souce code of creator classes.},label={appendixScheme:integratorCreator}]
200  
208 \end{lstlisting}
209
210 \begin{lstlisting}[float,caption={[The implementation of Factory pattern (III)].},label={appendixScheme:integratorCreator}]
211
201   class IntegratorCreator {
202    public:
203      IntegratorCreator(const string& ident) : ident_(ident) {}
# Line 308 | Line 297 | body in a DMPC molecule is DMPC\_RB\_0.
297   \begin{figure}
298   \centering
299   \includegraphics[width=\linewidth]{heirarchy.eps}
300 < \caption[Class heirarchy for StuntDoubles in {\sc OOPSE}]{ The class
301 < heirarchy of StuntDoubles in {\sc OOPSE}.
300 > \caption[Class heirarchy for ojects in {\sc OOPSE}]{ A diagram of
301 > the class heirarchy.
302   \begin{itemize}
303   \item A {\bf StuntDouble} is {\it any} object that can be manipulated by the
304   integrators and minimizers.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines