Nebula
Loading...
Searching...
No Matches
resourceloaderthread.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
9//------------------------------------------------------------------------------
10#include "threading/thread.h"
11#include "threading/safequeue.h"
12#include <functional>
13#include "resourceid.h"
14
15namespace IO
16{
17class IoServer;
18}
19
20namespace Resources
21{
23{
25public:
29 virtual ~ResourceLoaderThread();
30
32 void Wait();
33
34private:
35 friend class ResourceLoader;
36
38 void DoWork() override;
40 virtual void EmitWakeupSignal() override;
41
42 Threading::SafeQueue<std::function<void()>> jobs;
45};
46} // namespace Resources
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Definition resourceloader.h:60
Definition resourceloaderthread.h:23
Threading::SafeQueue< std::function< void()> > jobs
Definition resourceloaderthread.h:42
virtual void EmitWakeupSignal() override
emit wakeup signal
Definition resourceloaderthread.cc:70
void DoWork() override
perform work
Definition resourceloaderthread.cc:39
__DeclareClass(ResourceLoaderThread)
Ptr< IO::IoServer > ioServer
Definition resourceloaderthread.h:44
void Wait()
wait for the thread to be done (must be called from outside this thread!)
Definition resourceloaderthread.cc:79
Threading::Event completeEvent
Definition resourceloaderthread.h:43
virtual ~ResourceLoaderThread()
destructor
Definition resourceloaderthread.cc:27
ResourceLoaderThread()
constructor
Definition resourceloaderthread.cc:17
Thread-safe version of Util::Queue.
Definition safequeue.h:27
Instances of wrapped stream classes.
Definition orientation.cc:10
A resource is a container for some type of file which is loaded.
Definition resource.cc:9