--- trunk/tengDissertation/Appendix.tex 2006/06/09 04:07:13 2842 +++ trunk/tengDissertation/Appendix.tex 2006/06/22 22:19:02 2880 @@ -105,7 +105,7 @@ List.~\ref{appendixScheme:singletonImplementation} res static data approach in {\sc OOPSE}. The declaration and implementation of IntegratorFactory class are given by declared in List.~\ref{appendixScheme:singletonDeclaration} and -List.~\ref{appendixScheme:singletonImplementation} respectively. +Scheme.~\ref{appendixScheme:singletonImplementation} respectively. Since constructor is declared as protected, a client can not instantiate IntegratorFactory directly. Moreover, since the member function getInstance serves as the only entry of access to @@ -149,10 +149,10 @@ identifier (see List.~\ref{appendixScheme:factoryDecla implemented by delegating the creation operation to the subclasses. Parameterized Factory pattern where factory method ( createIntegrator member function) creates products based on the -identifier (see List.~\ref{appendixScheme:factoryDeclaration}). If +identifier (see Scheme.~\ref{appendixScheme:factoryDeclaration}). If the identifier has been already registered, the factory method will invoke the corresponding creator (see -List.~\ref{appendixScheme:integratorCreator}) which utilizes the +Scheme.~\ref{appendixScheme:integratorCreator}) which utilizes the modern C++ template technique to avoid excess subclassing. \begin{lstlisting}[float,caption={[The implementation of Parameterized Factory pattern (I)]Source code of IntegratorFactory class.},label={appendixScheme:factoryDeclaration}] @@ -215,9 +215,9 @@ in List.~\ref{appendixScheme:element}). Since the hier Dump2XYZ}. In order to convert an OOPSE dump file, a series of distinct operations are performed on different StuntDoubles (See the class hierarchy in Fig.~\ref{oopseFig:hierarchy} and the declaration -in List.~\ref{appendixScheme:element}). Since the hierarchies +in Scheme.~\ref{appendixScheme:element}). Since the hierarchies remains stable, it is easy to define a visit operation (see -List.~\ref{appendixScheme:visitor}) for each class of StuntDouble. +Scheme.~\ref{appendixScheme:visitor}) for each class of StuntDouble. Note that using Composite pattern\cite{Gamma1994}, CompositVisitor manages a priority visitor list and handles the execution of every visitor in the priority list on different StuntDoubles. @@ -277,12 +277,6 @@ class SSDAtomVisitor:public BaseAtomVisitor{ public: virtual void visit(RigidBody* rb); }; -class SSDAtomVisitor:public BaseAtomVisitor{ public: - virtual void visit(Atom* atom); - virtual void visit(DirectionalAtom* datom); - virtual void visit(RigidBody* rb); -}; - class CompositeVisitor: public BaseVisitor { public: @@ -291,7 +285,7 @@ class CompositeVisitor: public BaseVisitor { (public) virtual void visit(Atom* atom) { VisitorListIterator i; BaseVisitor* curVisitor; - for(i = visitorList.begin();i != visitorList.end();++i) { + for(i = visitorScheme.begin();i != visitorScheme.end();++i) { atom->accept(*i); } } @@ -299,7 +293,7 @@ class CompositeVisitor: public BaseVisitor { (public) virtual void visit(DirectionalAtom* datom) { VisitorListIterator i; BaseVisitor* curVisitor; - for(i = visitorList.begin();i != visitorList.end();++i) { + for(i = visitorScheme.begin();i != visitorScheme.end();++i) { atom->accept(*i); } } @@ -309,7 +303,7 @@ class CompositeVisitor: public BaseVisitor { (public) std::vector myAtoms; std::vector::iterator ai; myAtoms = rb->getAtoms(); - for(i = visitorList.begin();i != visitorList.end();++i) {{ + for(i = visitorScheme.begin();i != visitorScheme.end();++i) {{ rb->accept(*i); for(ai = myAtoms.begin(); ai != myAtoms.end(); ++ai){ (*ai)->accept(*i); @@ -321,7 +315,6 @@ class CompositeVisitor: public BaseVisitor { (public) protected: VistorListType visitorList; }; - \end{lstlisting} \section{\label{appendixSection:concepts}Concepts}