22 #include "core/update/Update_odb.h" 34 .track_foreign(backend));
38 boost::placeholders::_1, boost::placeholders::_2)
39 .track_foreign(backend));
43 boost::placeholders::_1, boost::placeholders::_2)
44 .track_foreign(backend));
48 boost::placeholders::_1, boost::placeholders::_2)
49 .track_foreign(backend));
60 for (
const auto &descriptor : descriptors)
76 std::vector<IUpdatePtr> updates;
77 using Query = odb::query<update::Update>;
81 for (
auto i(updates_odb.begin()); i != updates_odb.end(); ++i)
84 ASSERT_LOG(ptr,
"Loading failed, but object should already be loaded.");
85 updates.push_back(ptr);
CheckUpdateT check_update_sig_
void ack_update(IUpdatePtr update, const ExecutionContext &ec)
virtual IUpdatePtr create_update(const UpdateDescriptor &ud, const ExecutionContext &)=0
Create an update based on the UpdateDescriptor ud.
This is the header file for a generated source file, GitSHA1.cpp.
std::vector< IUpdatePtr > pending_updates()
Retrieve the list of pending updates.
ServiceRegistry & get_service_registry()
A function to retrieve the ServiceRegistry from pretty much anywhere.
An optional transaction is an object that behave like an odb::transaction if there is no currently ac...
std::shared_ptr< IUpdate > IUpdatePtr
odb::query< Tools::LogEntry > Query
Provides various database-related services to consumer.
#define ASSERT_LOG(cond, msg)
std::string gen_uuid()
Generate a new UUID.
CancelUpdateT cancel_update_sig_
std::shared_ptr< ServiceInterface > get_service() const
Retrieve the service instance implementing the ServiceInterface, or nullptr if no such service was re...
std::vector< UpdateDescriptorPtr > check_update()
virtual void cancel_update(IUpdatePtr u, const ExecutionContext &)=0
Cancel (not rollback) the pending update u.
AckUpdateT ack_update_sig_
A base class for Leosac specific exception.
CreateUpdateT create_update_sig_
virtual void ack_update(IUpdatePtr u, const ExecutionContext &)=0
Acknowledge the pending update u.
std::shared_ptr< UpdateBackend > UpdateBackendPtr
virtual std::vector< UpdateDescriptorPtr > check_update()=0
Check for updates against arbitrary, module-owned object.
void cancel_update(IUpdatePtr update, const ExecutionContext &ec)
void register_backend(UpdateBackendPtr backend)
Register a backend object.
IUpdatePtr create_update(const std::string &update_descriptor_uuid, const ExecutionContext &ec)
Create an Update object corresponding to the update descriptor whose uuid is update_descriptor_uuid.
std::map< std::string, UpdateDescriptorPtr > published_descriptors_
An ExecutionContext is passed around to service so they have context about who is making the call and...