Leosac  0.8.0
Open Source Access Control
AuditTracker.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2016 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
23 #include "tools/db/database.hpp"
24 #include <boost/date_time/posix_time/posix_time.hpp>
25 #include <memory>
26 #include <odb/core.hxx>
27 
28 namespace Leosac
29 {
30 namespace Audit
31 {
37 #pragma db value
38 class AuditTracker // : virtual public IAuditTracker
39 {
40  public:
41  AuditTracker() = default;
42 
43  AuditTracker(const AuditEntry &) = delete;
44 
45  virtual ~AuditTracker() = default;
46 
47  virtual AuditEntryId last_id() const; // override;
48 
52  void last(AuditEntryLPtr);
53 
54  private:
58  odb::lazy_shared_ptr<AuditEntry> last_;
59 
60  friend class odb::access;
61 };
62 }
63 }
Leosac::Audit::AuditTracker::AuditTracker
AuditTracker()=default
Leosac::Audit::AuditTracker::access
friend class odb::access
Definition: AuditTracker.hpp:60
IAuditTracker.hpp
database.hpp
Leosac::Audit::AuditEntryId
unsigned long AuditEntryId
Definition: AuditFwd.hpp:31
Leosac::Audit::AuditEntryLPtr
odb::lazy_shared_ptr< AuditEntry > AuditEntryLPtr
Definition: AuditFwd.hpp:80
Leosac::Audit::AuditTracker::last
void last(AuditEntryLPtr)
Set the last tracked audit entry.
Definition: AuditTracker.cpp:35
Leosac::Audit::AuditTracker
Implementation of IAuditTracker, backed by ODB.
Definition: AuditTracker.hpp:38
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Audit::AuditTracker::last_
odb::lazy_shared_ptr< AuditEntry > last_
The last audit entry we kept track of.
Definition: AuditTracker.hpp:58
Leosac::Audit::AuditTracker::last_id
virtual AuditEntryId last_id() const
Definition: AuditTracker.cpp:28
Leosac::Audit::AuditTracker::~AuditTracker
virtual ~AuditTracker()=default
Leosac::Audit::AuditEntry
Implementation of IAuditEntry, backed by ODB.
Definition: AuditEntry.hpp:45