1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmListFileCache.h,v $
6 Date: $Date: 2002-09-19 18:34:15 $
7 Version: $Revision: 1.7 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmListFileCache_h
18 #define cmListFileCache_h
20 #include "cmStandardIncludes.h"
22 /** \class cmListFileCache
23 * \brief A class to cache list file contents.
25 * cmListFileCache is a class used to cache the contents of parsed
29 struct cmListFileFunction
32 std::vector
<std::string
> m_Arguments
;
41 long int m_ModifiedTime
;
42 std::vector
<cmListFileFunction
> m_Functions
;
48 static cmListFileCache
* GetInstance();
49 static void ClearCache();
52 /** Return the cached version of the given file.
53 * If the file is not already in the cache, a cache entry
54 * will be made. If there is an error loading the file,
57 cmListFile
* GetFileCache(const char* path
);
59 //! Flush cache file out of cache.
60 void FlushCache(const char* path
);
64 bool CacheFile(const char* path
);
66 typedef std::map
<cmStdString
, cmListFile
> ListFileMap
;
67 ListFileMap m_ListFileCache
; // file name to ListFile map
68 static cmListFileCache
* Instance
; // singelton pointer