From: Francesco Chemolli Date: Sat, 5 Jul 2008 23:26:10 +0000 (+0200) Subject: Documentation. X-Git-Tag: SQUID_3_1_0_1~49^2~143^2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d154d3ec85755999fac654dad5de4b3f0541a6f7;p=thirdparty%2Fsquid.git Documentation. --- diff --git a/src/CacheManager.h b/src/CacheManager.h index 4ff2675e29..cda9426909 100644 --- a/src/CacheManager.h +++ b/src/CacheManager.h @@ -40,8 +40,16 @@ /** \defgroup CacheManagerAPI Cache Manager API \ingroup Components + + \defgroup CacheManagerInternal Cache Manager intenal API (not for public use) + \ingroup CacheManagerAPI */ +/** + \ingroup CacheManagerInternal + * The basic action handler. Its virtual method run(StoreEntry *) is invoked + * to perform the actual action. + */ class CacheManagerAction { public: virtual void run(StoreEntry *sentry) = 0; @@ -58,9 +66,10 @@ public: }; /** - \ingroup CacheManagerAPI + \ingroup CacheManagerInternal * wrapper allowing c-style callbacks to be used. Arguments are supposed to - * managed by the caller, as they will be copied over by the constructor. + * managed by the caller. + * This object is generated by CacheManager::registerAction */ class CacheManagerActionLegacy : public CacheManagerAction { public: diff --git a/src/cache_manager.cc b/src/cache_manager.cc index 4eed8ad3a6..4db2e558ec 100644 --- a/src/cache_manager.cc +++ b/src/cache_manager.cc @@ -51,18 +51,24 @@ #define MGR_PASSWD_SZ 128 - +/** + \ingroup CacheManagerInternals + * Constructor. Its purpose is to register internal commands + */ CacheManager::CacheManager() { - //if (ActionsList != NULL) - // delete(ActionsList); //TODO: Laaazy. Will be moved to class member - //ActionsList = new CacheManagerActionList; registerAction(new OfflineToggleAction); registerAction(new ShutdownAction); registerAction(new ReconfigureAction); registerAction(new MenuAction(this)); } +/** + \ingroup CacheManagerAPI + * Registers a C-style action, which is implemented as a pointer to a function + * taking as argument a pointer to a StoreEntry and returning void. + * Implemented via CacheManagerActionLegacy. + */ void CacheManager::registerAction(char const * action, char const * desc, OBJH * handler, int pw_req_flag, int atomic) { @@ -70,6 +76,12 @@ CacheManager::registerAction(char const * action, char const * desc, OBJH * hand registerAction(new CacheManagerActionLegacy(action,desc,pw_req_flag,atomic,handler)); } +/** + \ingroup CacheManagerAPI + * Registers a C++-style action, via a poiner to a subclass of + * a CacheManagerAction object, whose run() method will be invoked when + * CacheManager identifies that the user has requested the action. + */ void CacheManager::registerAction(CacheManagerAction *anAction) { @@ -87,7 +99,12 @@ CacheManager::registerAction(CacheManagerAction *anAction) } -/// \ingroup CacheManagerInternal +/** + \ingroup CacheManagerInternal + * Locates an action in the actions registry ActionsList. +\retval NULL if Action not found +\retval CacheManagerAction* if the action was found + */ CacheManagerAction * CacheManager::findAction(char const * action) {