libcamera
v0.4.0
Supporting cameras in Linux since 2019
|
A map of ControlId to ControlInfo. More...
Inherits unordered_map< const ControlId *, ControlInfo >.
Public Types | |
using | Map = std::unordered_map< const ControlId *, ControlInfo > |
The base std::unsorted_map<> container. | |
Public Member Functions | |
ControlInfoMap (const ControlInfoMap &other)=default | |
Copy constructor, construct a ControlInfoMap from a copy of other. More... | |
ControlInfoMap (std::initializer_list< Map::value_type > init, const ControlIdMap &idmap) | |
Construct a ControlInfoMap from an initializer list. More... | |
ControlInfoMap (Map &&info, const ControlIdMap &idmap) | |
Construct a ControlInfoMap from a plain map. More... | |
ControlInfoMap & | operator= (const ControlInfoMap &other)=default |
Copy assignment operator, replace the contents with a copy of other. More... | |
mapped_type & | at (unsigned int key) |
Access specified element by numerical ID. More... | |
const mapped_type & | at (unsigned int key) const |
Access specified element by numerical ID. More... | |
size_type | count (unsigned int key) const |
Count the number of elements matching a numerical ID. More... | |
iterator | find (unsigned int key) |
Find the element matching a numerical ID. More... | |
const_iterator | find (unsigned int key) const |
Find the element matching a numerical ID. More... | |
const ControlIdMap & | idmap () const |
Retrieve the ControlId map. More... | |
A map of ControlId to ControlInfo.
The ControlInfoMap class describes controls supported by an object as an unsorted map of ControlId pointers to ControlInfo instances. Unlike the standard std::unsorted_map<> class, it is designed to be immutable once constructed, and thus only exposes the read accessors of the std::unsorted_map<> base class.
The class is constructed with a reference to a ControlIdMap. This allows providing access to the mapped elements using numerical ID keys, in addition to the features of the standard unsorted map. All ControlId keys in the map must appear in the ControlIdMap.
|
default |
Copy constructor, construct a ControlInfoMap from a copy of other.
[in] | other | The other ControlInfoMap |
libcamera::ControlInfoMap::ControlInfoMap | ( | std::initializer_list< Map::value_type > | init, |
const ControlIdMap & | idmap | ||
) |
Construct a ControlInfoMap from an initializer list.
[in] | init | The initializer list |
[in] | idmap | The idmap used by the ControlInfoMap |
libcamera::ControlInfoMap::ControlInfoMap | ( | Map && | info, |
const ControlIdMap & | idmap | ||
) |
Construct a ControlInfoMap from a plain map.
[in] | info | The control info plain map |
[in] | idmap | The idmap used by the ControlInfoMap |
Construct a new ControlInfoMap and populate its contents with those of info using move semantics. Upon return the info map will be empty.
ControlInfoMap::mapped_type & libcamera::ControlInfoMap::at | ( | unsigned int | id | ) |
Access specified element by numerical ID.
[in] | id | The numerical ID |
const ControlInfoMap::mapped_type & libcamera::ControlInfoMap::at | ( | unsigned int | id | ) | const |
Access specified element by numerical ID.
[in] | id | The numerical ID |
ControlInfoMap::size_type libcamera::ControlInfoMap::count | ( | unsigned int | id | ) | const |
Count the number of elements matching a numerical ID.
[in] | id | The numerical ID |
ControlInfoMap::iterator libcamera::ControlInfoMap::find | ( | unsigned int | id | ) |
Find the element matching a numerical ID.
[in] | id | The numerical ID |
ControlInfoMap::const_iterator libcamera::ControlInfoMap::find | ( | unsigned int | id | ) | const |
Find the element matching a numerical ID.
[in] | id | The numerical ID |
|
inline |
Retrieve the ControlId map.
Constructing ControlList instances for V4L2 controls requires a ControlIdMap for the V4L2 device that the control list targets. This helper function returns a suitable idmap for that purpose.
|
default |
Copy assignment operator, replace the contents with a copy of other.
[in] | other | The other ControlInfoMap |