Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:43:50

0001 #ifndef THREAD_H
0002 #define THREAD_H
0003 
0004 /**
0005  * @file Thread.h
0006  * @author Bryan BERTHOU (SPhN / CEA Saclay)
0007  * @author <contibutor> http://vichargrave.com/java-style-thread-class-in-c/
0008  * @date 10 September 2014
0009  */
0010 namespace sf {
0011 class Thread;
0012 } /* namespace sf */
0013 
0014 namespace ElemUtils {
0015 
0016 /**
0017  * @class Thread
0018  */
0019 class Thread {
0020 public:
0021     /**
0022      * Default constructor.
0023      */
0024     Thread();
0025 
0026     /**
0027      * Default destructor.
0028      */
0029     virtual ~Thread();
0030 
0031     //TODO change it or suppress it
0032     virtual Thread* clone() const;
0033 
0034     /**
0035      * Main function executed by the thread.
0036      */
0037     virtual void run();
0038 
0039     void launch();
0040     void wait();
0041 
0042 protected:
0043     Thread(const Thread &other);
0044 
0045     // bool m_isRunning; /// Use to avoid segmentation fault when attempt to wait for a thread that is already terminated
0046 
0047 private:
0048     sf::Thread* m_pThread;
0049 };
0050 
0051 } // namespace ElemUtils
0052 
0053 #endif /* THREAD_H */
0054