From 7b4424b3fd32d815a246253b7e4e7879bf9a388b Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Thu, 3 Nov 2005 12:43:55 +0000 Subject: [PATCH] more doxygen documentation, modules added git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@348 7ec92016-0320-0410-acc4-a06ded1c099a --- include/loki/Factory.h | 100 +++++++++--------- include/loki/Function.h | 21 ++-- include/loki/Functor.h | 28 +++-- include/loki/Singleton.h | 21 ++-- include/loki/SmartPtr.h | 223 +++++++++++++++++++++++++-------------- include/loki/Threads.h | 107 ++++++++++++------- src/SmallObj.cpp | 4 + 7 files changed, 311 insertions(+), 193 deletions(-) diff --git a/include/loki/Factory.h b/include/loki/Factory.h index 09dfb5f..67c1466 100644 --- a/include/loki/Factory.h +++ b/include/loki/Factory.h @@ -28,13 +28,16 @@ //unreachable code if OnUnknownType throws an exception #endif +/// \defgroup FactoryGroup Factory namespace Loki { //////////////////////////////////////////////////////////////////////////////// -// class template DefaultFactoryError -// Manages the "Unknown Type" error in an object factory +/// \class DefaultFactoryError +/// +/// \ingroup FactoryGroup +/// Manages the "Unknown Type" error in an object factory //////////////////////////////////////////////////////////////////////////////// template @@ -55,48 +58,6 @@ namespace Loki #define LOKI_ENABLE_NEW_FACTORY_CODE #ifdef LOKI_ENABLE_NEW_FACTORY_CODE -//////////////////////////////////////////////////////////////////////////////// -/* - class template Factory - Implements a generic object factory - cretae functions with up to 15 parameters - - - template - < - class AbstractProduct, - typename IdentifierType, - typename CreatorParmTList = NullType, - template class FactoryErrorPolicy = ExceptionFactoryError - > - class Factory : public FactoryErrorPolicy - { - - public: - typedef Functor ProductCreator; - typedef FactoryImpl< AbstractProduct, IdentifierType, CreatorParmTList > Impl; - - typedef typename Impl::Parm1Parm1; - // ... up to 15 Parameters - - typedef typename IdToProductMap::iterator iterator; - iterator begin(); - iterator end(); - - bool Register(const IdentifierType& id, ProductCreator creator); - bool Unregister(const IdentifierType& id); - - template - bool Register(const IdentifierType& id, const PtrObj& p, CreaFn fn); - - AbstractProduct* CreateObject(const IdentifierType& id); - AbstractProduct* CreateObject(const IdentifierType& id, Parm1 p1); - // ... up to 15 Parameters - }; -*/ -//////////////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////////////// // class template FunctorImpl @@ -688,9 +649,47 @@ template //////////////////////////////////////////////////////////////////////////////// -// class template Factory +/// \class Factory +/// +/// \ingroup FactoryGroup +/// Implements a generic object factory. +/// +/// Create functions can have up to 15 parameters. +/// +/// \code +/// template +/// < +/// class AbstractProduct, +/// typename IdentifierType, +/// typename CreatorParmTList = NullType, +/// template class FactoryErrorPolicy = ExceptionFactoryError +/// > +/// class Factory : public FactoryErrorPolicy +/// { +/// +/// public: +/// typedef Functor ProductCreator; +/// typedef FactoryImpl< AbstractProduct, IdentifierType, CreatorParmTList > Impl; +/// +/// typedef typename Impl::Parm1Parm1; +/// // ... up to 15 Parameters +/// +/// typedef typename IdToProductMap::iterator iterator; +/// iterator begin(); +/// iterator end(); +/// +/// bool Register(const IdentifierType& id, ProductCreator creator); +/// bool Unregister(const IdentifierType& id); +/// +/// template +/// bool Register(const IdentifierType& id, const PtrObj& p, CreaFn fn); +/// +/// AbstractProduct* CreateObject(const IdentifierType& id); +/// AbstractProduct* CreateObject(const IdentifierType& id, Parm1 p1); +/// // ... up to 15 Parameters +/// }; +/// \endcode //////////////////////////////////////////////////////////////////////////////// - template < class AbstractProduct, @@ -972,8 +971,10 @@ template #endif //#define ENABLE_NEW_FACTORY_CODE //////////////////////////////////////////////////////////////////////////////// -// class template CloneFactory -// Implements a generic cloning factory +/// \class CloneFactory +/// +/// \ingroup FactoryGroup +/// Implements a generic cloning factory //////////////////////////////////////////////////////////////////////////////// template @@ -1036,6 +1037,9 @@ template #endif // FACTORY_INC_ // $Log$ +// Revision 1.10 2005/11/03 12:43:35 syntheticpp +// more doxygen documentation, modules added +// // Revision 1.9 2005/10/30 14:03:23 syntheticpp // replace tabs space // diff --git a/include/loki/Function.h b/include/loki/Function.h index 7f01aa3..c85761f 100755 --- a/include/loki/Function.h +++ b/include/loki/Function.h @@ -18,16 +18,19 @@ namespace Loki { + //////////////////////////////////////////////////////////////////////////////// + /// \struct Function + /// + /// \ingroup FunctorGroup + /// Allows a boost/TR1 like usage of Functor. + /// + /// e.g. Functor becomes Function + //////////////////////////////////////////////////////////////////////////////// template - struct Function : public Functor - { - }; + struct Function : public Functor + { + }; -//////////////////////////////////////////////////////////////////////////////// -// Function allows a boost/TR1 like usage of Functor. -// -// e.g. Functor becomes Function -//////////////////////////////////////////////////////////////////////////////// template struct Function : public Functor @@ -42,7 +45,7 @@ namespace Loki FBase::operator=(func); } - // emptiness + // test on emptiness template Function(Function func) : FBase() { diff --git a/include/loki/Functor.h b/include/loki/Functor.h index e4d18d5..18def96 100644 --- a/include/loki/Functor.h +++ b/include/loki/Functor.h @@ -26,6 +26,8 @@ #include #include +/// \defgroup FunctorGroup Function objects + namespace Loki { //////////////////////////////////////////////////////////////////////////////// @@ -1127,8 +1129,10 @@ namespace Loki #endif //////////////////////////////////////////////////////////////////////////////// -// class template Functor -// A generalized functor implementation with value semantics +/// \class Functor +/// +/// \ingroup FunctorGroup +/// A generalized functor implementation with value semantics //////////////////////////////////////////////////////////////////////////////// template class ThreadingModel = LOKI_DEFAULT_THREADING_NO_OBJ_LEVEL> @@ -1340,8 +1344,10 @@ namespace Loki } //////////////////////////////////////////////////////////////////////////////// -// class template BinderFirst -// Binds the first parameter of a Functor object to a specific value +/// \class BinderFirst +/// +/// \ingroup FunctorGroup +/// Binds the first parameter of a Functor object to a specific value //////////////////////////////////////////////////////////////////////////////// template @@ -1444,8 +1450,8 @@ namespace Loki }; //////////////////////////////////////////////////////////////////////////////// -// function template BindFirst -// Binds the first parameter of a Functor object to a specific value +/// Binds the first parameter of a Functor object to a specific value +/// \ingroup FunctorGroup //////////////////////////////////////////////////////////////////////////////// template @@ -1462,8 +1468,10 @@ namespace Loki } //////////////////////////////////////////////////////////////////////////////// -// class template Chainer -// Chains two functor calls one after another +/// \class Chainer +/// +/// \ingroup FunctorGroup +/// Chains two functor calls one after another //////////////////////////////////////////////////////////////////////////////// template @@ -1594,8 +1602,8 @@ namespace Loki }; //////////////////////////////////////////////////////////////////////////////// -// function template Chain -// Chains two functor calls one after another +/// Chains two functor calls one after another +/// \ingroup FunctorGroup //////////////////////////////////////////////////////////////////////////////// diff --git a/include/loki/Singleton.h b/include/loki/Singleton.h index 0099741..3e27f4f 100644 --- a/include/loki/Singleton.h +++ b/include/loki/Singleton.h @@ -300,7 +300,7 @@ namespace Loki #endif //////////////////////////////////////////////////////////////////////////////// - /// Copyright (c) 2004 by Curtis Krauskopf - curtis\decompile.com + /// Copyright (c) 2004 by Curtis Krauskopf - curtis@decompile.com /// /// \struct DeletableSingleton /// @@ -463,25 +463,22 @@ namespace Loki }; //////////////////////////////////////////////////////////////////////////////// - /// \struct FollowIntoDeath + /// \class FollowIntoDeath /// /// \ingroup LifetimeGroup /// /// Lifetime policyfor the SingletonHolder tempalte. /// Followers will die after the master dies Followers will not die, if - /// - master never dies (NoDestroy policy) - /// - master never created - /// - master dies not in the function registered with atexit - /// - master dies not by a call of a the atexit registerd function (DeletableSingleton::GreathFullDeath) + /// - master never dies (NoDestroy policy) + /// - master never created + /// - master dies not in the function registered with atexit + /// - master dies not by a call of a the atexit registerd function (DeletableSingleton::GreathFullDeath) /// /// \par Usage: /// - /// Lifetime of the master singleton, e.g. with a M class: - /// SingletonHolder::AsMasterLifetime> MasterSingleton; - /// - /// Lifetime of the follower singleton, e.g. with a F class: - /// - /// SingletonHolder::IsDestroyed>FollowerSingleton + /// Lifetimes of the master and the follower singletons, e.g. with a M and a F class: + /// \code SingletonHolder< M , FollowIntoDeath::With::AsMasterLifetime > MasterSingleton; \endcode + /// \code SingletonHolder< F , CreateUsingNew, FollowIntoDeath::AfterMaster< MasterSingleton >::IsDestroyed > FollowerSingleton \endcode //////////////////////////////////////////////////////////////////////////////// class FollowIntoDeath { diff --git a/include/loki/SmartPtr.h b/include/loki/SmartPtr.h index efc0ddc..70f8bdd 100644 --- a/include/loki/SmartPtr.h +++ b/include/loki/SmartPtr.h @@ -16,13 +16,16 @@ #ifndef LOKI_SMARTPTR_INC_ #define LOKI_SMARTPTR_INC_ -//////////////////////////////////////////////////////////////////////////////// -// IMPORTANT NOTE -// Due to threading issues, the OwnershipPolicy has been changed as follows: -// Release() returns a boolean saying if that was the last release -// so the pointer can be deleted by the StoragePolicy -// IsUnique() was removed -//////////////////////////////////////////////////////////////////////////////// +/// \defgroup SmartPointerGroup Smart pointers +/// Policy based implementation of a smart pointer +/// \defgroup SmartPointerOwnershipGroup Ownership policies +/// \ingroup SmartPointerGroup +/// \defgroup SmartPointerStorageGroup Storage policies +/// \ingroup SmartPointerGroup +/// \defgroup SmartPointerConversionGroup Conversion policies +/// \ingroup SmartPointerGroup +/// \defgroup SmartPointerCheckingGroup Checking policies +/// \ingroup SmartPointerGroup #include "SmallObj.h" @@ -36,8 +39,10 @@ namespace Loki { //////////////////////////////////////////////////////////////////////////////// -// class template DefaultSPStorage -// Implementation of the StoragePolicy used by SmartPtr +/// \class DefaultSPStorage +/// +/// \ingroup SmartPointerStorageGroup +/// Implementation of the StoragePolicy used by SmartPtr //////////////////////////////////////////////////////////////////////////////// template @@ -95,9 +100,11 @@ namespace Loki }; //////////////////////////////////////////////////////////////////////////////// -// class template RefCounted -// Implementation of the OwnershipPolicy used by SmartPtr -// Provides a classic external reference counting implementation +/// \class RefCounted +/// +/// \ingroup SmartPointerOwnershipGroup +/// Implementation of the OwnershipPolicy used by SmartPtr +/// Provides a classic external reference counting implementation //////////////////////////////////////////////////////////////////////////////// template @@ -149,10 +156,12 @@ namespace Loki }; //////////////////////////////////////////////////////////////////////////////// -// class template RefCountedMT -// Implementation of the OwnershipPolicy used by SmartPtr -// Implements external reference counting for multithreaded programs -// Policy Usage: RefCountedMTAdj::RefCountedMT +/// \struct RefCountedMT +/// +/// \ingroup SmartPointerOwnershipGroup +/// Implementation of the OwnershipPolicy used by SmartPtr +/// Implements external reference counting for multithreaded programs +/// Policy Usage: RefCountedMTAdj::RefCountedMT //////////////////////////////////////////////////////////////////////////////// template