Hydra 0.20
hydra.src/desktop/FileEntryCache.h
00001 
00002 /*
00003  * Copyright (c) 2009 Aleksander B. Demko
00004  * This source code is distributed under the MIT license.
00005  * See the accompanying file LICENSE.MIT.txt for details.
00006  */
00007 
00008 #ifndef __INCLUDED_HYDRADESKTOP_FILEENTRYCACHE_H__
00009 #define __INCLUDED_HYDRADESKTOP_FILEENTRYCACHE_H__
00010 
00011 #include <desktop/LoadCache.h>
00012 #include <desktop/FileEntry.h>
00013 
00014 namespace desktop
00015 {
00016   class FileEntryCache;
00017 }
00018 
00019 class desktop::FileEntryCache
00020 {
00021   public:
00022     FileEntryCache(void);
00023 
00024     desktop::cache_ptr<desktop::FileEntry> getEntry(const QString &fullfilename)
00025     { return dm_loader.getItem(fullfilename); }
00026 
00027   private:
00028     class EntryLoader
00029     {
00030       public:
00031         std::tr1::shared_ptr<desktop::FileEntry> operator()(const QString &fullfilename)
00032         { return std::tr1::shared_ptr<desktop::FileEntry>(new desktop::FileEntry(fullfilename)); }
00033     };
00034 
00035     LoadCache<FileEntry, EntryLoader> dm_loader;
00036 };
00037 
00038 #endif
00039 
 All Classes Namespaces Functions Variables