imgtools/romtools/rofsbuild/inc/cache/cachegenerator.hpp
author lorewang
Wed, 17 Nov 2010 11:24:29 +0800
changeset 685 39f7ecf8fbc7
parent 600 6d08f4a05d93
permissions -rw-r--r--
pull from trunk
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
600
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     1
/**
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     2
 * @file cachegenerator.hpp
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     3
 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     4
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     5
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     6
#ifndef ROM_TOOLS_ROFSBUILD_CACHE_CACHEGENERATOR_H_
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     7
#define ROM_TOOLS_ROFSBUILD_CACHE_CACHEGENERATOR_H_
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     8
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     9
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    10
/**
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    11
 * @class CacheGenerator
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    12
 * @brief Cache Generator will be running in a separated thread, its job is to pick up an invalidated entry from the CacheableList and then write the content into the cache.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    13
 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    14
class CacheGenerator : public boost::thread
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    15
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    16
public:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    17
	/**
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    18
	 * @fn static CacheGenerator* CacheGenerator::GetInstance(void)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    19
	 * @brief Get singleton instance.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    20
	 * @return The singleton instance.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    21
	 * @exception CacheException Catch resource allocation failures.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    22
	 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    23
	static CacheGenerator* GetInstance(void) throw (CacheException);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    24
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    25
	/**
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    26
	 * @fn void CacheGenerator::ProcessFiles(void)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    27
	 * @brief Pick up an invalidated entry from the cacheable list and write the content into the cache (i.e. under cache root directory).
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    28
	 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    29
	static void ProcessFiles(void) throw (CacheException);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    30
protected:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    31
	static CacheGenerator* Only;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    32
private:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    33
	CacheGenerator(void);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    34
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    35
	CacheGenerator(const CacheGenerator&);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    36
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    37
	CacheGenerator& operator = (const CacheGenerator&);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    38
};
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    39
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    40
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    41
#endif  /* defined ROM_TOOLS_ROFSBUILD_CACHE_CACHEGENERATOR_H_ */