mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
ipa: libipa: vector: Drop readYaml() function
Now that YAML deserialization of Vector instances is supported through YamlObject::get(), remove the Vector::readYaml() function. It turns out not to be used. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
64ed07d4d0
commit
454bc6129f
2 changed files with 0 additions and 36 deletions
|
@ -40,19 +40,6 @@ namespace ipa {
|
||||||
* The size of \a data must be equal to the dimension size Rows of the vector.
|
* The size of \a data must be equal to the dimension size Rows of the vector.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* \fn Vector::readYaml
|
|
||||||
* \brief Populate the vector with yaml data
|
|
||||||
* \param yaml Yaml data to populate the vector with
|
|
||||||
*
|
|
||||||
* Any existing data in the vector will be overwritten. The size of the data
|
|
||||||
* read from \a yaml must be equal to the dimension size Rows of the vector.
|
|
||||||
*
|
|
||||||
* The yaml data is expected to be a list with elements of type T.
|
|
||||||
*
|
|
||||||
* \return 0 on success, negative error code otherwise
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn T Vector::operator[](size_t i) const
|
* \fn T Vector::operator[](size_t i) const
|
||||||
* \brief Index to an element in the vector
|
* \brief Index to an element in the vector
|
||||||
|
|
|
@ -39,29 +39,6 @@ public:
|
||||||
data_[i] = data[i];
|
data_[i] = data[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
int readYaml(const libcamera::YamlObject &yaml)
|
|
||||||
{
|
|
||||||
if (yaml.size() != Rows) {
|
|
||||||
LOG(Vector, Error)
|
|
||||||
<< "Wrong number of values in vector: expected "
|
|
||||||
<< Rows << ", got " << yaml.size();
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int i = 0;
|
|
||||||
for (const auto &x : yaml.asList()) {
|
|
||||||
auto value = x.get<T>();
|
|
||||||
if (!value) {
|
|
||||||
LOG(Vector, Error) << "Failed to read vector value";
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
data_[i++] = *value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const T &operator[](size_t i) const
|
const T &operator[](size_t i) const
|
||||||
{
|
{
|
||||||
ASSERT(i < data_.size());
|
ASSERT(i < data_.size());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue