diff --git a/include/loki/AbstractFactory.h b/include/loki/AbstractFactory.h index 846b60c..34e084c 100644 --- a/include/loki/AbstractFactory.h +++ b/include/loki/AbstractFactory.h @@ -2,14 +2,14 @@ // The Loki Library // Copyright (c) 2001 by Andrei Alexandrescu // This code accompanies the book: -// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design +// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design // Patterns Applied". Copyright (c) 2001. Addison-Wesley. -// Permission to use, copy, modify, distribute and sell this software for any -// purpose is hereby granted without fee, provided that the above copyright -// notice appear in all copies and that both that copyright notice and this +// Permission to use, copy, modify, distribute and sell this software for any +// purpose is hereby granted without fee, provided that the above copyright +// notice appear in all copies and that both that copyright notice and this // permission notice appear in supporting documentation. -// The author or Addison-Wesley Longman make no representations about the -// suitability of this software for any purpose. It is provided "as is" +// The author or Addison-Wesley Longman make no representations about the +// suitability of this software for any purpose. It is provided "as is" // without express or implied warranty. //////////////////////////////////////////////////////////////////////////////// #ifndef LOKI_ABSTRACTFACTORY_INC_ @@ -18,10 +18,10 @@ // $Id$ -#include "Typelist.h" -#include "Sequence.h" -#include "TypeManip.h" -#include "HierarchyGenerators.h" +#include +#include +#include +#include #include @@ -31,7 +31,7 @@ * \ingroup FactoriesGroup * \brief Implements an abstract object factory. */ - + /** * \class AbstractFactory * \ingroup AbstractFactoryGroup @@ -68,14 +68,14 @@ namespace Loki { public: typedef TList ProductList; - + template T* Create() { Unit& unit = *this; return unit.DoCreate(Type2Type()); } }; - + //////////////////////////////////////////////////////////////////////////////// // class template OpNewFactoryUnit // Creates an object by invoking the new operator @@ -85,10 +85,10 @@ namespace Loki class OpNewFactoryUnit : public Base { typedef typename Base::ProductList BaseProductList; - + protected: typedef typename BaseProductList::Tail ProductList; - + public: typedef typename BaseProductList::Head AbstractProduct; ConcreteProduct* DoCreate(Type2Type) @@ -101,7 +101,7 @@ namespace Loki // class template PrototypeFactoryUnit // Creates an object by cloning a prototype // There is a difference between the implementation herein and the one described -// in the book: GetPrototype and SetPrototype use the helper friend +// in the book: GetPrototype and SetPrototype use the helper friend // functions DoGetPrototype and DoSetPrototype. The friend functions avoid // name hiding issues. Plus, GetPrototype takes a reference to pointer // instead of returning the pointer by value. @@ -111,7 +111,7 @@ namespace Loki class PrototypeFactoryUnit : public Base { typedef typename Base::ProductList BaseProductList; - + protected: typedef typename BaseProductList::Tail ProductList; @@ -133,17 +133,17 @@ namespace Loki template void GetPrototype(U*& p) { return DoGetPrototype(*this, p); } - + template void SetPrototype(U* pObj) { DoSetPrototype(*this, pObj); } - + AbstractProduct* DoCreate(Type2Type) { assert(pPrototype_); return pPrototype_->Clone(); } - + private: AbstractProduct* pPrototype_; }; diff --git a/include/loki/DataGenerators.h b/include/loki/DataGenerators.h index 9839676..c57d56a 100644 --- a/include/loki/DataGenerators.h +++ b/include/loki/DataGenerators.h @@ -2,7 +2,7 @@ // The Loki Library // Data Generator by Shannon Barber // This code DOES NOT accompany the book: -// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design +// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design // Patterns Applied". Copyright (c) 2001. Addison-Wesley. // // Code covered by the MIT License @@ -15,7 +15,7 @@ // $Id$ -#include "Typelist.h" +#include //Reference version @@ -64,7 +64,7 @@ namespace Loki }; template class GenFunc> struct IterateTypes; - + template class GenFunc> struct IterateTypes, GenFunc> { @@ -79,7 +79,7 @@ namespace Loki tail.operator()(ii); } }; - + template class GenFunc> struct IterateTypes { @@ -91,7 +91,7 @@ namespace Loki ++ii; //Is this even needed? } }; - + template