Rose
Public Member Functions | List of all members
ClearSkyEphemeris Class Reference
Inheritance diagram for ClearSkyEphemeris:
Inheritance graph
[legend]
Collaboration diagram for ClearSkyEphemeris:
Collaboration graph
[legend]

Public Member Functions

 ClearSkyEphemeris (const std::string &rootUri, const path &xdgDir, const std::string &storeRoot, std::chrono::system_clock::duration duration)
 Constructor. More...
 
template<typename It >
 ClearSkyEphemeris (const std::string &rootUri, const path &xdgDir, const std::string &storeRoot, std::chrono::system_clock::duration duration, It first, It last)
 
std::string constructUrl (const local_id_t &localId) override
 Construct the appropriate URL for the item. More...
 
- Public Member Functions inherited from rose::WebCache
 WebCache (const std::string &rootUri, const path &xdgDir, const std::string &storeRoot, std::chrono::system_clock::duration duration)
 Constructor. More...
 
template<typename It >
 WebCache (const std::string &rootUri, const path &xdgDir, const std::string &storeRoot, std::chrono::system_clock::duration duration, It first, It last)
 
void setCacheItem (key_t key, local_id_t localId)
 Add or change a cache item. More...
 
template<typename It >
void setCacheItem (It first, It last)
 Add or change cache items from a container. More...
 
bool storeExists () const
 Test to see if the store exists. More...
 
virtual std::string translateItemLocalId (local_id_t localId)
 Translate a local id. More...
 
path itemLocalPath (key_t key)
 Get the filesystem path of a local item by key. More...
 
std::optional< path > localItemExists (key_t key)
 Get the local path to an item if it is known and exists in the local store. More...
 
std::optional< time_t > cacheTime (const path &itemPath)
 Get the time the item was cached if the cache time has expired. More...
 
bool itemKnown (key_t key)
 
bool fetchAll ()
 Fetch all cache items which have not been previously cached or have expired cache times.
 
bool fetchItem (key_t key)
 
bool pendingFutures () const
 
bool processFutures ()
 

Additional Inherited Members

- Public Types inherited from rose::WebCache
using key_t = uint32_t
 
using local_id_t = std::string
 
using result_t = std::tuple< long, key_t >
 
using item_map_t = std::map< key_t, local_id_t >
 
using AsyncList = std::vector< std::future< result_t > >
 
- Static Public Member Functions inherited from rose::WebCache
template<typename T >
static std::chrono::system_clock::time_point fileClockToSystemClock (T fileTimePoint)
 Convert a filesystem time to a system clock time point. More...
 
static std::chrono::system_clock::time_point fileClockToSystemClock (const path &filePath)
 Convert a filesystem time to a system clock time point. More...
 
static WebCache::result_t fetch (WebCache::key_t key, const std::string &itemUrl, const path &itemPath, const path &tempPath, std::optional< time_t > cacheFileTime)
 Fetch a cache item. More...
 
- Public Attributes inherited from rose::WebCache
WebCacheProtocol::signal_type cacheLoaded {}
 
- Protected Member Functions inherited from rose::WebCache
void asyncFetchItem (item_map_t::value_type &item)
 
- Protected Attributes inherited from rose::WebCache
std::error_code mEc {}
 The last error code returned from a std::filesystem operation.
 
std::string mRootURI {}
 The root URI for items in the cache.
 
path mStoreRoot {}
 The root of the filesystem backing store.
 
file_status mStoreStatus {}
 File status of the filesystem backing store root.
 
std::mutex mMutex
 Mutex for locking the WebFileCache.
 
item_map_t mItemMap {}
 The map of keys to local cache items.
 
AsyncList mAsyncList {}
 The list of asynchronous fetches active.
 
std::chrono::system_clock::duration mCacheValidDuration {}
 The duration local files are considered valid. The interval between cache refresh checks.
 

Constructor & Destructor Documentation

◆ ClearSkyEphemeris()

ClearSkyEphemeris::ClearSkyEphemeris ( const std::string &  rootUri,
const path &  xdgDir,
const std::string &  storeRoot,
std::chrono::system_clock::duration  duration 
)
inline

Constructor.

Parameters
rootUriThe base URI locating all the items manage by the cache.
xdgDirThe XDG compliant specification for the user caching directory. See rose::Environment.
storeRootA relative path from xdgDir that this cache will use.
durationThe period of time cache items should be considered valid before being reloaded.

Member Function Documentation

◆ constructUrl()

std::string ClearSkyEphemeris::constructUrl ( const local_id_t &  localId)
inlineoverridevirtual

Construct the appropriate URL for the item.

Default procedure is to append the local id to the rout URI.

Parameters
localIdThe local id.
Returns
The constructed URL.

Reimplemented from rose::WebCache.


The documentation for this class was generated from the following file: