SensESP 3.5.1-alpha
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::SKPathValue Struct Reference

A value+path pair emitted for a delta on a prefix-matched path. More...

#include <sensesp/signalk/signalk_prefix_listener.h>

Public Member Functions

 SKPathValue ()=default
 
 SKPathValue (String path, std::shared_ptr< const JsonDocument > doc)
 

Public Attributes

String path
 
std::shared_ptr< const JsonDocument > value_doc
 
JsonVariantConst value
 Read-only view of the delta's value member, backed by value_doc.
 

Detailed Description

A value+path pair emitted for a delta on a prefix-matched path.

Unlike SKValueListener (one exact path, value only), a prefix listener serves a family of paths, so the consumer needs to know which path a delta arrived on. path is the full received path; value is a read-only view of that delta's value member.

value is backed by value_doc, an owned, refcounted copy of the delta value lifted off the transient receive-queue document. Copying this struct is a refcount bump, not a deep copy, and value stays valid for as long as any copy survives — so it is safe to retain past the observer call (e.g. for UI work marshalled onto the event loop), unlike a raw alias of the receive document.

Definition at line 29 of file signalk_prefix_listener.h.

Constructor & Destructor Documentation

◆ SKPathValue() [1/2]

sensesp::SKPathValue::SKPathValue ( )
default

◆ SKPathValue() [2/2]

sensesp::SKPathValue::SKPathValue ( String  path,
std::shared_ptr< const JsonDocument >  doc 
)
inline
Parameters
pathThe full received Signal K path.
docAn owned document holding a copy of the delta value; value is exposed as a read-only view of its root.

Definition at line 46 of file signalk_prefix_listener.h.

Member Data Documentation

◆ path

String sensesp::SKPathValue::path

Definition at line 30 of file signalk_prefix_listener.h.

◆ value

JsonVariantConst sensesp::SKPathValue::value

Read-only view of the delta's value member, backed by value_doc.

Definition at line 37 of file signalk_prefix_listener.h.

◆ value_doc

std::shared_ptr<const JsonDocument> sensesp::SKPathValue::value_doc

Owns the value object so value outlives the transient receive-queue document. Null on a default-constructed (no-data-yet) instance.

Definition at line 34 of file signalk_prefix_listener.h.


The documentation for this struct was generated from the following file: