imgtools/romtools/rofsbuild/inc/cache/cachevalidator.hpp
author Ross Qin <ross.qin@nokia.com>
Tue, 02 Nov 2010 09:31:04 +0800
changeset 671 ff8ff850b0cf
parent 600 6d08f4a05d93
permissions -rw-r--r--
fix the Serious problem with ROFS on-disk format
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 cachevalidator.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_CACHEVALIDATOR_H_
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     7
#define ROM_TOOLS_ROFSBUILD_CACHE_CACHEVALIDATOR_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 CacheValidator
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    12
 * @brief Validate an existing cache entry.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    13
 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    14
class CacheValidator
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 CacheValidator* CacheValidator::GetInstance(void)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    19
	 * @brief Get singleton instance of class CacheValidator.
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 allocation failures.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    22
	 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    23
	static CacheValidator* 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 CacheEntry* CacheValidator::Validate(const char* OriginalFilename, int CurrentCompressionID)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    27
	 * @brief Validate cached executable with original version.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    28
	 * @param OriginalFilename The filename of original executable.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    29
	 * @param CurrentCompressionID The ID of compression method used over current image build.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    30
	 * @return The entry for cached file or zero if the given executable file is invalidated.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    31
	 */
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    32
	CacheEntry* Validate(const char* OriginalFilename, int CurrentCompressionID);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    33
protected:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    34
	static CacheValidator* Only;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    35
private:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    36
	CacheValidator(void);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    37
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    38
	CacheValidator(const CacheValidator&);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    39
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    40
	CacheValidator& operator = (const CacheValidator&);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    41
};
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    42
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    43
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    44
#endif  /* defined ROM_TOOLS_ROFSBUILD_CACHE_CACHEVALIDATOR_H_ */