libcamera: signal: Specify connection type for signals

Add a connection type parameter to the Signal::connect() method to
control signal delivery.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart
2019-10-28 05:16:31 +02:00
parent 3d75cc1bd2
commit 8524e62611

View File

@@ -55,11 +55,12 @@ public:
#ifndef __DOXYGEN__
template<typename T, typename std::enable_if<std::is_base_of<Object, T>::value>::type * = nullptr>
void connect(T *obj, void (T::*func)(Args...))
void connect(T *obj, void (T::*func)(Args...),
ConnectionType type = ConnectionTypeAuto)
{
Object *object = static_cast<Object *>(obj);
object->connect(this);
slots_.push_back(new BoundMemberMethod<T, Args...>(obj, object, func));
slots_.push_back(new BoundMemberMethod<T, Args...>(obj, object, func, type));
}
template<typename T, typename std::enable_if<!std::is_base_of<Object, T>::value>::type * = nullptr>