Leosac  0.8.0
Open Source Access Control
Leosac::Tools::Schedule Class Reference

A schedule is simply a list of time frame (SingleTimeFrame) with a name. More...

#include <Schedule.hpp>

+ Inheritance diagram for Leosac::Tools::Schedule:
+ Collaboration diagram for Leosac::Tools::Schedule:

Public Member Functions

 Schedule (const std::string &sched_name="")
 
virtual ~Schedule ()=default
 
 Schedule (const Schedule &)=default
 
const std::string & name () const override
 Retrieve the name of the schedule. More...
 
bool is_in_schedule (const std::chrono::system_clock::time_point &tp) const override
 Check whether or not the given time point can be found in the schedule. More...
 
void add_timeframe (const SingleTimeFrame &tf) override
 Add the given timeframe to this schedule;. More...
 
const std::string & description () const override
 
void name (const std::string &) override
 
void description (const std::string &) override
 
void clear_timeframes () override
 Remove all the timeframes from this schedule. More...
 
ScheduleId id () const override
 
std::vector< SingleTimeFrametimeframes () const override
 Retrieves the list of timesframes that compose this schedule. More...
 
void add_mapping (const Tools::ScheduleMappingPtr &map) override
 
void clear_mapping () override
 
std::vector< ScheduleMappingPtrmapping () const override
 
size_t odb_version () const override
 
- Public Member Functions inherited from Leosac::Tools::ISchedule
virtual ~ISchedule ()=default
 

Private Attributes

ScheduleId id_
 
std::vector< SingleTimeFrametimeframes_
 
std::string name_
 
std::string description_
 
std::vector< Tools::ScheduleMappingPtrmapping_
 
size_t odb_version_
 

Friends

class odb::access
 
class ::Leosac::TestAccess
 

Detailed Description

A schedule is simply a list of time frame (SingleTimeFrame) with a name.

Definition at line 41 of file Schedule.hpp.

Constructor & Destructor Documentation

◆ Schedule() [1/2]

Schedule::Schedule ( const std::string &  sched_name = "")

Definition at line 27 of file Schedule.cpp.

◆ ~Schedule()

virtual Leosac::Tools::Schedule::~Schedule ( )
virtualdefault

◆ Schedule() [2/2]

Leosac::Tools::Schedule::Schedule ( const Schedule )
default

Member Function Documentation

◆ add_mapping()

void Schedule::add_mapping ( const Tools::ScheduleMappingPtr map)
overridevirtual

Implements Leosac::Tools::ISchedule.

Definition at line 89 of file Schedule.cpp.

◆ add_timeframe()

void Schedule::add_timeframe ( const SingleTimeFrame tf)
overridevirtual

Add the given timeframe to this schedule;.

Implements Leosac::Tools::ISchedule.

Definition at line 43 of file Schedule.cpp.

◆ clear_mapping()

void Schedule::clear_mapping ( )
overridevirtual

Implements Leosac::Tools::ISchedule.

Definition at line 96 of file Schedule.cpp.

◆ clear_timeframes()

void Schedule::clear_timeframes ( )
overridevirtual

Remove all the timeframes from this schedule.

Implements Leosac::Tools::ISchedule.

Definition at line 84 of file Schedule.cpp.

◆ description() [1/2]

const std::string & Schedule::description ( ) const
overridevirtual

Implements Leosac::Tools::ISchedule.

Definition at line 53 of file Schedule.cpp.

◆ description() [2/2]

void Schedule::description ( const std::string &  desc)
overridevirtual

Implements Leosac::Tools::ISchedule.

Definition at line 79 of file Schedule.cpp.

◆ id()

ScheduleId Schedule::id ( ) const
overridevirtual

Implements Leosac::Tools::ISchedule.

Definition at line 58 of file Schedule.cpp.

◆ is_in_schedule()

bool Schedule::is_in_schedule ( const std::chrono::system_clock::time_point &  tp) const
overridevirtual

Check whether or not the given time point can be found in the schedule.

Implements Leosac::Tools::ISchedule.

Definition at line 33 of file Schedule.cpp.

◆ mapping()

std::vector< ScheduleMappingPtr > Schedule::mapping ( ) const
overridevirtual

Implements Leosac::Tools::ISchedule.

Definition at line 101 of file Schedule.cpp.

◆ name() [1/2]

const std::string & Schedule::name ( ) const
overridevirtual

Retrieve the name of the schedule.

Implements Leosac::Tools::ISchedule.

Definition at line 48 of file Schedule.cpp.

◆ name() [2/2]

void Schedule::name ( const std::string &  name)
overridevirtual

Implements Leosac::Tools::ISchedule.

Definition at line 73 of file Schedule.cpp.

◆ odb_version()

size_t Schedule::odb_version ( ) const
overridevirtual

Implements Leosac::Tools::ISchedule.

Definition at line 68 of file Schedule.cpp.

◆ timeframes()

std::vector< SingleTimeFrame > Schedule::timeframes ( ) const
overridevirtual

Retrieves the list of timesframes that compose this schedule.

Implements Leosac::Tools::ISchedule.

Definition at line 63 of file Schedule.cpp.

Friends And Related Function Documentation

◆ ::Leosac::TestAccess

friend class ::Leosac::TestAccess
friend

Definition at line 77 of file Schedule.hpp.

◆ odb::access

friend class odb::access
friend

Definition at line 76 of file Schedule.hpp.

Member Data Documentation

◆ description_

std::string Leosac::Tools::Schedule::description_
private

Definition at line 88 of file Schedule.hpp.

◆ id_

ScheduleId Leosac::Tools::Schedule::id_
private

Definition at line 80 of file Schedule.hpp.

◆ mapping_

std::vector<Tools::ScheduleMappingPtr> Leosac::Tools::Schedule::mapping_
private

Definition at line 91 of file Schedule.hpp.

◆ name_

std::string Leosac::Tools::Schedule::name_
private

Definition at line 86 of file Schedule.hpp.

◆ odb_version_

size_t Leosac::Tools::Schedule::odb_version_
private

Definition at line 94 of file Schedule.hpp.

◆ timeframes_

std::vector<SingleTimeFrame> Leosac::Tools::Schedule::timeframes_
private

Definition at line 83 of file Schedule.hpp.


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