Zero  0.1.0
w_stat.h
Go to the documentation of this file.
1 /*<std-header orig-src='shore' incl-file-exclusion='W_STAT_H'>
2 
3  $Id: w_stat.h,v 1.1 2010/05/26 01:20:26 nhall Exp $
4 
5 SHORE -- Scalable Heterogeneous Object REpository
6 
7 Copyright (c) 1994-99 Computer Sciences Department, University of
8  Wisconsin -- Madison
9 All Rights Reserved.
10 
11 Permission to use, copy, modify and distribute this software and its
12 documentation is hereby granted, provided that both the copyright
13 notice and this permission notice appear in all copies of the
14 software, derivative works or modified versions, and any portions
15 thereof, and that both notices appear in supporting documentation.
16 
17 THE AUTHORS AND THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY
18 OF WISCONSIN - MADISON ALLOW FREE USE OF THIS SOFTWARE IN ITS
19 "AS IS" CONDITION, AND THEY DISCLAIM ANY LIABILITY OF ANY KIND
20 FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
21 
22 This software was developed with support by the Advanced Research
23 Project Agency, ARPA order number 018 (formerly 8230), monitored by
24 the U.S. Army Research Laboratory under contract DAAB07-91-C-Q518.
25 Further funding for this work was provided by DARPA through
26 Rome Research Laboratory Contract No. F30602-97-2-0247.
27 
28 */
29 
30 #ifndef __W_STAT_H
31 #define __W_STAT_H
32 
33 #include "w_defines.h"
34 
35 /* -- do not edit anything above this line -- </std-header>*/
36 
37 #ifndef __W_BASE_H
38 #include "w_base.h"
39 #endif // __W_BASE_H
40 #ifndef __W_RC_H
41 #include "w_rc.h"
42 #endif // __W_RC_H
43 
44 class w_statistics_t; // forward
45 class w_stat_module_t; // forward
46 
138 class w_stat_t {
139  friend class w_statistics_t;
140 friend class w_stat_module_t;
141 
142  /* grot */
143  friend ostream& operator<<(ostream& out, const w_statistics_t& s);
144 
145 protected:
146  union {
149  } _u;
150 
151 public:
154  _u.i = 0;
155  }
156 
158  w_stat_t(int i) {
159  _u.i = i;
160  }
161 
162  operator int() const {
163  return _u.i;
164  }
165 
168  _u.f = i;
169  }
170 
172  operator w_base_t::base_float_t() const {
173  return _u.f;
174  }
175 
176  friend bool operator==(const w_stat_t&, const w_stat_t&);
177 
178  friend bool operator!=(const w_stat_t&, const w_stat_t&);
179 };
180 
181 /*<std-footer incl-file-exclusion='W_STAT_H'> -- do not edit anything below this line -- */
182 
183 #endif // __W_STAT_H /*</std-footer>*/
union w_stat_t::@15 _u
w_stat_t(w_base_t::base_float_t i)
Initialize to floating point i.
Definition: w_stat.h:167
friend ostream & operator<<(ostream &out, const w_statistics_t &s)
friend class w_stat_module_t
Definition: w_stat.h:140
int32_t base_stat_t
Definition: w_base.h:296
friend bool operator!=(const w_stat_t &, const w_stat_t &)
w_base_t::base_float_t f
Definition: w_stat.h:148
float base_float_t
Definition: w_base.h:297
w_stat_t()
Initialize to zero.
Definition: w_stat.h:153
A single statistic punning structure.
Definition: w_stat.h:138
w_base_t::base_stat_t i
Definition: w_stat.h:147
friend class w_statistics_t
Definition: w_stat.h:139
w_stat_t(int i)
Initialize to integer i.
Definition: w_stat.h:158
friend bool operator==(const w_stat_t &, const w_stat_t &)