libcamera: object: Add connection type parameter to invokeMethod()

Allow specifying a different connection type than ConnectionTypeQueued
for Object::invokeMethod().

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Jacopo Mondi
2019-10-29 16:44:46 +02:00
committed by Laurent Pinchart
parent 06008b9156
commit fb1a5c0416
6 changed files with 21 additions and 16 deletions
+2 -3
View File
@@ -30,12 +30,11 @@ public:
void postMessage(std::unique_ptr<Message> msg);
template<typename T, typename... Args, typename std::enable_if<std::is_base_of<Object, T>::value>::type * = nullptr>
void invokeMethod(void (T::*func)(Args...), Args... args)
void invokeMethod(void (T::*func)(Args...), ConnectionType type, Args... args)
{
T *obj = static_cast<T *>(this);
BoundMethodBase *method =
new BoundMemberMethod<T, Args...>(obj, this, func,
ConnectionTypeQueued);
new BoundMemberMethod<T, Args...>(obj, this, func, type);
void *pack = new typename BoundMemberMethod<T, Args...>::PackType{ args... };
method->activatePack(pack, true);