mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 20:50:59 -05:00
Add meta information to Asset class
This commit is contained in:
@@ -51,6 +51,15 @@ public:
|
||||
using StateChangeCallback = std::function<void(State)>;
|
||||
using CallbackHandle = size_t;
|
||||
|
||||
struct MetaInformation {
|
||||
std::string name;
|
||||
std::string version;
|
||||
std::string description;
|
||||
std::string author;
|
||||
std::string url;
|
||||
std::string license;
|
||||
};
|
||||
|
||||
/**
|
||||
* Root asset constructor
|
||||
*/
|
||||
@@ -136,6 +145,8 @@ public:
|
||||
|
||||
std::string resolveLocalResource(std::string resourceName) const;
|
||||
|
||||
void setMetaInformation(MetaInformation metaInformation);
|
||||
|
||||
private:
|
||||
void setState(State state);
|
||||
|
||||
@@ -157,6 +168,8 @@ private:
|
||||
// Absolute path to asset file
|
||||
std::string _assetPath;
|
||||
|
||||
MetaInformation _metaInformation;
|
||||
|
||||
// Required assets
|
||||
std::vector<std::shared_ptr<Asset>> _requiredAssets;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace openspace {
|
||||
class AssetListener {
|
||||
public:
|
||||
virtual ~AssetListener() = default;
|
||||
virtual void assetStateChanged(std::shared_ptr<Asset> asset, Asset::State state) = 0;
|
||||
virtual void assetStateChanged(Asset* asset, Asset::State state) = 0;
|
||||
virtual void assetRequested(Asset* parent,
|
||||
std::shared_ptr<Asset> child) = 0;
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
/**
|
||||
* Notify listeners about asset state change
|
||||
*/
|
||||
void assetStateChanged(std::shared_ptr<Asset> asset, Asset::State state);
|
||||
void assetStateChanged(Asset* asset, Asset::State state);
|
||||
|
||||
/**
|
||||
* Notify listeners about new requests
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
void removeAll();
|
||||
std::shared_ptr<Asset> rootAsset();
|
||||
|
||||
void assetStateChanged(std::shared_ptr<Asset> asset, Asset::State state) override;
|
||||
void assetStateChanged(Asset* asset, Asset::State state) override;
|
||||
void assetRequested(Asset* parent,
|
||||
std::shared_ptr<Asset> child) override;
|
||||
void assetUnrequested(Asset* parent,
|
||||
|
||||
Reference in New Issue
Block a user