1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-20 02:33:50 +01:00

fixed_vector, bluetooth services

This commit is contained in:
J. Nick Koston
2025-10-12 18:21:14 -10:00
parent 4c00861760
commit a9fd0a3b26
7 changed files with 85 additions and 13 deletions

View File

@@ -1415,6 +1415,8 @@ class RepeatedTypeInfo(TypeInfo):
# Check if this is a pointer field by looking for container_pointer option
self._container_type = get_field_opt(field, pb.container_pointer, "")
self._use_pointer = bool(self._container_type)
# Check if this should use FixedVector instead of std::vector
self._use_fixed_vector = get_field_opt(field, pb.fixed_vector, False)
# For repeated fields, we need to get the base type info
# but we can't call create_field_type_info as it would cause recursion
@@ -1438,6 +1440,8 @@ class RepeatedTypeInfo(TypeInfo):
if "<" in self._container_type and ">" in self._container_type:
return f"const {self._container_type}*"
return f"const {self._container_type}<{self._ti.cpp_type}>*"
if self._use_fixed_vector:
return f"FixedVector<{self._ti.cpp_type}>"
return f"std::vector<{self._ti.cpp_type}>"
@property