mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-30 23:40:06 +00:00 
			
		
		
		
	Initial moving of product listing to the background for level 3
This commit is contained in:
		
							parent
							
								
									68f66c0c2f
								
							
						
					
					
						commit
						f4226b487d
					
				
					 14 changed files with 356 additions and 178 deletions
				
			
		|  | @ -46,7 +46,9 @@ public: | |||
|    std::string FindLatestKey() override; | ||||
|    std::chrono::system_clock::time_point FindLatestTime() override; | ||||
|    std::vector<std::chrono::system_clock::time_point> | ||||
|    GetTimePointsByDate(std::chrono::system_clock::time_point date) override; | ||||
|         GetTimePointsByDate(std::chrono::system_clock::time_point date, | ||||
|                             bool                                  update) override; | ||||
|    bool IsDateCached(std::chrono::system_clock::time_point date) override; | ||||
|    std::tuple<bool, size_t, size_t> | ||||
|    ListObjects(std::chrono::system_clock::time_point date) override; | ||||
|    std::shared_ptr<wsr88d::NexradFile> | ||||
|  |  | |||
|  | @ -2,17 +2,12 @@ | |||
| 
 | ||||
| #include <scwx/provider/nexrad_data_provider.hpp> | ||||
| 
 | ||||
| namespace Aws | ||||
| { | ||||
| namespace S3 | ||||
| namespace Aws::S3 | ||||
| { | ||||
| class S3Client; | ||||
| } // namespace S3
 | ||||
| } // namespace Aws
 | ||||
| } // namespace Aws::S3
 | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace provider | ||||
| namespace scwx::provider | ||||
| { | ||||
| 
 | ||||
| /**
 | ||||
|  | @ -32,20 +27,23 @@ public: | |||
|    AwsNexradDataProvider(AwsNexradDataProvider&&) noexcept; | ||||
|    AwsNexradDataProvider& operator=(AwsNexradDataProvider&&) noexcept; | ||||
| 
 | ||||
|    size_t cache_size() const override; | ||||
|    [[nodiscard]] std::size_t cache_size() const override; | ||||
| 
 | ||||
|    std::chrono::system_clock::time_point last_modified() const override; | ||||
|    std::chrono::seconds                  update_period() const override; | ||||
|    [[nodiscard]] std::chrono::system_clock::time_point | ||||
|                                       last_modified() const override; | ||||
|    [[nodiscard]] std::chrono::seconds update_period() const override; | ||||
| 
 | ||||
|    std::string FindKey(std::chrono::system_clock::time_point time) override; | ||||
|    std::string FindLatestKey() override; | ||||
|    std::chrono::system_clock::time_point FindLatestTime() override; | ||||
|    std::vector<std::chrono::system_clock::time_point> | ||||
|    GetTimePointsByDate(std::chrono::system_clock::time_point date) override; | ||||
|         GetTimePointsByDate(std::chrono::system_clock::time_point date, | ||||
|                             bool                                  update) override; | ||||
|    bool IsDateCached(std::chrono::system_clock::time_point date) override; | ||||
|    std::tuple<bool, size_t, size_t> | ||||
|    ListObjects(std::chrono::system_clock::time_point date) override; | ||||
|    std::shared_ptr<wsr88d::NexradFile> | ||||
|                              LoadObjectByKey(const std::string& key) override; | ||||
|    LoadObjectByKey(const std::string& key) override; | ||||
|    std::shared_ptr<wsr88d::NexradFile> | ||||
|    LoadObjectByTime(std::chrono::system_clock::time_point time) override; | ||||
|    std::pair<size_t, size_t> Refresh() override; | ||||
|  | @ -61,5 +59,4 @@ private: | |||
|    std::unique_ptr<Impl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace provider
 | ||||
| } // namespace scwx
 | ||||
| } // namespace scwx::provider
 | ||||
|  |  | |||
|  | @ -7,9 +7,7 @@ | |||
| #include <string> | ||||
| #include <vector> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace provider | ||||
| namespace scwx::provider | ||||
| { | ||||
| 
 | ||||
| class NexradDataProvider | ||||
|  | @ -24,7 +22,7 @@ public: | |||
|    NexradDataProvider(NexradDataProvider&&) noexcept; | ||||
|    NexradDataProvider& operator=(NexradDataProvider&&) noexcept; | ||||
| 
 | ||||
|    virtual size_t cache_size() const = 0; | ||||
|    [[nodiscard]] virtual size_t cache_size() const = 0; | ||||
| 
 | ||||
|    /**
 | ||||
|     * Gets the last modified time. This is equal to the most recent object's | ||||
|  | @ -32,7 +30,8 @@ public: | |||
|     * | ||||
|     * @return Last modified time | ||||
|     */ | ||||
|    virtual std::chrono::system_clock::time_point last_modified() const = 0; | ||||
|    [[nodiscard]] virtual std::chrono::system_clock::time_point | ||||
|    last_modified() const = 0; | ||||
| 
 | ||||
|    /**
 | ||||
|     * Gets the current update period. This is equal to the difference between | ||||
|  | @ -41,7 +40,7 @@ public: | |||
|     * | ||||
|     * @return Update period | ||||
|     */ | ||||
|    virtual std::chrono::seconds update_period() const = 0; | ||||
|    [[nodiscard]] virtual std::chrono::seconds update_period() const = 0; | ||||
| 
 | ||||
|    /**
 | ||||
|     * Finds the most recent key in the cache, no later than the time provided. | ||||
|  | @ -116,7 +115,7 @@ public: | |||
|     * | ||||
|     * @return NEXRAD data time point | ||||
|     */ | ||||
|    virtual std::chrono::system_clock::time_point | ||||
|    [[nodiscard]] virtual std::chrono::system_clock::time_point | ||||
|    GetTimePointByKey(const std::string& key) const = 0; | ||||
| 
 | ||||
|    /**
 | ||||
|  | @ -124,11 +123,22 @@ public: | |||
|     * to the cache if required. | ||||
|     * | ||||
|     * @param date Date for which to get NEXRAD data time points | ||||
|     * @param update Whether or not to list and add data not present in the cache | ||||
|     * | ||||
|     * @return NEXRAD data time points | ||||
|     */ | ||||
|    virtual std::vector<std::chrono::system_clock::time_point> | ||||
|    GetTimePointsByDate(std::chrono::system_clock::time_point date) = 0; | ||||
|    GetTimePointsByDate(std::chrono::system_clock::time_point date, | ||||
|                        bool                                  update) = 0; | ||||
| 
 | ||||
|    /**
 | ||||
|     * Determines if time points for the requested date are cached. | ||||
|     * | ||||
|     * @param date Date for which to query the cache | ||||
|     * | ||||
|     * @return Whether or not the requested date is cached | ||||
|     */ | ||||
|    virtual bool IsDateCached(std::chrono::system_clock::time_point date) = 0; | ||||
| 
 | ||||
|    /**
 | ||||
|     * Requests available NEXRAD products for the current radar site, and adds | ||||
|  | @ -148,5 +158,4 @@ private: | |||
|    std::unique_ptr<Impl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace provider
 | ||||
| } // namespace scwx
 | ||||
| } // namespace scwx::provider
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat