All Classes Namespaces Files Functions Variables Enumerations Enumerator
libs/system/Thread.h
Go to the documentation of this file.
00001 #ifndef QRK_THREAD_H
00002 #define QRK_THREAD_H
00003 
00013 #include <memory>
00014 
00015 
00016 namespace qrk
00017 {
00019     class Thread
00020     {
00021     public:
00022         enum {
00023             Infinity = -1,
00024         };
00025 
00032         explicit Thread(int (*fn)(void *), void* args);
00033         ~Thread(void);
00034 
00035 
00041         void run(int times = 1);
00042 
00043 
00045         void stop(void);
00046 
00047 
00053         int wait(void);
00054 
00055 
00062         bool isRunning(void) const;
00063 
00064     private:
00065         Thread(void);
00066         Thread(const Thread& rhs);
00067         Thread& operator = (const Thread& rhs);
00068 
00069         struct pImpl;
00070         const std::auto_ptr<pImpl> pimpl;
00071     };
00072 }
00073 
00074 #endif /* !QRK_THREAD_H */