32 #pragma db object polymorphic callback(odb_callback) 40 static std::shared_ptr<DoorEvent>
52 virtual void before(
const std::string &repr)
override;
54 virtual void after(
const std::string &repr)
override;
56 virtual const std::string &
before()
const override;
58 virtual const std::string &
after()
const override;
76 #pragma db on_delete(set_null) Auth::AccessPointId access_point_id_before_
The id of the associated AP before the event.
static std::shared_ptr< DoorEvent > create(const DBPtr &database, Auth::IDoorPtr target_door, AuditEntryPtr parent)
unsigned long AccessPointId
Implementation of IAuditEntry, backed by ODB.
This is the header file for a generated source file, GitSHA1.cpp.
Provides an implementation of IDoorEvent.
virtual Auth::AccessPointId access_point_id_after() const override
Return the id of the associated access_point after the event took place.
std::shared_ptr< IDoor > IDoorPtr
virtual IAuditEntryPtr parent() const override
Retrieve the parent of this entry.
virtual const std::string & before() const override
Auth::DoorId target_door_id_
virtual std::string generate_description() const override
Generate a description for this event.
std::shared_ptr< AuditEntry > AuditEntryPtr
virtual ~DoorEvent()=default
std::string before_
Optional JSON dump of the object before the event took place.
virtual const std::string & after() const override
static std::shared_ptr< DoorEvent > create_empty()
virtual Auth::DoorId target_id() const override
odb::lazy_weak_ptr< Door > DoorLWPtr
Auth::AccessPointId access_point_id_after_
The id of associated AP after the event.
virtual Auth::AccessPointId access_point_id_before() const override
Return the id of the associated access_point before the event took place.
virtual void target(Auth::IDoorPtr door) override
Set the door that is targeted by the event.
Interface that describes an Audit object for door related event.
std::string generate_target_description() const
Generate a short description for the targeted door.
std::string after_
Optional JSON dump of the object after the event took place.
std::shared_ptr< odb::database > DBPtr
void database(DBPtr db)
Set the database pointer.
Provide static methods to instanciate various Audit objects.