Skip to content

Commit

Permalink
AssetInformation: Implement V3 changes
Browse files Browse the repository at this point in the history
Clean up V2 element such as the asset element

Signed-off-by: Tobias Klausmann <[email protected]>
  • Loading branch information
tobijk2 committed Sep 12, 2023
1 parent 5c53dff commit 9e0f513
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions src/libaas/basyx/asset/assetinformation.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <basyx/reference.h>
#include <basyx/identifiable.h>
#include <basyx/identifierkeyvaluepair.h>
#include <basyx/asset/asset.h>

#include <basyx/enums/AssetKind.h>

Expand All @@ -17,10 +16,9 @@ class AssetInformation
{
private:
AssetKind assetKind;
util::optional<Asset> asset;
util::optional<Identifier> globalAssetIdRef;
util::optional<Identifier> globalAssetId;
std::vector<IdentifierKeyValuePair> specificAssetId;
std::vector<Reference> billOfMaterial;
util::optional<Identifier> assetType;
util::optional<File> defaultThumbnail;
public:
AssetInformation(AssetKind assetkind) : assetKind(assetkind) {};
Expand All @@ -34,25 +32,18 @@ class AssetInformation
AssetKind getAssetKind() const { return assetKind; };
void setAssetKind(AssetKind kind) { this->assetKind = kind; };

void setAsset(Asset asset) {
//this->globalAssetIdRef = asset;
this->asset.emplace(std::move(asset));
};
const util::optional<Asset> & getAsset() const { return asset; };

const util::optional<Identifier> & getGlobalAssetId() const { return this->globalAssetIdRef; };
void setGlobalAssetId(Identifier globalAssetId) { this->globalAssetIdRef.emplace(std::move(globalAssetId)); };

const util::optional<File> & getDefaultThumbnail() const { return defaultThumbnail; };
void setDefaultThumbnail(File file) { this->defaultThumbnail.emplace(std::move(file)); };

void addBillOfMaterial(Reference bom) { this->billOfMaterial.emplace_back(std::move(bom)); };
const std::vector<Reference> & getBillOfMaterials() const { return this->billOfMaterial; };
std::vector<Reference> & getBillOfMaterials() { return this->billOfMaterial; };
const util::optional<Identifier> & getGlobalAssetId() const { return this->globalAssetId; };
void setGlobalAssetId(Identifier globalAssetId) { this->globalAssetId.emplace(std::move(globalAssetId)); };

void addSpecificAssetId(IdentifierKeyValuePair specificAssetId) { this->specificAssetId.emplace_back(std::move(specificAssetId)); };
const std::vector<IdentifierKeyValuePair> & getSpecificAssetIds() const { return this->specificAssetId; };
std::vector<IdentifierKeyValuePair> & getSpecificAssetIds() { return this->specificAssetId; };

const util::optional<Identifier> & getAssetType() const { return this->assetType; };
void setAssetType(Identifier assetType) { this->assetType.emplace(std::move(assetType)); };

const util::optional<File> & getDefaultThumbnail() const { return defaultThumbnail; };
void setDefaultThumbnail(File file) { this->defaultThumbnail.emplace(std::move(file)); };
};


Expand Down

0 comments on commit 9e0f513

Please sign in to comment.