Leosac  0.8.0
Open Source Access Control
Leosac::Tools::SingleTimeFrame Struct Reference

This struct abstracts what we call a single time frame. More...

#include <SingleTimeFrame.hpp>

Public Member Functions

 SingleTimeFrame (int d, int sh, int sm, int eh, int em)
 Construct a SingleTimeFrame. More...
 
 SingleTimeFrame ()
 
 SingleTimeFrame (const SingleTimeFrame &)=default
 
bool operator== (const SingleTimeFrame &o) const
 
bool operator< (const SingleTimeFrame &o) const
 
bool is_in_timeframe (const std::chrono::system_clock::time_point &tp) const
 Is the given timepoint in the time frame ? More...
 

Public Attributes

int day
 
int start_hour
 
int start_min
 
int end_hour
 
int end_min
 

Detailed Description

This struct abstracts what we call a single time frame.

A single time frame represents a time slice in a single given day. It's comprised of:

  • A day of the week
  • A start hour/minute
  • An end hour/minute

Definition at line 38 of file SingleTimeFrame.hpp.

Constructor & Destructor Documentation

◆ SingleTimeFrame() [1/3]

Leosac::Tools::SingleTimeFrame::SingleTimeFrame ( int  d,
int  sh,
int  sm,
int  eh,
int  em 
)

Construct a SingleTimeFrame.

Parameters
dThe day of the week, starts at 0 for monday.
shThe starting hour.
smThe starting minute.
ehThe ending hour.
emThe ending minute.

Definition at line 28 of file SingleTimeFrame.cpp.

◆ SingleTimeFrame() [2/3]

Leosac::Tools::SingleTimeFrame::SingleTimeFrame ( )

Definition at line 37 of file SingleTimeFrame.cpp.

◆ SingleTimeFrame() [3/3]

Leosac::Tools::SingleTimeFrame::SingleTimeFrame ( const SingleTimeFrame )
default

Member Function Documentation

◆ is_in_timeframe()

bool Leosac::Tools::SingleTimeFrame::is_in_timeframe ( const std::chrono::system_clock::time_point &  tp) const

Is the given timepoint in the time frame ?

Definition at line 46 of file SingleTimeFrame.cpp.

◆ operator<()

bool Leosac::Tools::SingleTimeFrame::operator< ( const SingleTimeFrame o) const

Definition at line 71 of file SingleTimeFrame.cpp.

◆ operator==()

bool Leosac::Tools::SingleTimeFrame::operator== ( const SingleTimeFrame o) const

Definition at line 65 of file SingleTimeFrame.cpp.

Member Data Documentation

◆ day

int Leosac::Tools::SingleTimeFrame::day

Definition at line 59 of file SingleTimeFrame.hpp.

◆ end_hour

int Leosac::Tools::SingleTimeFrame::end_hour

Definition at line 62 of file SingleTimeFrame.hpp.

◆ end_min

int Leosac::Tools::SingleTimeFrame::end_min

Definition at line 63 of file SingleTimeFrame.hpp.

◆ start_hour

int Leosac::Tools::SingleTimeFrame::start_hour

Definition at line 60 of file SingleTimeFrame.hpp.

◆ start_min

int Leosac::Tools::SingleTimeFrame::start_min

Definition at line 61 of file SingleTimeFrame.hpp.


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