From 984d1dd9993aa5beffa4270b6421dea05ab04faa Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 14 Jan 2010 13:48:52 +0000 Subject: Made EntityList superclass for the Macro and TemplateList classes. --- server/src/macrolist.h | 49 ++++--------------------------------------------- 1 file changed, 4 insertions(+), 45 deletions(-) (limited to 'server/src/macrolist.h') diff --git a/server/src/macrolist.h b/server/src/macrolist.h index 4c73ded..51a30ec 100644 --- a/server/src/macrolist.h +++ b/server/src/macrolist.h @@ -28,55 +28,14 @@ #ifndef __PRACRO_MACROLIST_H__ #define __PRACRO_MACROLIST_H__ -#include -#include -#include "versionstr.h" -#include "mutex.h" +#include "entitylist.h" -#include "inotify.h" - -#include "exception.h" - -/** - * The Items contained in the MacroList. - */ -typedef std::map MacroListItem; - -/** - * The MacroList class is intended for macro file caching, so that all macros - * do not need to be parsed on each macro query. - * It builds a list of macros and versions based on the informations read from - * the MacroHeaderParser. - * This means that just because a macro gets into the list doesn't means that it - * will validate as a correct macro (not even nessecarily correct XML). - */ -class MacroList : public std::map { +class MacroList : public EntityList { public: - /** - * Constructor. - * @param macropath A std::string containing the path in which we should look - * for xml files. - */ - MacroList(std::string macropath); - - /** - * Convenience method, to gain the filename of the latest version of a given macro. - * This method throws an Exception if the macro does not exist in the tree. - * @param macro A std::string containing the name of the wanted macro. - * @return A std::string containing the file containing the macro with full path - * included. - */ - std::string getLatestVersion(std::string macro) throw(Exception); + MacroList(std::string path); -private: - bool removeFile(std::string file); +protected: void addFile(std::string file); - void updateFile(std::string file); - void updateList(); - - Mutex mutex; - INotify inotify; - std::string macropath; }; #endif/*__PRACRO_MACROLIST_H__*/ -- cgit v1.2.3