OpenWalnut  1.5.0dev
Public Member Functions | Public Attributes | List of all members
WKdTreeThread Class Reference

class to provide threaded computation of parts of the kd tree More...

#include <WKdTree.h>

+ Inheritance diagram for WKdTreeThread:
+ Collaboration diagram for WKdTreeThread:

Public Member Functions

 WKdTreeThread (float *pointArray, std::vector< unsigned int > *tree, int left, int right, int axis)
 constructor More...
 
void buildTree (int left, int right, int axis)
 recursive function to compute a part of the kd tree More...
 
virtual void threadMain ()
 entry for the run command More...
 
- Public Member Functions inherited from WThreadedRunner
 WThreadedRunner ()
 Default constructor. More...
 
virtual ~WThreadedRunner ()
 Destructor. More...
 
virtual void run ()
 Run thread. More...
 
void run (THREADFUNCTION f)
 Run thread. More...
 
void wait (bool requestFinish=false)
 Wait for the thread to be finished. More...
 
virtual void requestStop ()
 This method's purpose is to request a stop without waiting for it. More...
 
virtual boost::signals2::connection subscribeSignal (THREAD_SIGNAL signal, t_ThreadErrorSignalHandlerType notifier)
 Connects a specified notify function with a signal this thread instance is offering. More...
 
const WBoolFlagisCrashed () const
 Checks whether this thread has been crashed. More...
 
const std::string & getCrashMessage () const
 Get the message of the exception finally causing the crash. More...
 
void setThreadName (std::string name)
 Set the name of the thread. More...
 
std::string getThreadName () const
 Returns the current thread name. More...
 

Public Attributes

std::vector< unsigned int > * m_tree
 stores a pointer to the tree More...
 
float * m_pointArray
 stores a pointer to the vertex array More...
 
int m_left
 stores left boundary, since the threadMain method has no arguments More...
 
int m_right
 stores left boundary, since the threadMain method has no arguments More...
 
int m_axis
 stores axis, since the threadMain method has no arguments More...
 

Additional Inherited Members

- Public Types inherited from WThreadedRunner
typedef std::shared_ptr< WThreadedRunnerSPtr
 Abbreviation to a shared_ptr to this type. More...
 
typedef std::shared_ptr< const WThreadedRunnerConstSPtr
 Abbreviation to a const shared_ptr to this type. More...
 
typedef boost::function< void(void) > THREADFUNCTION
 Type used for simple thread functions. More...
 
- Static Public Member Functions inherited from WThreadedRunner
static void setThisThreadName (std::string name)
 Static function to set the name of the calling thread. More...
 
- Protected Member Functions inherited from WThreadedRunner
virtual void notifyStop ()
 Gets called when the thread should be stopped. More...
 
void yield () const
 Give remaining execution timeslice to another thread. More...
 
void sleep (const int32_t t) const
 Sets thread asleep. More...
 
void msleep (const int32_t t) const
 Sets thread asleep. More...
 
void waitForStop ()
 Let the thread sleep until a stop request was given. More...
 
virtual void onThreadException (const WException &e)
 This method is called if an exception was caught, which came from the custom thread code. More...
 
void handleDeadlyException (const WException &e, std::string sender="WThreadedRunner")
 Handle the specified exception which was not caught in the thread, which basically means the thread has crashed. More...
 
- Protected Attributes inherited from WThreadedRunner
boost::thread m_thread
 Thread instance. More...
 
WBoolFlag m_shutdownFlag
 Condition getting fired whenever the thread should quit. More...
 
WBoolFlag m_isCrashed
 True whenever an exception is thrown during threadMain. More...
 
std::string m_crashMessage
 The crash message. More...
 

Detailed Description

class to provide threaded computation of parts of the kd tree

Definition at line 66 of file WKdTree.h.

Constructor & Destructor Documentation

◆ WKdTreeThread()

WKdTreeThread::WKdTreeThread ( float *  pointArray,
std::vector< unsigned int > *  tree,
int  left,
int  right,
int  axis 
)

constructor

Parameters
pointArray
treepointer to the tree
leftboundary of the part to compute
rightboundary of the part to compute
axisstarting axis

Definition at line 114 of file WKdTree.cpp.

Member Function Documentation

◆ buildTree()

void WKdTreeThread::buildTree ( int  left,
int  right,
int  axis 
)

recursive function to compute a part of the kd tree

Parameters
left
right
axis

Definition at line 125 of file WKdTree.cpp.

References m_pointArray, and m_tree.

Referenced by threadMain().

+ Here is the caller graph for this function:

◆ threadMain()

void WKdTreeThread::threadMain ( )
virtual

entry for the run command

Reimplemented from WThreadedRunner.

Definition at line 119 of file WKdTree.cpp.

References buildTree(), wlog::debug(), m_axis, m_left, and m_right.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_axis

int WKdTreeThread::m_axis

stores axis, since the threadMain method has no arguments

Definition at line 99 of file WKdTree.h.

Referenced by threadMain().

◆ m_left

int WKdTreeThread::m_left

stores left boundary, since the threadMain method has no arguments

Definition at line 97 of file WKdTree.h.

Referenced by threadMain().

◆ m_pointArray

float* WKdTreeThread::m_pointArray

stores a pointer to the vertex array

Definition at line 95 of file WKdTree.h.

Referenced by buildTree().

◆ m_right

int WKdTreeThread::m_right

stores left boundary, since the threadMain method has no arguments

Definition at line 98 of file WKdTree.h.

Referenced by threadMain().

◆ m_tree

std::vector< unsigned int >* WKdTreeThread::m_tree

stores a pointer to the tree

Definition at line 94 of file WKdTree.h.

Referenced by buildTree().


The documentation for this class was generated from the following files: