~hikiko/nux/arb-srgba-shader

« back to all changes in this revision

Viewing changes to Nux/SystemThread.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-02 03:28:11 UTC
  • Revision ID: neil.patel@canonical.com-20100902032811-i2m18tfb6pkasnvt
Remove Win EOL chars

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
 
22
22
 
23
 
#ifndef SYSTEMTHREAD_H
24
 
#define SYSTEMTHREAD_H
25
 
 
26
 
NAMESPACE_BEGIN_GUI
27
 
 
28
 
class WindowCompositor;
29
 
class WindowThread;
30
 
 
31
 
class SystemThread: public AbstractThread
32
 
{
33
 
    DECLARE_OBJECT_TYPE(SystemThread, AbstractThread);
34
 
public:
35
 
    SystemThread(AbstractThread* Parent = 0);
36
 
    ~SystemThread();
37
 
 
38
 
    virtual ThreadState Start(void* arg);
39
 
 
40
 
protected:
41
 
    virtual unsigned int Run(void* arg);
42
 
 
43
 
    virtual ThreadState StartChildThread(NThread* thread, bool Modal);
44
 
    virtual void AddChildThread(NThread*);
45
 
    virtual void RemoveChildThread(NThread*);
46
 
    virtual void ChildHasFinished(NThread* app);
47
 
    virtual void TerminateAllChildThread();
48
 
 
49
 
//    std::list<NThread*> m_ChildThread;
50
 
//    SystemThread* m_Parent;
51
 
//    ThreadUserInitFunc m_UserInitFunc;
52
 
//    ThreadUserExitFunc m_UserExitFunc;
53
 
 
54
 
    /*!
55
 
    This pointer maybe set by the user in ThreadInitFunc and reused in ThreadExitFunc
56
 
    */
57
 
    void* m_InitData;
58
 
    void* m_ExitData;
59
 
 
60
 
    /*!
61
 
        Info: Constructor-like function. 
62
 
 
63
 
        Will be called by EntryPoint before executing the thread body.
64
 
        Override this function to provide your extra initialization.
65
 
 
66
 
        NOTE: do not confuse it with the classes constructor
67
 
    */
68
 
    virtual bool ThreadCtor();
69
 
 
70
 
    /*!
71
 
        Info: Destructor-like function. 
72
 
 
73
 
        Will be called by EntryPoint after executing the thread body.
74
 
        Override this function to provide your extra destruction.
75
 
 
76
 
        NOTE: do not confuse it with the classes constructor
77
 
    */
78
 
    virtual bool ThreadDtor();
79
 
 
80
 
    /*!
81
 
        This pointer maybe set by the user in ThreadInitFunc and reused in ThreadExitFunc
82
 
    */
83
 
private:
84
 
    SystemThread(const SystemThread&);
85
 
    // Does not make sense for a singleton. This is a self assignment.
86
 
    SystemThread& operator=(const SystemThread&);
87
 
    // Declare operator adress-of as private 
88
 
    SystemThread* operator &();
89
 
 
90
 
private:
91
 
    NString m_ThreadName;
92
 
 
93
 
    friend class GfxServerImpl;
94
 
    friend class WindowThread;
95
 
};
96
 
 
97
 
NAMESPACE_END_GUI
98
 
 
99
 
#endif // SYSTEMTHREAD_H
 
23
#ifndef SYSTEMTHREAD_H
 
24
#define SYSTEMTHREAD_H
 
25
 
 
26
NAMESPACE_BEGIN_GUI
 
27
 
 
28
class WindowCompositor;
 
29
class WindowThread;
 
30
 
 
31
class SystemThread: public AbstractThread
 
32
{
 
33
    DECLARE_OBJECT_TYPE(SystemThread, AbstractThread);
 
34
public:
 
35
    SystemThread(AbstractThread* Parent = 0);
 
36
    ~SystemThread();
 
37
 
 
38
    virtual ThreadState Start(void* arg);
 
39
 
 
40
protected:
 
41
    virtual unsigned int Run(void* arg);
 
42
 
 
43
    virtual ThreadState StartChildThread(NThread* thread, bool Modal);
 
44
    virtual void AddChildThread(NThread*);
 
45
    virtual void RemoveChildThread(NThread*);
 
46
    virtual void ChildHasFinished(NThread* app);
 
47
    virtual void TerminateAllChildThread();
 
48
 
 
49
//    std::list<NThread*> m_ChildThread;
 
50
//    SystemThread* m_Parent;
 
51
//    ThreadUserInitFunc m_UserInitFunc;
 
52
//    ThreadUserExitFunc m_UserExitFunc;
 
53
 
 
54
    /*!
 
55
    This pointer maybe set by the user in ThreadInitFunc and reused in ThreadExitFunc
 
56
    */
 
57
    void* m_InitData;
 
58
    void* m_ExitData;
 
59
 
 
60
    /*!
 
61
        Info: Constructor-like function. 
 
62
 
 
63
        Will be called by EntryPoint before executing the thread body.
 
64
        Override this function to provide your extra initialization.
 
65
 
 
66
        NOTE: do not confuse it with the classes constructor
 
67
    */
 
68
    virtual bool ThreadCtor();
 
69
 
 
70
    /*!
 
71
        Info: Destructor-like function. 
 
72
 
 
73
        Will be called by EntryPoint after executing the thread body.
 
74
        Override this function to provide your extra destruction.
 
75
 
 
76
        NOTE: do not confuse it with the classes constructor
 
77
    */
 
78
    virtual bool ThreadDtor();
 
79
 
 
80
    /*!
 
81
        This pointer maybe set by the user in ThreadInitFunc and reused in ThreadExitFunc
 
82
    */
 
83
private:
 
84
    SystemThread(const SystemThread&);
 
85
    // Does not make sense for a singleton. This is a self assignment.
 
86
    SystemThread& operator=(const SystemThread&);
 
87
    // Declare operator adress-of as private 
 
88
    SystemThread* operator &();
 
89
 
 
90
private:
 
91
    NString m_ThreadName;
 
92
 
 
93
    friend class GfxServerImpl;
 
94
    friend class WindowThread;
 
95
};
 
96
 
 
97
NAMESPACE_END_GUI
 
98
 
 
99
#endif // SYSTEMTHREAD_H