Scopira  20080306
sidekickthread.h
1 
2 /*
3  * Copyright (c) 2005 National Research Council
4  *
5  * All rights reserved.
6  *
7  * This material is confidential and proprietary information of
8  * National Research Council Canada ("Confidential Information").
9  * This Confidential Information may only be used and reproduced
10  * in accordance with the terms of the license agreement.
11  *
12  */
13 
14 #ifndef __INCLUDED_SCOPIRA_CORE_SIDEKICKTHREAD_H__
15 #define __INCLUDED_SCOPIRA_CORE_SIDEKICKTHREAD_H__
16 
17 #include <list>
18 
19 #include <scopira/core/sidekick.h>
20 
21 namespace scopira
22 {
23  namespace core
24  {
25  class sidekick_runner;
26  class sidekick_thread;
27  }
28 }
29 
40 {
41  public:
43  SCOPIRA_EXPORT sidekick_runner(void);
44 
46  SCOPIRA_EXPORT virtual void run(void);
47 
49  SCOPIRA_EXPORT virtual void notify_stop(void);
50 
51  protected:
52  SCOPIRA_EXPORT virtual void enqueue_sidekick(sidekick_i *t);
53  SCOPIRA_EXPORT virtual bool is_sidekick_running(void);
54 
55  private:
56  typedef std::list<scopira::tool::count_ptr<sidekick_i> > sidekick_list;
57 
58  // the condition in dm_openwindows is used as the signal for this area
59  struct sidekick_area {
60  bool alive;
61  bool running;
62  sidekick_list queue;
63  };
64 
66 };
67 
76 {
77  public:
79  SCOPIRA_EXPORT sidekick_thread(void);
81  SCOPIRA_EXPORT ~sidekick_thread();
82 
83  private:
84  sidekick_runner dm_runner;
85  scopira::tool::thread dm_thready;
86 };
87 
88 #endif
89 
Definition: sidekickthread.h:38
Definition: sidekick.h:127
Definition: archiveflow.h:20
Definition: thread_pthreads.h:69
Definition: thread_pthreads.h:108
virtual void enqueue_sidekick(sidekick_i *t)
actuall driver
virtual void run(void)
the run implementation
virtual bool is_sidekick_running(void)
additional driver method
Definition: sidekick.h:61
virtual void notify_stop(void)
called by sidekick_thread&#39;s dtor
Definition: sidekickthread.h:75