committing back changes from branch.
[cpuHistory.git] / CPUInfo.h
blobe43452fe27f926c0b394a7ee8609e20d09c29220
1 //
2 // CPUInfo.h
3 // CPU Usage
4 //
5 // Created by Peter Hosey on 2006-06-21.
6 // Copyright 2006 Peter Hosey. All rights reserved.
7 //
8 // Modified by Christopher Bowns, starting 2007-1-1.
10 #import <Cocoa/Cocoa.h>
12 #include <mach/mach.h>
13 #include <mach/processor_info.h>
14 #include <mach/mach_host.h>
16 typedef struct cpudata {
17 double user;
18 double sys;
19 double nice;
20 double idle;
21 } CPUData, *CPUDataPtr;
23 @interface CPUInfo : NSObject {
24 processor_info_array_t lastcpustat;
25 mach_msg_type_number_t numlastcpustat;
26 unsigned numCPUs;
27 float *CPUUsage;
28 CPUDataPtr cpudata;
29 int size;
30 int inptr;
31 int outptr;
34 - (CPUInfo *)initWithCapacity:(unsigned)numItems;
35 - (void)refresh;
36 - (void)startIterate;
37 - (BOOL)getNext:(CPUDataPtr)ptr;
38 - (void)getCurrent:(CPUDataPtr)ptr;
39 - (void)getLast:(CPUDataPtr)ptr;
40 - (int)getSize;
42 // - (CPUData)updateCPUUsage;
44 TODO we're going to want this.
47 @end