perif::PerifBase class

Base class for peripherals.

Derived classes

class Perif

Constructors, destructors, conversion operators

PerifBase(const char* name) explicit
PerifBase(const PerifBase& original) defaulted

Public functions

void registerHook(function<void(DevMap&)>&& hook)

Public variables

DevMap data
list<function<void(DevMap&)>> hooks

Function documentation

perif::PerifBase::PerifBase(const char* name) explicit

Parameters
name the peripheral's name

Explicit Value Constructor.

perif::PerifBase::PerifBase(const PerifBase& original) defaulted

Parameters
original the original instance

Copy Constructor.

void perif::PerifBase::registerHook(function<void(DevMap&)>&& hook)

Parameters
hook the observer function

Registers a hook for obtaining sensor data on update in Json format.

Variable documentation

DevMap perif::PerifBase::data

The key-value mapping of peripheral data.

list<function<void(DevMap&)>> perif::PerifBase::hooks

Hooks registered to this peripheral so observers can be notified of any necessary changes.