summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.i
blob: 777bb86fc5cdadb00ad8e701a8f95b15f3b29ff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
/* -*- C++ -*- */
// $Id$
//
// ============================================================================
//
// = LIBRARY
//    sched
//
// = FILENAME
//    SchedEntry.i
//
// = CREATION DATE
//    7 February 1998
//
// = AUTHOR
//    Chris Gill
//
// ============================================================================

//////////////////////
// Class Task_Entry //
//////////////////////

// return a pointer to the underlying RT_Info
ACE_INLINE Task_Entry::RT_Info *
Task_Entry::rt_info () const
{
  return rt_info_;
}

// set the underlying RT_Info pointer
ACE_INLINE void
Task_Entry::rt_info (Task_Entry::RT_Info *info)
{
  rt_info_ = info;
}

// get effective period for the task entry
ACE_INLINE Task_Entry::Period
Task_Entry::effective_period () const
{
  return effective_period_;
}

// set effective period for the task entry
ACE_INLINE void
Task_Entry::effective_period (Task_Entry::Period p)
{
  effective_period_ = p;
}

ACE_INLINE void
Task_Entry::discovered (long l)
{
  discovered_ = l;
  dfs_status_ = VISITED;
}

ACE_INLINE long
Task_Entry::discovered () const
{
  return discovered_;
}

ACE_INLINE void
Task_Entry::finished (long l)
{
  finished_ = l;
  dfs_status_ = FINISHED;
}

ACE_INLINE long
Task_Entry::finished () const
{
  return finished_;
}

ACE_INLINE Task_Entry::DFS_Status
Task_Entry::dfs_status () const
{
  return dfs_status_;
}

ACE_INLINE void
Task_Entry::dfs_status (Task_Entry::DFS_Status ds)
{
  dfs_status_ = ds;
}

ACE_INLINE void
Task_Entry::is_thread_delineator (int i)
{
  is_thread_delineator_ = i;
}

ACE_INLINE int
Task_Entry::is_thread_delineator () const
{
  return is_thread_delineator_;
}

// access set of Task Entries on which this entry depends
ACE_INLINE ACE_Unbounded_Set <Task_Entry_Link *> &
Task_Entry::calls ()
{
  return calls_;
}

// access set of Task Entries which depend on this entry
ACE_INLINE ACE_Unbounded_Set <Task_Entry_Link *> &
Task_Entry::callers ()
{
  return callers_;
}

// get set of arrivals in the effective period
ACE_INLINE ACE_Ordered_MultiSet<Dispatch_Entry_Link> &
Task_Entry::dispatches ()
{
  return dispatches_;
}


ACE_INLINE Task_Entry::Info_Type
Task_Entry::info_type () const
{
  return rt_info_->info_type;
}

ACE_INLINE u_long
Task_Entry::effective_execution_time () const
{
  // Just use low 32 bits.  This will have to change when CosTimeBase.idl
  // is finalized.
  ACE_UINT32 worst_case_execution_time =
    ACE_U64_TO_U32 (rt_info_->worst_case_execution_time);

  return (rt_info_->info_type == RtecScheduler::OPERATION)
         ? worst_case_execution_time * dispatches_.size ()
         : 0;
}


///////////////////////////
// Class Task_Entry_Link //
///////////////////////////


// accessor: number of calls of dependency by dependant
ACE_INLINE CORBA::Long
Task_Entry_Link::number_of_calls () const
{
  return number_of_calls_;
}

ACE_INLINE Task_Entry_Link::Dependency_Type
Task_Entry_Link::dependency_type () const
{
  return dependency_type_;
}

// accessor: dependant task entry
ACE_INLINE Task_Entry &
Task_Entry_Link::caller () const
{
  return caller_;
}

// accessor: dependency task entry
ACE_INLINE Task_Entry &
Task_Entry_Link::called () const
{
  return called_;
}

//////////////////////////
// Class Dispatch Entry //
//////////////////////////

ACE_INLINE u_long
Dispatch_Entry::dispatch_id () const
{
  return dispatch_id_;
}

ACE_INLINE Dispatch_Entry::Preemption_Priority
Dispatch_Entry::priority () const
{
  return priority_;
}

ACE_INLINE void
Dispatch_Entry::priority (Dispatch_Entry::Preemption_Priority p)
{
  priority_ = p;
}

ACE_INLINE Dispatch_Entry::OS_Priority
Dispatch_Entry::OS_priority () const
{
  return OS_priority_;
}

