esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
esphome::api::StateResponseBase Class Referenceabstract

Intermediate base for *StateResponse messages (proto (base_class) = "StateResponseProtoMessage"). More...

#include <proto_message.hpp>

Inheritance diagram for esphome::api::StateResponseBase:
Inheritance graph
[legend]
Collaboration diagram for esphome::api::StateResponseBase:
Collaboration graph
[legend]

Public Member Functions

virtual std::uint32_t key () const =0
 
- Public Member Functions inherited from esphome::api::ProtoMessage
 ProtoMessage ()=default
 
 ProtoMessage (const ProtoMessage &)=default
 
 ProtoMessage (ProtoMessage &&)=default
 
ProtoMessageoperator= (const ProtoMessage &)=default
 
ProtoMessageoperator= (ProtoMessage &&)=default
 
virtual ~ProtoMessage ()=default
 
virtual void encode (ProtoWriter &writer) const =0
 Serialize this message's fields to writer (ascending field number).
 
virtual bool decode (ProtoReader &reader)=0
 Decode wire bytes into this message.
 
virtual std::size_t calculate_size () const =0
 Exact number of bytes encode() will write.
 
virtual std::uint32_t message_id () const =0
 The protocol message id (the proto (id) option), or 0 if the message carries none.
 
virtual const char * message_name () const =0
 The proto message name (e.g. "ListEntitiesLightResponse").
 
virtual std::unique_ptr< ProtoMessageclone () const =0
 A deep copy of this message as a new owning pointer.
 
std::size_t ByteSizeLong () const
 Alias for calculate_size() — matches protobuf's API.
 
bool SerializeToArray (void *data, const int size) const
 Serialize into a caller-provided buffer of exactly size bytes.
 
std::string SerializeAsString () const
 Serialize to a freshly allocated string.
 
bool ParseFromArray (const void *data, const int size)
 Parse wire bytes into this message. Returns false on malformed input.
 

Detailed Description

Intermediate base for *StateResponse messages (proto (base_class) = "StateResponseProtoMessage").

Exposes the entity key as a virtual so EntityStore can read it without reflection.

Member Function Documentation

◆ key()

virtual std::uint32_t esphome::api::StateResponseBase::key ( ) const
pure virtual

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