Scopira  20080306
task.h
1 
2 /*
3  * Copyright (c) 2005-2006 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_AGENT_TASK_H__
15 #define __INCLUDED_SCOPIRA_AGENT_TASK_H__
16 
17 #include <scopira/tool/export.h>
18 #include <scopira/tool/object.h>
19 #include <scopira/tool/uuid.h>
20 
21 namespace scopira
22 {
23  namespace agent
24  {
25  class task_context; //fwd
26  // users implement these
27  class agent_task_i;
28  }
29 }
30 
46 {
47  public:
48  enum {
49  // the task is done, no need to run again
50  run_done_c = 0, // all done
51 
52  // pick one of these (whole first 8 bits (0xFF) are reserved for this stuff)
53  run_again_0_c = 0x1, // run again, as soon as possible
54  run_again_1_c = 0x2, // run again, ~1 sec
55  run_again_10_c = 0x3, // run again, ~10 sec
56  run_again_100_c = 0x4, // run again, ~100 sec
57 
58  // optional:
59  run_canmove_c = 0x100,
60 
61  // optional:
62  run_onmsg_c = 0x200,
63  };
64 
65  public:
80  SCOPIRA_EXPORT virtual int run(scopira::agent::task_context &ctx) = 0;
81 };
82 
83 #endif
84 
virtual int run(scopira::agent::task_context &ctx)=0
Definition: archiveflow.h:20
Definition: context.h:186
Definition: object.h:71
Definition: task.h:45