SensESP 3.5.1-alpha
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::SKPutListener Class Referenceabstract

An Obervable class that listens for Signal K PUT requests coming over the websocket connection and notifies observers of the change. More...

#include <sensesp/signalk/signalk_put_request_listener.h>

Inheritance diagram for sensesp::SKPutListener:
[legend]

Public Member Functions

 SKPutListener (const String &sk_path)
 
virtual ~SKPutListener ()
 
String & get_sk_path ()
 
virtual void parse_value (const JsonObject &put)=0
 
- Public Member Functions inherited from sensesp::Observable
 Observable ()
 
 Observable (Observable &&other)
 Move constructor.
 
void notify ()
 
int attach (std::function< void()> observer)
 Attach an observer callback.
 
void detach (int id)
 Remove a previously attached observer by its ID.
 

Static Public Member Functions

static const std::vector< SKPutListener * > & get_listeners ()
 
static void clear_registry ()
 

Protected Attributes

String sk_path {}
 

Detailed Description

An Obervable class that listens for Signal K PUT requests coming over the websocket connection and notifies observers of the change.

See also
SKPutRequestListener

Definition at line 20 of file signalk_put_request_listener.h.

Constructor & Destructor Documentation

◆ SKPutListener()

sensesp::SKPutListener::SKPutListener ( const String &  sk_path)

The constructor

Parameters
sk_pathThe Signal K path that identifies the signal k path this particular listener responds to

Definition at line 11 of file signalk_put_request_listener.cpp.

◆ ~SKPutListener()

sensesp::SKPutListener::~SKPutListener ( )
virtual

Unregisters this listener from the static registry so the registry never holds a dangling pointer. Takes the SKListener semaphore because the WS client task iterates this registry under that same lock.

Definition at line 15 of file signalk_put_request_listener.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ clear_registry()

void sensesp::SKPutListener::clear_registry ( )
static

Empties the listener registry. Intended for clean app restart and test isolation; not for normal runtime use. Takes the SKListener semaphore.

Definition at line 24 of file signalk_put_request_listener.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_listeners()

static const std::vector< SKPutListener * > & sensesp::SKPutListener::get_listeners ( )
inlinestatic

Definition at line 40 of file signalk_put_request_listener.h.

Here is the caller graph for this function:

◆ get_sk_path()

String & sensesp::SKPutListener::get_sk_path ( )
inline

Definition at line 36 of file signalk_put_request_listener.h.

Here is the caller graph for this function:

◆ parse_value()

virtual void sensesp::SKPutListener::parse_value ( const JsonObject &  put)
pure virtual

Implemented in sensesp::SKPutRequestListener< T >.

Here is the caller graph for this function:

Member Data Documentation

◆ sk_path

String sensesp::SKPutListener::sk_path {}
protected

Definition at line 51 of file signalk_put_request_listener.h.


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