Leosac
0.7.0
OpenSourceAccessControl
|
Represent an object that we are authorizing against (a door). More...
#include <AuthTarget.hpp>
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::FGPIO * | gpio () |
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::IScheduleCPtr > | always_open_ |
std::vector< Tools::IScheduleCPtr > | always_close_ |
std::unique_ptr< Hardware::FGPIO > | gpio_ |
Optional GPIO associated with the door. More... | |
Represent an object that we are authorizing against (a door).
Definition at line 37 of file AuthTarget.hpp.
|
virtualdefault |
|
explicit |
Definition at line 36 of file AuthTarget.cpp.
void AuthTarget::add_always_close_sched | ( | const Tools::IScheduleCPtr & | sched | ) |
Definition at line 46 of file AuthTarget.cpp.
void AuthTarget::add_always_open_sched | ( | const Tools::IScheduleCPtr & | sched | ) |
Definition at line 41 of file AuthTarget.cpp.
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.
void AuthTarget::gpio | ( | std::unique_ptr< Hardware::FGPIO > | new_gpio | ) |
Definition at line 56 of file AuthTarget.cpp.
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.
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.
const std::string & AuthTarget::name | ( | ) | const |
Definition at line 25 of file AuthTarget.cpp.
void AuthTarget::name | ( | const std::string & | new_name | ) |
Definition at line 30 of file AuthTarget.cpp.
|
protected |
Definition at line 77 of file AuthTarget.hpp.
|
protected |
Definition at line 76 of file AuthTarget.hpp.
|
protected |
Optional GPIO associated with the door.
Definition at line 82 of file AuthTarget.hpp.
|
protected |
Definition at line 74 of file AuthTarget.hpp.