Leosac  0.8.0
Open Source Access Control
Leosac::update::Update Class Reference

Represent an update. More...

#include <Update.hpp>

+ Inheritance diagram for Leosac::update::Update:
+ Collaboration diagram for Leosac::update::Update:

Public Member Functions

 Update ()
 
virtual UpdateId id () const override
 
virtual const TimePointgenerated_at () const override
 
virtual Status status () const override
 
virtual void status (Status st) override
 
virtual const TimePointstatus_updated_at () const override
 
virtual void set_checkpoint (Audit::AuditEntryPtr) override
 Set the checkpoint for the update object. More...
 
virtual Audit::AuditEntryId get_checkpoint () const override
 
virtual const std::string & source_module () const override
 
virtual void source_module (const std::string &s) override
 
virtual const std::string & description () const override
 
virtual void description (const std::string &d) override
 
- Public Member Functions inherited from Leosac::update::IUpdate
virtual ~IUpdate ()=default
 

Private Attributes

UpdateId id_
 
TimePoint generated_at_
 
Audit::AuditTracker checkpoint_
 Tracks the audit entry that represents the point in time of this update. More...
 
TimePoint status_updated_at_
 Last timepoint when status was updated. More...
 
std::string source_module_
 The name (as returned by get_module_name()) that created this update. More...
 
std::string description_
 Optional description for the update. More...
 
Status status_
 
const size_t odb_version_
 

Friends

class odb::access
 

Additional Inherited Members

- Public Types inherited from Leosac::update::IUpdate
using TimePoint = std::chrono::system_clock::time_point
 

Detailed Description

Represent an update.

This is a base class for updates. It is intended to be extended by concrete update type, such as hardware update.

Definition at line 39 of file Update.hpp.

Constructor & Destructor Documentation

◆ Update()

Leosac::update::Update::Update ( )

Definition at line 27 of file Update.cpp.

Member Function Documentation

◆ description() [1/2]

const std::string & Leosac::update::Update::description ( ) const
overridevirtual

Implements Leosac::update::IUpdate.

Definition at line 82 of file Update.cpp.

◆ description() [2/2]

void Leosac::update::Update::description ( const std::string &  d)
overridevirtual

Implements Leosac::update::IUpdate.

Definition at line 86 of file Update.cpp.

◆ generated_at()

const IUpdate::TimePoint & Leosac::update::Update::generated_at ( ) const
overridevirtual

Implements Leosac::update::IUpdate.

Definition at line 40 of file Update.cpp.

◆ get_checkpoint()

Audit::AuditEntryId Leosac::update::Update::get_checkpoint ( ) const
overridevirtual

Implements Leosac::update::IUpdate.

Definition at line 67 of file Update.cpp.

◆ id()

UpdateId Leosac::update::Update::id ( ) const
overridevirtual

Implements Leosac::update::IUpdate.

Definition at line 35 of file Update.cpp.

◆ set_checkpoint()

void Leosac::update::Update::set_checkpoint ( Audit::AuditEntryPtr  )
overridevirtual

Set the checkpoint for the update object.

The checkpoint represents the timepoint at which this update apply.

Implements Leosac::update::IUpdate.

Definition at line 62 of file Update.cpp.

◆ source_module() [1/2]

const std::string & Leosac::update::Update::source_module ( ) const
overridevirtual

Implements Leosac::update::IUpdate.

Definition at line 72 of file Update.cpp.

◆ source_module() [2/2]

void Leosac::update::Update::source_module ( const std::string &  s)
overridevirtual

Implements Leosac::update::IUpdate.

Definition at line 77 of file Update.cpp.

◆ status() [1/2]

Status Leosac::update::Update::status ( ) const
overridevirtual

Implements Leosac::update::IUpdate.

Definition at line 46 of file Update.cpp.

◆ status() [2/2]

void Leosac::update::Update::status ( Status  st)
overridevirtual

Implements Leosac::update::IUpdate.

Definition at line 51 of file Update.cpp.

◆ status_updated_at()

const IUpdate::TimePoint & Leosac::update::Update::status_updated_at ( ) const
overridevirtual

Implements Leosac::update::IUpdate.

Definition at line 57 of file Update.cpp.

Friends And Related Function Documentation

◆ odb::access

friend class odb::access
friend

Definition at line 101 of file Update.hpp.

Member Data Documentation

◆ checkpoint_

Audit::AuditTracker Leosac::update::Update::checkpoint_
private

Tracks the audit entry that represents the point in time of this update.

Definition at line 74 of file Update.hpp.

◆ description_

std::string Leosac::update::Update::description_
private

Optional description for the update.

Definition at line 94 of file Update.hpp.

◆ generated_at_

TimePoint Leosac::update::Update::generated_at_
private

Definition at line 68 of file Update.hpp.

◆ id_

UpdateId Leosac::update::Update::id_
private

Definition at line 66 of file Update.hpp.

◆ odb_version_

const size_t Leosac::update::Update::odb_version_
private

Definition at line 99 of file Update.hpp.

◆ source_module_

std::string Leosac::update::Update::source_module_
private

The name (as returned by get_module_name()) that created this update.

Should be "LEOSAC" for update generated by the core system.

Definition at line 89 of file Update.hpp.

◆ status_

Status Leosac::update::Update::status_
private

Definition at line 96 of file Update.hpp.

◆ status_updated_at_

TimePoint Leosac::update::Update::status_updated_at_
private

Last timepoint when status was updated.

Normally we should only change status once.

Definition at line 81 of file Update.hpp.


The documentation for this class was generated from the following files: