Leosac  0.8.0
Open Source Access Control
Leosac::Hardware::Device Class Reference

Base class for hardware devices. More...

#include <Device.hpp>

+ Inheritance diagram for Leosac::Hardware::Device:
+ Collaboration diagram for Leosac::Hardware::Device:

Public Member Functions

 Device ()
 
 Device (DeviceClass device_class)
 
virtual ~Device ()=default
 
virtual void validation_callback (odb::callback_event e, odb::database &) const
 
UUID id () const
 
const std::string & name () const
 
void name (const std::string &name)
 
DeviceClass device_class () const
 
void device_class (DeviceClass d)
 
bool enabled () const
 
void enabled (bool e)
 
uint64_t odb_version () const
 

Private Attributes

DeviceId id_
 
std::string name_
 Name of an hardware device must be unique due to an implementation details. More...
 
DeviceClass device_class_
 
bool enabled_
 Is this device supposed to be enabled? More...
 
uint64_t version_
 

Detailed Description

Base class for hardware devices.

Device is an abstraction around GPIOs, RFID-readers, and possibly other device classes.

Note
This class hierarchy provide no behavior, simply data storage.

Definition at line 44 of file Device.hpp.

Constructor & Destructor Documentation

◆ Device() [1/2]

Leosac::Hardware::Device::Device ( )

Definition at line 31 of file Device.cpp.

◆ Device() [2/2]

Leosac::Hardware::Device::Device ( DeviceClass  device_class)
explicit

Definition at line 36 of file Device.cpp.

◆ ~Device()

virtual Leosac::Hardware::Device::~Device ( )
virtualdefault

Member Function Documentation

◆ device_class() [1/2]

DeviceClass Leosac::Hardware::Device::device_class ( ) const

Definition at line 65 of file Device.cpp.

◆ device_class() [2/2]

void Leosac::Hardware::Device::device_class ( DeviceClass  d)

Definition at line 70 of file Device.cpp.

◆ enabled() [1/2]

bool Leosac::Hardware::Device::enabled ( ) const

Definition at line 75 of file Device.cpp.

◆ enabled() [2/2]

void Leosac::Hardware::Device::enabled ( bool  e)

Definition at line 80 of file Device.cpp.

◆ id()

UUID Leosac::Hardware::Device::id ( ) const

Definition at line 49 of file Device.cpp.

◆ name() [1/2]

const std::string & Leosac::Hardware::Device::name ( ) const

Definition at line 55 of file Device.cpp.

◆ name() [2/2]

void Leosac::Hardware::Device::name ( const std::string &  name)

Definition at line 60 of file Device.cpp.

◆ odb_version()

uint64_t Leosac::Hardware::Device::odb_version ( ) const

Definition at line 44 of file Device.cpp.

◆ validation_callback()

void Leosac::Hardware::Device::validation_callback ( odb::callback_event  e,
odb::database &   
) const
virtual

Member Data Documentation

◆ device_class_

DeviceClass Leosac::Hardware::Device::device_class_
private

Definition at line 83 of file Device.hpp.

◆ enabled_

bool Leosac::Hardware::Device::enabled_
private

Is this device supposed to be enabled?

This allows module to know if they should process a device or just ignore it.

Definition at line 91 of file Device.hpp.

◆ id_

DeviceId Leosac::Hardware::Device::id_
private

Definition at line 71 of file Device.hpp.

◆ name_

std::string Leosac::Hardware::Device::name_
private

Name of an hardware device must be unique due to an implementation details.

Most object bind a ZMQ socket at an address based on their name.

Todo: This restriction should be lifted in the future, when device will Todo: bind to their id rather name.

Definition at line 81 of file Device.hpp.

◆ version_

uint64_t Leosac::Hardware::Device::version_
private

Definition at line 94 of file Device.hpp.


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