mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-19 18:35:07 +03:00
libcamera: pipeline_handler: Make factory create() function const
The PipelineHandlerFactory::create() function has no need to modify the factory instance. Make it const, as well as the createInstance() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
014698cba1
commit
7e38ae8a1e
2 changed files with 5 additions and 5 deletions
|
@ -104,7 +104,7 @@ public:
|
||||||
PipelineHandlerFactory(const char *name);
|
PipelineHandlerFactory(const char *name);
|
||||||
virtual ~PipelineHandlerFactory() = default;
|
virtual ~PipelineHandlerFactory() = default;
|
||||||
|
|
||||||
std::shared_ptr<PipelineHandler> create(CameraManager *manager);
|
std::shared_ptr<PipelineHandler> create(CameraManager *manager) const;
|
||||||
|
|
||||||
const std::string &name() const { return name_; }
|
const std::string &name() const { return name_; }
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public:
|
||||||
static std::vector<PipelineHandlerFactory *> &factories();
|
static std::vector<PipelineHandlerFactory *> &factories();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual PipelineHandler *createInstance(CameraManager *manager) = 0;
|
virtual PipelineHandler *createInstance(CameraManager *manager) const = 0;
|
||||||
|
|
||||||
std::string name_;
|
std::string name_;
|
||||||
};
|
};
|
||||||
|
@ -124,7 +124,7 @@ public: \
|
||||||
handler##Factory() : PipelineHandlerFactory(#handler) {} \
|
handler##Factory() : PipelineHandlerFactory(#handler) {} \
|
||||||
\
|
\
|
||||||
private: \
|
private: \
|
||||||
PipelineHandler *createInstance(CameraManager *manager) \
|
PipelineHandler *createInstance(CameraManager *manager) const \
|
||||||
{ \
|
{ \
|
||||||
return new handler(manager); \
|
return new handler(manager); \
|
||||||
} \
|
} \
|
||||||
|
|
|
@ -676,7 +676,7 @@ PipelineHandlerFactory::PipelineHandlerFactory(const char *name)
|
||||||
* \return A shared pointer to a new instance of the PipelineHandler subclass
|
* \return A shared pointer to a new instance of the PipelineHandler subclass
|
||||||
* corresponding to the factory
|
* corresponding to the factory
|
||||||
*/
|
*/
|
||||||
std::shared_ptr<PipelineHandler> PipelineHandlerFactory::create(CameraManager *manager)
|
std::shared_ptr<PipelineHandler> PipelineHandlerFactory::create(CameraManager *manager) const
|
||||||
{
|
{
|
||||||
PipelineHandler *handler = createInstance(manager);
|
PipelineHandler *handler = createInstance(manager);
|
||||||
handler->name_ = name_.c_str();
|
handler->name_ = name_.c_str();
|
||||||
|
@ -719,7 +719,7 @@ std::vector<PipelineHandlerFactory *> &PipelineHandlerFactory::factories()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn PipelineHandlerFactory::createInstance()
|
* \fn PipelineHandlerFactory::createInstance() const
|
||||||
* \brief Create an instance of the PipelineHandler corresponding to the factory
|
* \brief Create an instance of the PipelineHandler corresponding to the factory
|
||||||
* \param[in] manager The camera manager
|
* \param[in] manager The camera manager
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue