Leosac  0.7.0
OpenSourceAccessControl
Leosac::Auth::AuthTarget Class Reference

Represent an object that we are authorizing against (a door). More...

#include <AuthTarget.hpp>

+ Collaboration diagram for Leosac::Auth::AuthTarget:

Public Member Functions

virtual ~AuthTarget ()=default
 
 AuthTarget (const std::string target_name)
 
const std::string & name () const
 
void name (const std::string &new_name)
 
void add_always_open_sched (const Tools::IScheduleCPtr &sched)
 
void add_always_close_sched (const Tools::IScheduleCPtr &sched)
 
bool is_always_open (const std::chrono::system_clock::time_point &tp) const
 Check whether the door is in "always open" mode at the given time point. More...
 
bool is_always_closed (const std::chrono::system_clock::time_point &tp) const
 Check whether the door is in "always closed" mode at the given time point. More...
 
Hardware::FGPIOgpio ()
 Returns the pointer to the optional FGPIO associated with the door. More...
 
void gpio (std::unique_ptr< Hardware::FGPIO > new_gpio)
 

Protected Attributes

std::string name_
 
std::vector< Tools::IScheduleCPtralways_open_
 
std::vector< Tools::IScheduleCPtralways_close_
 
std::unique_ptr< Hardware::FGPIOgpio_
 Optional GPIO associated with the door. More...
 

Detailed Description

Represent an object that we are authorizing against (a door).

Definition at line 37 of file AuthTarget.hpp.

Constructor & Destructor Documentation

◆ ~AuthTarget()

virtual Leosac::Auth::AuthTarget::~AuthTarget ( )
virtualdefault

◆ AuthTarget()

AuthTarget::AuthTarget ( const std::string  target_name)
explicit

Definition at line 36 of file AuthTarget.cpp.

Member Function Documentation

◆ add_always_close_sched()

void AuthTarget::add_always_close_sched ( const Tools::IScheduleCPtr sched)

Definition at line 46 of file AuthTarget.cpp.

◆ add_always_open_sched()

void AuthTarget::add_always_open_sched ( const Tools::IScheduleCPtr sched)

Definition at line 41 of file AuthTarget.cpp.

◆ gpio() [1/2]

Leosac::Hardware::FGPIO * AuthTarget::gpio ( )

Returns the pointer to the optional FGPIO associated with the door.

It may be NULL.

Do not free or keep reference on it longer than the lifetime of the AuthTarget object. If you ever set a new gpio() pointer for this AuthTarget, the previous reference will become invalid.

Definition at line 51 of file AuthTarget.cpp.

◆ gpio() [2/2]

void AuthTarget::gpio ( std::unique_ptr< Hardware::FGPIO new_gpio)

Definition at line 56 of file AuthTarget.cpp.

◆ is_always_closed()

bool AuthTarget::is_always_closed ( const std::chrono::system_clock::time_point &  tp) const

Check whether the door is in "always closed" mode at the given time point.

Definition at line 72 of file AuthTarget.cpp.

◆ is_always_open()

bool AuthTarget::is_always_open ( const std::chrono::system_clock::time_point &  tp) const

Check whether the door is in "always open" mode at the given time point.

Definition at line 61 of file AuthTarget.cpp.

◆ name() [1/2]

const std::string & AuthTarget::name ( ) const

Definition at line 25 of file AuthTarget.cpp.

◆ name() [2/2]

void AuthTarget::name ( const std::string &  new_name)

Definition at line 30 of file AuthTarget.cpp.

Member Data Documentation

◆ always_close_

std::vector<Tools::IScheduleCPtr> Leosac::Auth::AuthTarget::always_close_
protected

Definition at line 77 of file AuthTarget.hpp.

◆ always_open_

std::vector<Tools::IScheduleCPtr> Leosac::Auth::AuthTarget::always_open_
protected

Definition at line 76 of file AuthTarget.hpp.

◆ gpio_

std::unique_ptr<Hardware::FGPIO> Leosac::Auth::AuthTarget::gpio_
protected

Optional GPIO associated with the door.

Definition at line 82 of file AuthTarget.hpp.

◆ name_

std::string Leosac::Auth::AuthTarget::name_
protected

Definition at line 74 of file AuthTarget.hpp.


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