|
| template<typename T > |
| static void | encode_varint_raw_loop (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, T value) |
| | Write a multi-byte varint directly through a pos pointer.
|
| |
| static void ESPHOME_ALWAYS_INLINE | encode_varint_raw (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t value) |
| |
| static void ESPHOME_ALWAYS_INLINE | encode_varint_raw_short (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t value) |
| | Encode a varint that is expected to be 1-2 bytes (e.g. zigzag RSSI, small lengths).
|
| |
| static void ESPHOME_ALWAYS_INLINE | encode_varint_raw_64 (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint64_t value) |
| |
| static void ESPHOME_ALWAYS_INLINE | encode_field_raw (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint32_t type) |
| |
| static void ESPHOME_ALWAYS_INLINE | write_raw_byte (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint8_t b) |
| | Write a single precomputed tag byte. Tag must be < 128.
|
| |
| static void ESPHOME_ALWAYS_INLINE | reserve_byte (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM) |
| | Reserve one byte for later backpatch (e.g., sub-message length).
|
| |
| static void ESPHOME_ALWAYS_INLINE | encode_raw (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, const void *data, size_t len) |
| | Write raw bytes to the buffer (no tag, no length prefix).
|
| |
| static void | encode_short_string_force (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint8_t tag, const StringRef &ref) |
| | Encode tag + 1-byte length + raw string data.
|
| |
| static void ESPHOME_ALWAYS_INLINE | write_tag_and_fixed32 (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint8_t tag, uint32_t value) |
| | Write a precomputed tag byte + 32-bit value in one operation.
|
| |
| static void | encode_string (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const char *string, size_t len, bool force=false) |
| |
| static void | encode_string (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const std::string &value, bool force=false) |
| |
| static void | encode_string (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const StringRef &ref, bool force=false) |
| |
| static void | encode_bytes (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, const uint8_t *data, size_t len, bool force=false) |
| |
| static void | encode_uint32 (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint32_t value, bool force=false) |
| |
| static void | encode_uint64 (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint64_t value, bool force=false) |
| |
| static void | encode_bool (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, bool value, bool force=false) |
| |
| static void | encode_fixed32 (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, uint32_t value, bool force=false) |
| |
| static void | encode_float (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, float value, bool force=false) |
| |
| static void | encode_int32 (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int32_t value, bool force=false) |
| |
| static void | encode_int64 (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int64_t value, bool force=false) |
| |
| static void | encode_sint32 (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int32_t value, bool force=false) |
| |
| static void | encode_sint64 (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, uint32_t field_id, int64_t value, bool force=false) |
| |
| template<typename T > |
| static void | encode_sub_message (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, ProtoWriteBuffer &buffer, uint32_t field_id, const T &value) |
| | Sub-message encoding: sync pos to buffer, delegate, get pos from return value.
|
| |
| template<typename T > |
| static void | encode_optional_sub_message (uint8_t *__restrict__ &pos PROTO_ENCODE_DEBUG_PARAM, ProtoWriteBuffer &buffer, uint32_t field_id, const T &value) |
| |
Static encode helpers for generated encode() functions.
Generated code hoists buffer.pos_ into a local uint8_t *__restrict__ pos, then calls these methods which take pos by reference. No struct, no overhead. For sub-messages, pos is synced back to buffer before the call and reloaded after.
Definition at line 298 of file proto.h.