Changeset 6103 for trunk/sources/HeuristicLab.Operators
- Timestamp:
- 05/03/11 11:04:02 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.Operators/3.3/Operator.cs ¶
r5445 r6103 33 33 [Item("Operator", "Base class for operators.")] 34 34 [StorableClass] 35 public abstract class Operator : ParameterizedNamedItem, IOperator {35 public abstract class Operator : ParameterizedNamedItem, IOperator, IStatefulItem { 36 36 public override Image ItemImage { 37 37 get { … … 74 74 protected Operator(bool deserializing) 75 75 : base(deserializing) { 76 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);76 InitializeState(); 77 77 } 78 78 protected Operator(Operator original, Cloner cloner) 79 79 : base(original, cloner) { 80 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);80 InitializeState(); 81 81 this.breakpoint = original.breakpoint; 82 82 } 83 83 protected Operator() 84 84 : base() { 85 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);85 InitializeState(); 86 86 breakpoint = false; 87 87 } 88 88 protected Operator(string name) 89 89 : base(name) { 90 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);90 InitializeState(); 91 91 breakpoint = false; 92 92 } 93 93 protected Operator(string name, ParameterCollection parameters) 94 94 : base(name, parameters) { 95 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);95 InitializeState(); 96 96 breakpoint = false; 97 97 } 98 98 protected Operator(string name, string description) 99 99 : base(name, description) { 100 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication);100 InitializeState(); 101 101 breakpoint = false; 102 102 } 103 103 protected Operator(string name, string description, ParameterCollection parameters) 104 104 : base(name, description, parameters) { 105 InitializeState(); 106 breakpoint = false; 107 } 108 109 public virtual void InitializeState() { 105 110 executionContexts = new Lazy<ThreadLocal<IExecutionContext>>(() => { return new ThreadLocal<IExecutionContext>(); }, LazyThreadSafetyMode.ExecutionAndPublication); 106 breakpoint = false; 111 } 112 public virtual void ClearState() { 113 executionContexts = null; 107 114 } 108 115
Note: See TracChangeset
for help on using the changeset viewer.