1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

LibCore: Add a forward declaration header

This patch adds <LibCore/Forward.h> and uses it in various places to
shrink the header dependency graph.
This commit is contained in:
Andreas Kling 2020-02-14 22:29:06 +01:00
parent 3bbf4610d2
commit 8f7333f080
35 changed files with 143 additions and 38 deletions

View file

@ -24,12 +24,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/Badge.h>
#include <AK/IDAllocator.h>
#include <AK/JsonObject.h>
#include <AK/JsonValue.h>
#include <AK/Time.h>
#include <LibCore/Event.h>
#include <LibCore/EventLoop.h>
#include <LibCore/LocalServer.h>
#include <LibCore/LocalSocket.h>
#include <LibCore/Notifier.h>
#include <LibCore/Object.h>
@ -328,7 +330,7 @@ void EventLoop::post_event(Object& receiver, NonnullOwnPtr<Event>&& event)
#ifdef CEVENTLOOP_DEBUG
dbg() << "Core::EventLoop::post_event: {" << m_queued_events.size() << "} << receiver=" << receiver << ", event=" << event;
#endif
m_queued_events.append({ receiver.make_weak_ptr(), move(event) });
m_queued_events.empend(receiver, move(event));
}
void EventLoop::wait_for_event(WaitMode mode)
@ -509,4 +511,20 @@ void EventLoop::wake()
}
}
EventLoop::QueuedEvent::QueuedEvent(Object& receiver, NonnullOwnPtr<Event> event)
: receiver(receiver.make_weak_ptr())
, event(move(event))
{
}
EventLoop::QueuedEvent::QueuedEvent(QueuedEvent&& other)
: receiver(other.receiver)
, event(move(other.event))
{
}
EventLoop::QueuedEvent::~QueuedEvent()
{
}
}