imgtools/romtools/rofsbuild/inc/cache/cachevalidator.hpp
changeset 600 6d08f4a05d93
equal deleted inserted replaced
599:fa7a3cc6effd 600:6d08f4a05d93
       
     1 /**
       
     2  * @file cachevalidator.hpp
       
     3  */
       
     4 
       
     5 
       
     6 #ifndef ROM_TOOLS_ROFSBUILD_CACHE_CACHEVALIDATOR_H_
       
     7 #define ROM_TOOLS_ROFSBUILD_CACHE_CACHEVALIDATOR_H_
       
     8 
       
     9 
       
    10 /**
       
    11  * @class CacheValidator
       
    12  * @brief Validate an existing cache entry.
       
    13  */
       
    14 class CacheValidator
       
    15 {
       
    16 public:
       
    17 	/**
       
    18 	 * @fn CacheValidator* CacheValidator::GetInstance(void)
       
    19 	 * @brief Get singleton instance of class CacheValidator.
       
    20 	 * @return The singleton instance.
       
    21 	 * @exception CacheException Catch allocation failures.
       
    22 	 */
       
    23 	static CacheValidator* GetInstance(void) throw (CacheException);
       
    24 
       
    25 	/**
       
    26 	 * @fn CacheEntry* CacheValidator::Validate(const char* OriginalFilename, int CurrentCompressionID)
       
    27 	 * @brief Validate cached executable with original version.
       
    28 	 * @param OriginalFilename The filename of original executable.
       
    29 	 * @param CurrentCompressionID The ID of compression method used over current image build.
       
    30 	 * @return The entry for cached file or zero if the given executable file is invalidated.
       
    31 	 */
       
    32 	CacheEntry* Validate(const char* OriginalFilename, int CurrentCompressionID);
       
    33 protected:
       
    34 	static CacheValidator* Only;
       
    35 private:
       
    36 	CacheValidator(void);
       
    37 
       
    38 	CacheValidator(const CacheValidator&);
       
    39 
       
    40 	CacheValidator& operator = (const CacheValidator&);
       
    41 };
       
    42 
       
    43 
       
    44 #endif  /* defined ROM_TOOLS_ROFSBUILD_CACHE_CACHEVALIDATOR_H_ */