|
Leosac
0.8.0
Open Source Access Control
|
Go to the documentation of this file.
23 #include <boost/uuid/uuid_generators.hpp>
37 : id_(
UUID::random_uuid())
38 , device_class_(device_class)
87 if (e == odb::callback_event::pre_persist ||
88 e == odb::callback_event::pre_update)
93 ASSERT_LOG(hwd_service,
"No hardware service.");
94 auto d = hwd_service->find_device_by_name(
name());
96 if (d && d->id() !=
id())
97 throw ModelException(
"data/attributes/name",
"Device name already used");
100 if (e == odb::callback_event::post_persist ||
101 e == odb::callback_event::post_update)
106 "Device name must be non empty");
Database aware Hardware Service.
DeviceClass
An enumeration describing the class of the device.
std::string name_
Name of an hardware device must be unique due to an implementation details.
ServiceRegistry & get_service_registry()
A function to retrieve the ServiceRegistry from pretty much anywhere.
#define ASSERT_LOG(cond, msg)
virtual void validation_callback(odb::callback_event e, odb::database &) const
Base class for hardware devices.
This is the header file for a generated source file, GitSHA1.cpp.
bool enabled_
Is this device supposed to be enabled?
DeviceClass device_class() const
const std::string & name() const
An exception class for general API error.
uint64_t odb_version() const
std::shared_ptr< ServiceInterface > get_service() const
Retrieve the service instance implementing the ServiceInterface, or nullptr if no such service was re...
DeviceClass device_class_
Thin wrapper around boost::uuids::uuid.