Changeset 1186 for trunk/sources/HeuristicLab.ThreadParallelEngine
- Timestamp:
- 01/29/09 14:03:34 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.ThreadParallelEngine
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ThreadParallelEngine/HeuristicLabThreadParallelEnginePlugin.cs
r582 r1186 26 26 27 27 namespace HeuristicLab.ThreadParallelEngine { 28 /// <summary> 29 /// Plugin class for HeuristicLab.ThreadParallelEngine plugin. 30 /// </summary> 28 31 [ClassInfo(Name = "HeuristicLab.ThreadParallelEngine-3.2")] 29 32 [PluginFile(Filename = "HeuristicLab.ThreadParallelEngine-3.2.dll", Filetype = PluginFileType.Assembly)] -
trunk/sources/HeuristicLab.ThreadParallelEngine/ThreadParallelEngine.cs
r2 r1186 28 28 29 29 namespace HeuristicLab.ThreadParallelEngine { 30 /// <summary> 31 /// Implementation of an engine being able to run in parallel with threads. 32 /// </summary> 30 33 public class ThreadParallelEngine : EngineBase, IEditable { 31 34 #region Inner Class Task … … 42 45 43 46 private int myWorkers; 47 /// <summary> 48 /// Gets or sets the number of worker threads of the current engine. 49 /// </summary> 50 /// <remarks>Calls <see cref="OnWorkersChanged"/> in the setter.</remarks> 44 51 public int Workers { 45 52 get { return myWorkers; } … … 52 59 } 53 60 54 61 /// <summary> 62 /// Initializes a new instance of <see cref="ThreadParallelEngine"/> with the number of processors 63 /// as number of worker threads. 64 /// </summary> 55 65 public ThreadParallelEngine() { 56 66 myWorkers = Environment.ProcessorCount; … … 59 69 60 70 71 /// <inheritdoc/> 72 /// <returns>The cloned object as <see cref="ThreadParallelEngine"/>.</returns> 61 73 public override object Clone(IDictionary<Guid, object> clonedObjects) { 62 74 ThreadParallelEngine clone = (ThreadParallelEngine)base.Clone(clonedObjects); … … 65 77 } 66 78 79 /// <summary> 80 /// Creates a new instance of <see cref="ThreadParallelEngineEditor"/> to display the current 81 /// instance. 82 /// </summary> 83 /// <returns>The created instance as <see cref="ThreadParallelEngineEditor"/>.</returns> 67 84 public override IView CreateView() { 68 85 return new ThreadParallelEngineEditor(this); 69 86 } 87 /// <summary> 88 /// Creates a new instance of <see cref="ThreadParallelEngineEditor"/>. 89 /// </summary> 90 /// <returns>The created instance as <see cref="ThreadParallelEngineEditor"/>.</returns> 70 91 public virtual IEditor CreateEditor() { 71 92 return new ThreadParallelEngineEditor(this); 72 93 } 73 94 95 /// <summary> 96 /// This execution method is not supported by ThreadParallelEngines. 97 /// </summary> 98 /// <exception cref="InvalidOperationException">Thrown because the current instance of an engine 99 /// does not support stepwise execution.</exception> 100 /// <param name="steps">The number of steps to execute.</param> 74 101 public override void ExecuteSteps(int steps) { 75 102 throw new InvalidOperationException("ThreadParallelEngine doesn't support stepwise execution"); 76 103 } 77 104 105 /// <inheritdoc/> 78 106 public override void Abort() { 79 107 base.Abort(); … … 83 111 } 84 112 } 85 113 /// <summary> 114 /// Processes the next operation (if it is a compositeOperation and it can be executed in parallel it is 115 /// done). 116 /// </summary> 86 117 protected override void ProcessNextOperation() { 87 118 operatorIndex = 1; … … 169 200 } 170 201 202 /// <summary> 203 /// Occurs when the number of workers has been changed. 204 /// </summary> 171 205 public event EventHandler WorkersChanged; 206 /// <summary> 207 /// Fires a new <c>WorkersChanged</c> event. 208 /// </summary> 172 209 protected virtual void OnWorkersChanged() { 173 210 if (WorkersChanged != null) … … 176 213 177 214 #region Persistence Methods 215 /// <summary> 216 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 217 /// </summary> 218 /// <remarks>The number of workers is saved as <see cref="XmlAttribute"/> with attribute name 219 /// <c>Workers</c>.</remarks> 220 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 221 /// <param name="document">The <see cref="XmlDocument"/> where the data is saved.</param> 222 /// <param name="persistedObjects">The dictionary of all already persisted objects. 223 /// (Needed to avoid cycles.)</param> 224 /// <returns>The saved <see cref="XmlNode"/>.</returns> 178 225 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 179 226 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 183 230 return node; 184 231 } 232 /// <summary> 233 /// Loads the persisted engine from the specified <paramref name="node"/>. 234 /// </summary> 235 /// <remarks>The number of workers must be saved in a specific way, see <see cref="GetXmlNode"/> 236 /// for further information.</remarks> 237 /// <param name="node">The <see cref="XmlNode"/> where the instance is saved.</param> 238 /// <param name="restoredObjects">The dictionary of all already restored objects. 239 /// (Needed to avoid cycles.)</param> 185 240 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 186 241 base.Populate(node, restoredObjects); -
trunk/sources/HeuristicLab.ThreadParallelEngine/ThreadParallelEngineEditor.cs
r2 r1186 30 30 31 31 namespace HeuristicLab.ThreadParallelEngine { 32 /// <summary> 33 /// Visual representation of a <see cref="ThreadParallelEngine"/>. 34 /// </summary> 32 35 public partial class ThreadParallelEngineEditor : EngineBaseEditor { 36 /// <summary> 37 /// Gets or sets the ThreadParallelEngine to display. 38 /// </summary> 39 /// <remarks>Uses property <see cref="EngineBaseEditor.Engine"/> of base class 40 /// <see cref="EngineBaseEditor"/>. No own data storage present.</remarks> 33 41 public ThreadParallelEngine ThreadParallelEngine { 34 42 get { return (ThreadParallelEngine)Engine; } … … 36 44 } 37 45 46 /// <summary> 47 /// Initializes a new instance of <see cref="ThreadParallelEngineEditor"/>. 48 /// </summary> 38 49 public ThreadParallelEngineEditor() { 39 50 InitializeComponent(); 40 51 } 52 /// <summary> 53 /// Initializes a new instance of <see cref="ThreadParallelEngineEditor"/> with the given 54 /// <paramref name="threadParallelEngine"/> to display. 55 /// </summary> 56 /// <param name="threadParallelEngine">The engine to represent visually.</param> 41 57 public ThreadParallelEngineEditor(ThreadParallelEngine threadParallelEngine) 42 58 : this() { … … 44 60 } 45 61 62 /// <summary> 63 /// Removes the eventhandlers from the underlying <see cref="ThreadParallelEngine"/>. 64 /// </summary> 65 /// <remarks>Calls <see cref="EngineBaseEditor.RemoveItemEvents"/> of base class 66 /// <see cref="EngineBaseEditor"/>. 67 /// </remarks> 46 68 protected override void RemoveItemEvents() { 47 69 ThreadParallelEngine.WorkersChanged -= new EventHandler(ThreadParallelEngine_WorkersChanged); … … 49 71 } 50 72 73 /// <summary> 74 /// Adds eventhandlers to the underlying <see cref="ThreadParallelEngine"/>. 75 /// </summary> 76 /// <remarks>Calls <see cref="EngineBaseEditor.AddItemEvents"/> of base class 77 /// <see cref="EngineBaseEditor"/>. 78 /// </remarks> 51 79 protected override void AddItemEvents() { 52 80 base.AddItemEvents(); … … 54 82 } 55 83 84 /// <summary> 85 /// Updates the controls with the latest data. 86 /// </summary> 87 /// <remarks>Calls <see cref="EngineBaseEditor.UpdateControls"/> of base class 88 /// <see cref="EngineBaseEditor"/>.</remarks> 56 89 protected override void UpdateControls() { 57 90 base.UpdateControls();
Note: See TracChangeset
for help on using the changeset viewer.