2 /* This file is part of
3 * =================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich.
7 * Copyright 1995-2000 The LyX Team.
9 * This file Copyright 2000 Baruch Even
10 * ================================================= */
12 #ifndef GRAPHICSCACHE_H
13 #define GRAPHICSCACHE_H
22 #include "GraphicsCacheItem.h"
23 #include "support/utility.hpp"
25 /** GraphicsCache is the manager of the image cache, it is responsible to
26 create the GraphicsCacheItem's and maintain them.
28 GraphicsCache is a singleton class, there should be only one instance of
31 class GraphicsCache : public noncopyable {
33 /// Get the instance of the class.
34 static GraphicsCache * getInstance();
36 /// Add a file to the cache.
37 GraphicsCacheItem * addFile(string const & filename);
40 /// Remove a cache item if it's count has gone to zero.
41 void removeFile(string const & filename);
43 /// Private c-tor so we can control how many objects are instantiated.
46 /// Private d-tor so that no-one will destroy us.
49 /// Holder of the single instance of the class.
50 static GraphicsCache * singleton;
52 typedef std::map<string, GraphicsCacheItem *> CacheType;