libcamera: signal: Split Slot implementation to reusable classes
Move the Slot* classes to bound_method.{h,cpp} and rename them to
Bound*Method*. They will be reused to implement asynchronous method
invocation similar to cross-thread signal delivery.
This is only a move and rename, no functional changes are included.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -7,10 +7,6 @@
|
||||
|
||||
#include <libcamera/signal.h>
|
||||
|
||||
#include "message.h"
|
||||
#include "thread.h"
|
||||
#include "utils.h"
|
||||
|
||||
/**
|
||||
* \file signal.h
|
||||
* \brief Signal & slot implementation
|
||||
@@ -57,25 +53,6 @@ namespace libcamera {
|
||||
* passed through the signal will remain valid after the signal is emitted.
|
||||
*/
|
||||
|
||||
void SlotBase::disconnect(SignalBase *signal)
|
||||
{
|
||||
if (object_)
|
||||
object_->disconnect(signal);
|
||||
}
|
||||
|
||||
void SlotBase::activatePack(void *pack)
|
||||
{
|
||||
Object *obj = static_cast<Object *>(object_);
|
||||
|
||||
if (Thread::current() == obj->thread()) {
|
||||
invokePack(pack);
|
||||
} else {
|
||||
std::unique_ptr<Message> msg =
|
||||
utils::make_unique<SignalMessage>(this, pack);
|
||||
obj->postMessage(std::move(msg));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \fn Signal::connect(T *object, void(T::*func)(Args...))
|
||||
* \brief Connect the signal to a member function slot
|
||||
|
||||
Reference in New Issue
Block a user