mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-06 19:39:56 -05:00
An asset can only be considered synchronized when all required assets are synchronized
This commit is contained in:
@@ -81,7 +81,11 @@ public:
|
||||
|
||||
void setState(State state);
|
||||
void addSynchronization(std::shared_ptr<ResourceSynchronization> synchronization);
|
||||
std::vector<std::shared_ptr<ResourceSynchronization>> synchronizations() const;
|
||||
std::vector<std::shared_ptr<ResourceSynchronization>> ownSynchronizations() const;
|
||||
std::vector<std::shared_ptr<ResourceSynchronization>> requiredSynchronizations() const;
|
||||
|
||||
void syncStateChanged(std::shared_ptr<ResourceSynchronization> sync,
|
||||
ResourceSynchronization::State s);
|
||||
|
||||
// Sync
|
||||
bool isSynchronized();
|
||||
@@ -103,10 +107,13 @@ public:
|
||||
void request(std::shared_ptr<Asset> child);
|
||||
void unrequest(std::shared_ptr<Asset> child);
|
||||
|
||||
std::vector<std::shared_ptr<Asset>> requestedAssets();
|
||||
std::vector<std::shared_ptr<Asset>> requestingAssets();
|
||||
std::vector<std::shared_ptr<Asset>> requiredAssets();
|
||||
std::vector<std::shared_ptr<Asset>> requiringAssets();
|
||||
|
||||
std::vector<std::shared_ptr<Asset>> requiredSubTreeAssets();
|
||||
std::vector<std::shared_ptr<Asset>> subTreeAssets();
|
||||
std::vector<std::shared_ptr<Asset>> requestedAssets();
|
||||
std::vector<std::shared_ptr<Asset>> requiredAssets();
|
||||
std::vector<std::shared_ptr<Asset>> childAssets();
|
||||
|
||||
bool isRequired() const;
|
||||
|
||||
@@ -69,9 +69,12 @@ public:
|
||||
private:
|
||||
std::shared_ptr<Asset> tryAddAsset(const std::string& path);
|
||||
bool tryRemoveAsset(const std::string& path);
|
||||
void assetStateChanged(Asset& asset, Asset::State state);
|
||||
void assetStateChanged(std::shared_ptr<Asset> asset, Asset::State state);
|
||||
|
||||
std::unordered_map<std::string, bool> _pendingStateChangeCommands;
|
||||
std::mutex _pendingInitializationsMutex;
|
||||
std::vector<std::shared_ptr<Asset>> _pendingInitializations;
|
||||
|
||||
std::unique_ptr<AssetLoader> _assetLoader;
|
||||
AssetLoader::CallbackHandle _addAssetCallbackHandle;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user