imgtools/romtools/rofsbuild/inc/cache/cacheablelist.hpp
changeset 600 6d08f4a05d93
equal deleted inserted replaced
599:fa7a3cc6effd 600:6d08f4a05d93
       
     1 /**
       
     2  * @file cacheablelist.hpp
       
     3  */
       
     4 
       
     5 
       
     6 #ifndef ROM_TOOLS_ROFSBUILD_CACHE_CACHEABLELIST_H_
       
     7 #define ROM_TOOLS_ROFSBUILD_CACHE_CACHEABLELIST_H_
       
     8 
       
     9 
       
    10 /**
       
    11  * @class CacheableList
       
    12  * @brief CacheableList is used to hold buffers for executable files to be written into the cache.
       
    13  */
       
    14 class CacheableList
       
    15 {
       
    16 public:
       
    17 	/**
       
    18 	 * @fn CacheableList* CacheableList::GetInstance(void)
       
    19 	 * @return The singleton instance of class CacheableList.
       
    20 	 * @exception CacheException Not enough system resource to create an instance at the first this method gets called.
       
    21 	 */
       
    22 	static CacheableList* GetInstance(void) throw (CacheException);
       
    23 
       
    24 	/**
       
    25 	 * @fn void CacheableList::AddCacheable(CacheEntry* EntryRef)
       
    26 	 * @brief Add a file which needs to be cached into the list, cache generator will process this list.
       
    27 	 * @param EntryRef The instance of CacheEntry, it represents the file which is going to be cached.
       
    28 	 */
       
    29 	void AddCacheable(CacheEntry* EntryRef);
       
    30 
       
    31 	/**
       
    32 	 * @fn CacheEntry* CacheableList::GetCacheable(void)
       
    33 	 * @brief Retrieve a file from this list and write it into cache, the write operation is performed by cache generator.
       
    34 	 * @return The instance of CacheEntry, used by cache generator.
       
    35 	 */
       
    36 	CacheEntry* GetCacheable(void);
       
    37 
       
    38 	virtual ~CacheableList(void);
       
    39 protected:
       
    40 	static CacheableList* Only;
       
    41 
       
    42 	std::queue<CacheEntry*> filelist;
       
    43 
       
    44 	boost::condition_variable queuecond;
       
    45 
       
    46 	boost::mutex queuemutex;
       
    47 private:
       
    48 	CacheableList(void);
       
    49 
       
    50 	CacheableList(const CacheableList&);
       
    51 
       
    52 	CacheableList& operator = (const CacheableList&);
       
    53 };
       
    54 
       
    55 
       
    56 #endif  /* defined ROM_TOOLS_ROFSBUILD_CACHE_CACHEABLELIST_H_ */