16 #ifndef ACSDKASSETMANAGERCLIENT_ARTIFACTWRAPPER_H_ 17 #define ACSDKASSETMANAGERCLIENT_ARTIFACTWRAPPER_H_ 21 #include <condition_variable> 34 namespace acsdkAssets {
57 static std::shared_ptr<ArtifactWrapper>
create(
58 const std::shared_ptr<commonInterfaces::AmdCommunicationInterface>& amdComm,
59 const std::shared_ptr<commonInterfaces::ArtifactRequest>& request,
60 const std::shared_ptr<clientInterfaces::ArtifactUpdateValidator>& updateValidator =
nullptr);
65 return m_request->getSummary() == rhs.m_request->getSummary();
69 return !(rhs == *
this);
73 return m_request->getSummary();
87 std::lock_guard<std::mutex> lock(m_stateMutex);
95 std::lock_guard<std::mutex> lock(m_stateMutex);
100 inline std::shared_ptr<commonInterfaces::ArtifactRequest>
getRequest()
const override {
124 void erase()
override;
126 void addWeakPtrObserver(
const std::weak_ptr<clientInterfaces::ArtifactChangeObserver>& observer)
override {
137 std::shared_ptr<commonInterfaces::AmdCommunicationInterface> amdComm,
138 std::shared_ptr<commonInterfaces::ArtifactRequest> request,
139 const std::shared_ptr<clientInterfaces::ArtifactUpdateValidator>& updateValidator =
nullptr);
143 void onCommunicationPropertyChange(
const std::string& PropertyName,
int newValue)
override;
161 void onUpdateAvailable(
const std::string& newPath);
164 const std::shared_ptr<commonInterfaces::AmdCommunicationInterface> m_amdComm;
165 const std::shared_ptr<commonInterfaces::ArtifactRequest> m_request;
166 const std::weak_ptr<clientInterfaces::ArtifactUpdateValidator> m_updateValidator;
170 mutable std::mutex m_stateMutex;
171 mutable std::condition_variable m_stateTrigger;
178 #endif // ACSDKASSETMANAGERCLIENT_ARTIFACTWRAPPER_H_ bool operator!=(const ArtifactWrapper &rhs) const
Definition: ArtifactWrapper.h:68
bool operator==(const ArtifactWrapper &rhs) const
Definition: ArtifactWrapper.h:64
Definition: ArtifactWrapper.h:40
static std::shared_ptr< ArtifactWrapper > create(const std::shared_ptr< commonInterfaces::AmdCommunicationInterface > &amdComm, const std::shared_ptr< commonInterfaces::ArtifactRequest > &request, const std::shared_ptr< clientInterfaces::ArtifactUpdateValidator > &updateValidator=nullptr)
::std::string string
Definition: gtest-port.h:1097
std::shared_ptr< commonInterfaces::ArtifactRequest > getRequest() const override
Definition: ArtifactWrapper.h:100
bool setPriority(commonInterfaces::Priority priority) override
Definition: CommunicationPropertyChangeSubscriber.h:28
std::string name() const override
Definition: ArtifactWrapper.h:72
Definition: ArtifactWrapperInterface.h:35
void removeWeakPtrObserver(const std::weak_ptr< ObserverType > &observer) override
Remove an observer.
Definition: Notifier.h:80
Generic implementation of NotifierInterface.
Definition: Notifier.h:38
bool isPending() const override
Definition: ArtifactWrapper.h:94
~ArtifactWrapper() override=default
void addWeakPtrObserver(const std::weak_ptr< ObserverType > &observer) override
Add a weak reference to an observer.
Definition: Notifier.h:75
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
std::string getPath() const override
bool download() const override
bool isAvailable() const override
Definition: ArtifactWrapper.h:86
State
Definition: State.h:35
void addWeakPtrObserver(const std::weak_ptr< clientInterfaces::ArtifactChangeObserver > &observer) override
Add a weak reference to an observer.
Definition: ArtifactWrapper.h:126
commonInterfaces::Priority getPriority() const override
Priority
Definition: Priority.h:27
void removeWeakPtrObserver(const std::weak_ptr< clientInterfaces::ArtifactChangeObserver > &observer) override
Remove an observer.
Definition: ArtifactWrapper.h:130