ESPHome
2026.11.0-dev
Loading...
Searching...
No Matches
esphome
components
select
select_traits.cpp
Go to the documentation of this file.
1
#include "
select_traits.h
"
2
3
namespace
esphome::select
{
4
5
// Runtime option lists are copied, since the argument may not outlive the select; one
6
// out of line copy keeps a single instance of the copy code.
7
void
SelectTraits::set_options_copy_
(
const
char
*
const
*
options
,
size_t
count
) {
8
this->
options_
.assign_copy(options,
count
);
9
}
10
11
void
SelectTraits::set_options
(
const
std::initializer_list<const char *> &
options
) {
12
this->
set_options_copy_
(options.begin(),
options
.size());
13
}
14
15
void
SelectTraits::set_options
(
const
FixedVector<const char *>
&
options
) {
16
this->
set_options_copy_
(options.
begin
(),
options
.size());
17
}
18
19
}
// namespace esphome::select
esphome::FixedVector
Fixed-capacity vector - sized once through init() or try_init(); push_back never reallocates This avo...
Definition
helpers.h:624
esphome::FixedVector::begin
T * begin()
Definition
helpers.h:816
esphome::select::SelectTraits::set_options
void set_options(const SelectOptions &options)
Runtime lists: the pointer list is copied, as before; the strings must still outlive the select.
Definition
select_traits.h:21
esphome::select::SelectTraits::options_
SelectOptions options_
Definition
select_traits.h:29
esphome::select::SelectTraits::set_options_copy_
void set_options_copy_(const char *const *options, size_t count)
Definition
select_traits.cpp:7
options
uint8_t options
Definition
e131_packet.cpp:15
count
unsigned count
Definition
gif.cpp:51
esphome::select
Definition
automation.h:7
select_traits.h
Generated by
1.12.0