Leosac  0.8.0
Open Source Access Control
IUpdate.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 
22 #include "core/audit/AuditFwd.hpp"
24 #include <chrono>
25 
26 namespace Leosac
27 {
28 namespace update
29 {
30 class IUpdate
31 {
32  public:
33  using TimePoint = std::chrono::system_clock::time_point;
34 
35  virtual ~IUpdate() = default;
36 
37  virtual UpdateId id() const = 0;
38 
39  virtual const TimePoint &generated_at() const = 0;
40 
41  virtual Status status() const = 0;
42  virtual void status(Status st) = 0;
43 
44  virtual const TimePoint &status_updated_at() const = 0;
45 
46  virtual const std::string &source_module() const = 0;
47 
48  virtual void source_module(const std::string &s) = 0;
49  virtual const std::string &description() const = 0;
50 
51  virtual void description(const std::string &d) = 0;
52 
59  virtual void set_checkpoint(Audit::AuditEntryPtr) = 0;
60 
61  virtual Audit::AuditEntryId get_checkpoint() const = 0;
62 };
63 }
64 }
Leosac::update::IUpdate::generated_at
virtual const TimePoint & generated_at() const =0
Leosac::Audit::AuditEntryPtr
std::shared_ptr< AuditEntry > AuditEntryPtr
Definition: AuditFwd.hpp:81
Leosac::Audit::AuditEntryId
unsigned long AuditEntryId
Definition: AuditFwd.hpp:31
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::update::IUpdate::~IUpdate
virtual ~IUpdate()=default
Leosac::update::IUpdate::get_checkpoint
virtual Audit::AuditEntryId get_checkpoint() const =0
Leosac::update::Status
Status
Definition: UpdateFwd.hpp:30
Leosac::update::IUpdate::TimePoint
std::chrono::system_clock::time_point TimePoint
Definition: IUpdate.hpp:33
Leosac::update::IUpdate
Definition: IUpdate.hpp:30
Leosac::update::IUpdate::description
virtual const std::string & description() const =0
Leosac::update::IUpdate::status_updated_at
virtual const TimePoint & status_updated_at() const =0
UpdateFwd.hpp
AuditFwd.hpp
Leosac::update::IUpdate::status
virtual Status status() const =0
Leosac::update::IUpdate::source_module
virtual const std::string & source_module() const =0
Leosac::update::IUpdate::set_checkpoint
virtual void set_checkpoint(Audit::AuditEntryPtr)=0
Set the checkpoint for the update object.
Leosac::update::UpdateId
unsigned long UpdateId
Definition: UpdateFwd.hpp:56
Leosac::update::IUpdate::id
virtual UpdateId id() const =0