Danbias/Code/Misc/Thread/IThreadObject.h

40 lines
853 B
C
Raw Normal View History

2013-11-26 21:51:40 +01:00
/////////////////////////////////////////////////////////////////////
// Created by [Dennis Andersen] [2013]
/////////////////////////////////////////////////////////////////////
#ifndef MISC_I_THREAD_OBJECT_H
#define MISC_I_THREAD_OBJECT_H
namespace Oyster
{
namespace Thread
{
/**
* Inherit this class to get threading compatibility.
*/
class IThreadObject
{
2013-11-26 21:51:40 +01:00
public:
/**
* Override this to get notified when the thread is started.
*/
virtual void ThreadEntry() { }
/**
* Override this to get notified when the thread is about to exit.
*/
virtual void ThreadExit() { }
/**
2013-12-13 23:47:16 +01:00
* This function is required to get threading working.
* Note that this function is NOT thread safe.
* OBS! Do not highjack the looping.
2013-11-26 21:51:40 +01:00
*/
virtual bool DoWork ( ) = 0;
};
}
}
2013-11-26 21:51:40 +01:00
#endif // !MISC_I_THREAD_OBJECT_H