SLAMflex SE
0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
|
#include <thread.h>
Public Member Functions | |
Thread () | |
Construct a thread. If runnable != 0, use that runnable, else use our own "run" method. More... | |
virtual | ~Thread () |
This does not destroy the object until the thread has been terminated. More... | |
void | start (Runnable *runnable=0) |
Start execution of "run" method in separate thread. More... | |
void | stop () |
Tell the thread to stop. More... | |
bool | shouldStop () const |
Returns true if the stop() method been called, false otherwise. More... | |
bool | isRunning () const |
Returns true if the thread is still running. More... | |
void | join () |
This blocks until the thread has actually terminated. More... | |
pthread_t | getID () |
Get the ID of this thread. More... | |
virtual void | run () |
Override this method to do whatever it is the thread should do. More... | |
Public Member Functions inherited from CVD::Runnable | |
virtual | ~Runnable () |
Static Public Member Functions | |
static unsigned int | count () |
Returns how many threads are actually running, not including the main thread. More... | |
static Thread * | getCurrent () |
Returns a pointer to the currently running thread. More... | |
static void | sleep (unsigned int milli) |
Tell the current thread to sleep for milli milliseconds. More... | |
static void | yield () |
Tell the current thread to yield the processor. More... | |
Static Private Member Functions | |
static bool | init () |
static void * | threadproc (void *param) |
Private Attributes | |
Runnable * | myRunnable |
pthread_t | myID |
bool | myRunningFlag |
bool | myStopFlag |
Static Private Attributes | |
static bool | ourInitializedFlag = false |
static pthread_key_t | ourKey |
static unsigned int | ourCount |
The Thread class encapsulates a thread of execution. It is implemented with POSIX threads. Code that uses this class should link with libpthread and librt (for nanosleep).
CVD::Thread::Thread | ( | ) |
Construct a thread. If runnable != 0, use that runnable, else use our own "run" method.
The constructor performs global initialization of the Thread class if necessary.
Definition at line 12 of file thread.cpp.
|
virtual |
This does not destroy the object until the thread has been terminated.
Calls stop() and join() if the thread is alive.
Definition at line 22 of file thread.cpp.
|
static |
Returns how many threads are actually running, not including the main thread.
Definition at line 68 of file thread.cpp.
|
static |
Returns a pointer to the currently running thread.
Definition at line 73 of file thread.cpp.
pthread_t CVD::Thread::getID | ( | ) |
Get the ID of this thread.
Definition at line 63 of file thread.cpp.
|
staticprivate |
Definition at line 91 of file thread.cpp.
bool CVD::Thread::isRunning | ( | ) | const |
Returns true if the thread is still running.
Definition at line 53 of file thread.cpp.
void CVD::Thread::join | ( | ) |
This blocks until the thread has actually terminated.
If the thread is infinite looping, this will block forever!
Definition at line 58 of file thread.cpp.
|
inlinevirtual |
Override this method to do whatever it is the thread should do.
Implements CVD::Runnable.
Reimplemented in MapMaker.
bool CVD::Thread::shouldStop | ( | ) | const |
Returns true if the stop() method been called, false otherwise.
Definition at line 48 of file thread.cpp.
|
static |
Tell the current thread to sleep for milli milliseconds.
Uses nanosleep.
Definition at line 79 of file thread.cpp.
void CVD::Thread::start | ( | Runnable * | runnable = 0 | ) |
Start execution of "run" method in separate thread.
Use PThreads to create a new thread.
Definition at line 32 of file thread.cpp.
void CVD::Thread::stop | ( | ) |
Tell the thread to stop.
This doesn't make the thread actually stop, it just causes shouldStop() to return true.
Definition at line 43 of file thread.cpp.
|
staticprivate |
Definition at line 98 of file thread.cpp.
|
static |
Tell the current thread to yield the processor.