Changeset 148


Ignore:
Timestamp:
3/8/2008 10:32:04 AM (7 years ago)
Author:
lowjoel
Message:

Renamed the Manager file to be called Executor, since that more accurately reflects the purpose.

Location:
branches/eraser6/Manager
Files:
1 added
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Manager/Executor.cs

    r142 r148  
    55namespace Eraser.Manager 
    66{ 
     7    /// <summary> 
     8    /// Executor base class. This class will manage the tasks currently scheduled 
     9    /// to be run and will run them when they are set to be run. This class is 
     10    /// abstract as they each will have their own ways of dealing with tasks. 
     11    /// </summary> 
    712    public abstract class Executor 
    813    { 
     
    1217        /// <param name="task">The Task object describing the details of the task. 
    1318        /// The task object's ID member will be updated to allow unique identification.</param> 
    14         public virtual void AddTask(ref Task task) 
    15         { 
    16             if (unusedIds.Count != 0) 
    17             { 
    18                 task.ID = unusedIds[0]; 
    19                 unusedIds.RemoveAt(0); 
    20             } 
    21             else 
    22                 task.ID = ++nextId; 
    23             tasks.Add(task.ID, task); 
    24         } 
     19        public abstract void AddTask(ref Task task); 
    2520 
    2621        /// <summary> 
     
    2924        /// <param name="taskId">The unique task ID returned when AddTask was called.</param> 
    3025        /// <returns>True if the task was found and deleted.</returns> 
    31         public virtual bool DeleteTask(uint taskId) 
    32         { 
    33             if (!tasks.ContainsKey(taskId)) 
    34                 return false; 
    35             unusedIds.Add(taskId); 
    36             tasks.Remove(taskId); 
    37             return true; 
    38         } 
     26        public abstract bool DeleteTask(uint taskId); 
    3927 
    4028        /// <summary> 
     
    4331        /// <param name="taskId">The Task ID of the task in question.</param> 
    4432        /// <returns>The task object represented by the ID, or null if no object is found</returns> 
    45         public virtual Task GetTask(uint taskId) 
    46         { 
    47             if (!tasks.ContainsKey(taskId)) 
    48                 return null; 
    49             return tasks[taskId]; 
    50         } 
     33        public abstract Task GetTask(uint taskId); 
    5134 
    5235        /// <summary> 
     
    5437        /// </summary> 
    5538        /// <returns>An enumerator to the list of tasks</returns> 
    56         public Dictionary<uint, Task>.Enumerator GetIterator() 
    57         { 
    58             return tasks.GetEnumerator(); 
    59         } 
    60  
    61         private Dictionary<uint, Task> tasks = new Dictionary<uint, Task>(); 
    62         private List<uint> unusedIds = new List<uint>(); 
    63         private uint nextId = 0; 
     39        public abstract Dictionary<uint, Task>.Enumerator GetIterator(); 
    6440    } 
    6541} 
  • branches/eraser6/Manager/Manager.csproj

    r143 r148  
    3434  </ItemGroup> 
    3535  <ItemGroup> 
    36     <Compile Include="Manager.cs" /> 
     36    <Compile Include="DirectExecutor.cs" /> 
     37    <Compile Include="Executor.cs" /> 
    3738    <Compile Include="Method.cs" /> 
    3839    <Compile Include="Properties\AssemblyInfo.cs" /> 
Note: See TracChangeset for help on using the changeset viewer.