| 1 |
/* |
| 2 |
* ResourceScenario.h - TaskJuggler |
| 3 |
* |
| 4 |
* SPDX-FileCopyrightText: 2001, 2002, 2003, 2004, 2005 Chris Schlaeger <[email protected]> |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of version 2 of the GNU General Public License as |
| 8 |
* published by the Free Software Foundation. |
| 9 |
* |
| 10 |
* $Id$ |
| 11 |
*/ |
| 12 |
|
| 13 |
#ifndef _ResourceScenario_h_ |
| 14 |
#define _ResourceScenario_h_ |
| 15 |
|
| 16 |
#include "Task.h" |
| 17 |
|
| 18 |
namespace TJ |
| 19 |
{ |
| 20 |
|
| 21 |
class ResourceScenario |
| 22 |
{ |
| 23 |
friend class Resource; |
| 24 |
|
| 25 |
public: |
| 26 |
ResourceScenario() : |
| 27 |
allocatedTasks(), |
| 28 |
firstSlot(-1), |
| 29 |
lastSlot(-1) |
| 30 |
{ } |
| 31 |
|
| 32 |
~ResourceScenario() { } |
| 33 |
|
| 34 |
void addTask(const Task* t) |
| 35 |
{ |
| 36 |
if (!allocatedTasks.contains(const_cast<Task*>(t))) |
| 37 |
allocatedTasks.append(const_cast<Task*>(t)); |
| 38 |
} |
| 39 |
private: |
| 40 |
TaskList allocatedTasks; |
| 41 |
int firstSlot; |
| 42 |
int lastSlot; |
| 43 |
} ; |
| 44 |
|
| 45 |
} // namespace TJ |
| 46 |
|
| 47 |
#endif |