|
Leosac
0.8.0
Open Source Access Control
|
Go to the documentation of this file.
27 #include <boost/date_time/posix_time/posix_time.hpp>
29 #include <odb/callback.hxx>
30 #include <odb/core.hxx>
44 #pragma db object polymorphic optimistic callback(odb_callback)
46 public std::enable_shared_from_this<AuditEntry>
77 virtual size_t version()
const override;
79 virtual void reload()
override;
81 virtual boost::posix_time::ptime
timestamp()
const override;
102 #pragma db value_not_null
106 #pragma db inverse(children_)
118 #pragma db type("TEXT")
167 void odb_callback(odb::callback_event e, odb::database &)
const;
170 #pragma db view object(AuditEntry)
173 #pragma db column("count(" + AuditEntry::id_ + ")")
virtual ~AuditEntry()=default
virtual void author(Auth::UserPtr user) override
Set the author of the entry.
virtual size_t children_count() const override
Returns the number of children that this entry has.
std::shared_ptr< AuditEntry > AuditEntryPtr
void odb_callback(odb::callback_event e, odb::database &) const
Implementation of an ODB callback.
virtual Auth::UserId author_id() const override
Retrieve the user id of the author of this entry.
void database(DBPtr db)
Set the database pointer.
std::shared_ptr< User > UserPtr
std::vector< AuditEntryPtr > children_
unsigned long AuditEntryId
std::shared_ptr< odb::database > DBPtr
virtual const EventMask & event_mask() const override
Retrieve the current event mask.
std::shared_ptr< IAuditEntry > IAuditEntryPtr
virtual void remove_parent() override
Remove the parent-child relationship between this entry and its parent.
std::weak_ptr< AuditEntry > AuditEntryWPtr
boost::posix_time::ptime timestamp_
This is the header file for a generated source file, GitSHA1.cpp.
size_t duration_
How long did it take for the Audit object to be finalized.
odb::lazy_shared_ptr< User > UserLPtr
virtual bool finalized() const override
Is this entry finalized.
virtual void finalize() override
Mark the entry as finalized, and update it wrt the database.
static AuditEntryPtr get_last_audit(DBPtr db)
Retrieve the last (finalized) audit entry.
Tools::ElapsedTimeCounter etc_
Keep track of how long the object has been alive.
FlagSet< EventType > EventMask
virtual IAuditEntryPtr parent() const override
Retrieve the parent of this entry.
virtual void set_parent(IAuditEntryPtr parent) override
Set parent as the parent audit entry for this entry.
virtual boost::posix_time::ptime timestamp() const override
Retrieve unix timestamp.
DBPtr database_
Pointer to the database.
Base interface to Audit object.
bool finalized_
Audit entry are sometime persisted multiple time before reaching their final state.
virtual AuditEntryId id() const override
Retrieve the identifier of the entry.
Implementation of IAuditEntry, backed by ODB.
virtual void reload() override
Reload the object from the database.
virtual size_t version() const override
Returns the ODB version of the object.
Auth::UserLPtr author_
The user at the source of the entry.