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

Abstraction of an External Messaging device. More...

#include <ExternalMessage.hpp>

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

Public Types

enum  Direction { Direction::Subscribe = 0, Direction::Publish = 1 }
 

Public Member Functions

 ExternalMessage ()
 
void validation_callback (odb::callback_event, odb::database &) const override
 
std::string subject () const
 
void subject (const std::string &subject)
 
Direction direction () const
 
void direction (Direction direction)
 
DeviceClass virtualtype () const
 
void virtualtype (DeviceClass virtualtype)
 
std::string payload () const
 
void payload (const std::string &payload)
 
- Public Member Functions inherited from Leosac::Hardware::Device
 Device ()
 
 Device (DeviceClass device_class)
 
virtual ~Device ()=default
 
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
 

Protected Attributes

std::string subject_
 
Direction direction_
 
DeviceClass virtualtype_
 
std::string payload_
 

Detailed Description

Abstraction of an External Messaging device.

This is likely to be used by generic messaging libraries like MQTT or ZMQ itself but for external use (eg. notifying an external broker / IoT sytem for home automation etc...).

Definition at line 41 of file ExternalMessage.hpp.

Member Enumeration Documentation

◆ Direction

Enumerator
Subscribe 
Publish 

Definition at line 44 of file ExternalMessage.hpp.

Constructor & Destructor Documentation

◆ ExternalMessage()

Leosac::Hardware::ExternalMessage::ExternalMessage ( )

Definition at line 27 of file ExternalMessage.cpp.

Member Function Documentation

◆ direction() [1/2]

ExternalMessage::Direction Leosac::Hardware::ExternalMessage::direction ( ) const

Definition at line 45 of file ExternalMessage.cpp.

◆ direction() [2/2]

void Leosac::Hardware::ExternalMessage::direction ( ExternalMessage::Direction  direction)

Definition at line 50 of file ExternalMessage.cpp.

◆ payload() [1/2]

std::string Leosac::Hardware::ExternalMessage::payload ( ) const

Definition at line 65 of file ExternalMessage.cpp.

◆ payload() [2/2]

void Leosac::Hardware::ExternalMessage::payload ( const std::string &  payload)

Definition at line 70 of file ExternalMessage.cpp.

◆ subject() [1/2]

std::string Leosac::Hardware::ExternalMessage::subject ( ) const

Definition at line 35 of file ExternalMessage.cpp.

◆ subject() [2/2]

void Leosac::Hardware::ExternalMessage::subject ( const std::string &  subject)

Definition at line 40 of file ExternalMessage.cpp.

◆ validation_callback()

void Leosac::Hardware::ExternalMessage::validation_callback ( odb::callback_event  e,
odb::database &  db 
) const
overridevirtual

Reimplemented from Leosac::Hardware::Device.

Definition at line 75 of file ExternalMessage.cpp.

◆ virtualtype() [1/2]

DeviceClass Leosac::Hardware::ExternalMessage::virtualtype ( ) const

Definition at line 55 of file ExternalMessage.cpp.

◆ virtualtype() [2/2]

void Leosac::Hardware::ExternalMessage::virtualtype ( DeviceClass  virtualtype)

Definition at line 60 of file ExternalMessage.cpp.

Member Data Documentation

◆ direction_

Direction Leosac::Hardware::ExternalMessage::direction_
protected

Definition at line 72 of file ExternalMessage.hpp.

◆ payload_

std::string Leosac::Hardware::ExternalMessage::payload_
protected

Definition at line 74 of file ExternalMessage.hpp.

◆ subject_

std::string Leosac::Hardware::ExternalMessage::subject_
protected

Definition at line 71 of file ExternalMessage.hpp.

◆ virtualtype_

DeviceClass Leosac::Hardware::ExternalMessage::virtualtype_
protected

Definition at line 73 of file ExternalMessage.hpp.


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