@@ -22,12 +22,10 @@ namespace libcamera {
class GlobalConfiguration
{
public:
- using Option = const ValueNode &;
-
GlobalConfiguration();
unsigned int version() const;
- Option configuration() const;
+ const ValueNode &configuration() const;
template<typename T>
std::optional<T> option(
@@ -55,14 +55,6 @@ LOG_DEFINE_CATEGORY(Configuration)
* options, or configuration() to access the whole configuration.
*/
-/**
- * \typedef GlobalConfiguration::Option
- * \brief Type representing a configuration option
- *
- * All code outside GlobalConfiguration must use this type declaration and not
- * the underlying type.
- */
-
/**
* \brief Initialize the global configuration
*/
@@ -153,12 +145,9 @@ unsigned int GlobalConfiguration::version() const
* The requested part of the configuration can be accessed using \a ValueNode
* methods.
*
- * \note \a ValueNode type itself shouldn't be used in type declarations to
- * avoid trouble if we decide to change the underlying data objects in future.
- *
- * \return The top-level configuration option
+ * \return The global configuration
*/
-GlobalConfiguration::Option GlobalConfiguration::configuration() const
+const ValueNode &GlobalConfiguration::configuration() const
{
return (*configuration_)["configuration"];
}
@@ -1880,7 +1880,7 @@ bool SimplePipelineHandler::matchDevice(std::shared_ptr<MediaDevice> media,
swIspEnabled_ = info.swIspEnabled;
const GlobalConfiguration &configuration = cameraManager()->_d()->configuration();
- for (GlobalConfiguration::Option entry :
+ for (const ValueNode &entry :
configuration.configuration()["pipelines"]["simple"]["supported_devices"]
.asList()) {
auto name = entry["driver"].get<std::string>();