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"
24 /** GraphicsCache is the manager of the image cache, it is responsible to
25 * create the GraphicsCacheItem's and maintain them.
27 * GraphicsCache is a singleton class, there should be only one instance of
32 /// Get the instance of the class.
33 static GraphicsCache * getInstance();
35 /// Add a file to the cache.
36 GraphicsCacheItem * addFile(string filename);
39 /// Remove a cache item if it's count has gone to zero.
40 void removeFile(string filename);
42 /// Private c-tor so we can control how many objects are instantiated.
45 /// Private d-tor so that no-one will destroy us.
50 /// Holder of the single instance of the class.
51 static GraphicsCache * singleton;
53 typedef std::map<string, GraphicsCacheItem *> CacheType;
57 GraphicsCache * GraphicsCache::singleton = 0;