1 /*
2     Copyright (c) 1998, 1999, 2000, 2001, 2003, 2004 Benhur Stein
3 
4     This file is part of Paj�.
5 
6     Paj� is free software; you can redistribute it and/or modify it under
7     the terms of the GNU Lesser General Public License as published by the
8     Free Software Foundation; either version 2 of the License, or (at your
9     option) any later version.
10 
11     Paj� is distributed in the hope that it will be useful, but WITHOUT ANY
12     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13     FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
14     for more details.
15 
16     You should have received a copy of the GNU Lesser General Public License
17     along with Paj�; if not, write to the Free Software Foundation, Inc.,
18     59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19 */
20 #ifndef _BusyArray_h_
21 #define _BusyArray_h_
22 
23 // BusyArray
24 //
25 // Array that keeps an ordered list (by time) of the occupation
26 // of a node, with a BusyDate for each time, representing how many
27 // threads (and which states) were busy between that time and the
28 // next time of the list. Receives PStates as input objects.
29 // Its enumerator returns PStates created to represent each of these
30 // time slices.
31 
32 // 19980227 BS  creation
33 
34 #include <Foundation/Foundation.h>
35 #include "../General/PSortedArray.h"
36 #include "BusyDate.h"
37 #include "../General/PajeContainer.h"
38 
39 @interface BusyArray : PSortedArray
40 {
41     PajeContainer *container;  // not retained
42     PajeEntityType *entityType;
43 }
44 
45 - (id)initWithEntityType:(PajeEntityType *)et
46                container:(PajeContainer *)cont
47                startTime:(NSDate *)startTime
48                  endTime:(NSDate *)endTime;
49 - (id)initWithEntityType:(PajeEntityType *)et
50                container:(PajeContainer *)cont
51                startTime:(NSDate *)startTime
52                  endTime:(NSDate *)endTime
53               enumerator:(NSEnumerator *)enumerator
54              valueFilter:(NSSet *)filter;
55 
56 - (void)dealloc;
57 
58 - (void)addEntity:(PajeEntity *)entity;
59 
60 - (NSEnumerator *)objectEnumeratorOfClass:(Class)c;
61 - (NSEnumerator *)objectEnumeratorOfClass:(Class)c
62                                  fromTime:(NSDate *)t1
63                                    toTime:(NSDate *)t2;
64 - (NSEnumerator *)completeObjectEnumeratorOfClass:(Class)c
65                                          fromTime:(NSDate *)t1
66                                            toTime:(NSDate *)t2;
67 - (NSEnumerator *)reverseObjectEnumeratorOfClass:(Class)c;
68 - (NSEnumerator *)reverseObjectEnumeratorOfClass:(Class)c
69                                         fromTime:(NSDate *)t1
70                                           toTime:(NSDate *)t2;
71 
72 - (PajeContainer *)container;
73 - (PajeEntityType *)entityType;
74 - (NSDate *)startTime;
75 - (NSDate *)endTime;
76 @end
77 
78 #endif
79