Scopira  20080306
timeslice.h
1 
2 /*
3  * Copyright (c) 2009 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_TIMESLICE_H__
15 #define __INCLUDED_SCOPIRA_AGENT_TIMESLICE_H__
16 
17 #include <scopira/tool/time.h>
18 
19 namespace scopira
20 {
21  namespace agent
22  {
23  class timeslice;
24  class global_timeslice;
25  class subtimeslice;
26  class simple_timeslice;
27  }
28 }
29 
37 {
38  public:
46  timeslice(const char * prefix);
47 
49  ~timeslice();
50 
51  private:
52  static const int num_timers = 5;
53  double dm_numerators[num_timers];
54  const char *dm_prefix;
55 
56  scopira::tool::chrono dm_chrono;
57 
58  friend class scopira::agent::subtimeslice;
59 };
60 
68 {
69  public:
71  global_timeslice(const char * prefix = "global_timeslice");
74 
76  static global_timeslice * instance(void) { return dm_instance; }
77 
78  private:
79  static global_timeslice * dm_instance;
80 };
81 
90 {
91  public:
97  subtimeslice(timeslice &parent, int index);
104  subtimeslice(int index);
106  ~subtimeslice();
107  private:
108  timeslice *dm_parent;
109  int dm_index;
110  double dm_starttime;
111 };
112 
119 {
120  public:
122  simple_timeslice(void);
124  ~simple_timeslice();
125 
126  private:
127  scopira::tool::chrono dm_chrono;
128 };
129 
130 #endif
131 
Definition: timeslice.h:118
Definition: archiveflow.h:20
timeslice(const char *prefix)
static global_timeslice * instance(void)
returns the global static instance
Definition: timeslice.h:76
Definition: timeslice.h:89
Definition: timeslice.h:67
Definition: timeslice.h:36
Definition: time.h:241