ACE_INLINE void
Dispatch_Entry::OS_priority (Dispatch_Entry::OS_Priority p)
{
  OS_priority_ = p;
}

ACE_INLINE Dispatch_Entry::Sub_Priority
Dispatch_Entry::dynamic_subpriority () const
{
  return dynamic_subpriority_;
}

ACE_INLINE void
Dispatch_Entry::dynamic_subpriority (Dispatch_Entry::Sub_Priority p)
{
  dynamic_subpriority_ = p;
}

ACE_INLINE Dispatch_Entry::Sub_Priority
Dispatch_Entry::static_subpriority () const
{
  return static_subpriority_;
}

ACE_INLINE void
Dispatch_Entry::static_subpriority (Dispatch_Entry::Sub_Priority p)
{
  static_subpriority_ = p;
}


ACE_INLINE Dispatch_Entry::Time
Dispatch_Entry::arrival () const
{
  return arrival_;
}

ACE_INLINE Dispatch_Entry::Time
Dispatch_Entry::deadline () const
{
  return deadline_;
}

ACE_INLINE Task_Entry &
Dispatch_Entry::task_entry () const
{
  return task_entry_;
}


// accessor for pointer to original dispatch
ACE_INLINE Dispatch_Entry *
Dispatch_Entry::original_dispatch ()
{
  return original_dispatch_;
}


///////////////////////////////
// Class Dispatch_Entry_Link //
///////////////////////////////

ACE_INLINE
Dispatch_Entry_Link::~Dispatch_Entry_Link ()
{
}
  // dtor

ACE_INLINE int
Dispatch_Entry_Link::operator < (const Dispatch_Entry_Link &d) const
{
  return (this->dispatch_entry_ < d.dispatch_entry_);
}
  // GT comparator


ACE_INLINE Dispatch_Entry &
Dispatch_Entry_Link::dispatch_entry () const
{
  return dispatch_entry_;
}
  // accessor for reference to dispatch entry


///////////////////////////////////
// Class Dispatch_Proxy_Iterator //
///////////////////////////////////

ACE_INLINE int
Dispatch_Proxy_Iterator::done () const
{
  return iter_.done ();
}
  // returns 0 if there are more entries to see, 1 if not


//////////////////////////
// Class TimeLine_Entry //
//////////////////////////

    // dispatch entry accessor
ACE_INLINE Dispatch_Entry &
TimeLine_Entry::dispatch_entry () const
{
  return dispatch_entry_;
}


// accessor for time slice start time (100 nanoseconds)
ACE_INLINE RtecScheduler::Time
TimeLine_Entry::start () const
{
  return start_;
}

// accessor for time slice stop time (100 nanoseconds)
ACE_INLINE RtecScheduler::Time
TimeLine_Entry::stop () const
{
  return stop_;
}

// accessor for time slice stop time (100 nanoseconds)
ACE_INLINE RtecScheduler::Time
TimeLine_Entry::arrival () const
{
  return arrival_;
}

// accessor for time slice stop time (100 nanoseconds)
ACE_INLINE RtecScheduler::Time
TimeLine_Entry::deadline () const
{
  return deadline_;
}


// accessor for next slice for this dispatch
ACE_INLINE TimeLine_Entry *
TimeLine_Entry::next (void) const
{
  return next_;
}

// mutator for next slice for this dispatch
ACE_INLINE void
TimeLine_Entry::next (TimeLine_Entry *t)
{
  next_ = t;
}

// accessor for previous slice for this dispatch
ACE_INLINE TimeLine_Entry *
TimeLine_Entry::prev (void) const
{
  return prev_;
}

// mutator for previous slice for this dispatch
ACE_INLINE void
TimeLine_Entry::prev (TimeLine_Entry *t)
{
  prev_ = t;
}


ACE_INLINE int
TimeLine_Entry::operator < (const TimeLine_Entry &t) const
{
  return (start_ < t.start_) ? 1 : 0;
}
  // comparison operator


///////////////////////////////
// Class TimeLine_Entry_Link //
///////////////////////////////


ACE_INLINE TimeLine_Entry_Link::TimeLine_Entry_Link  (TimeLine_Entry &t)
  : entry_ (t)
{
}
  // ctor

ACE_INLINE TimeLine_Entry &
TimeLine_Entry_Link::entry () const
{
  return entry_;
}
  // accessor for the underlying entry

ACE_INLINE int
TimeLine_Entry_Link::operator < (const TimeLine_Entry_Link &l) const
{
  return (entry_ < l.entry_) ? 1 : 0;
}
  // comparison operator