equal
deleted
inserted
replaced
95 }; |
95 }; |
96 |
96 |
97 template <typename T, bool negation> |
97 template <typename T, bool negation> |
98 class Retired { |
98 class Retired { |
99 public: |
99 public: |
100 typedef typename T Type; |
100 typedef T Type; |
101 bool process(T* t) { |
101 bool process(Type* t) { |
102 assert(t != NULL, "invariant"); |
102 assert(t != NULL, "invariant"); |
103 return negation ? !t->retired() : t->retired(); |
103 return negation ? !t->retired() : t->retired(); |
104 } |
104 } |
105 }; |
105 }; |
106 |
106 |
107 template <typename T, bool negation> |
107 template <typename T, bool negation> |
108 class Excluded { |
108 class Excluded { |
109 public: |
109 public: |
110 typedef typename T Type; |
110 typedef T Type; |
111 bool process(T* t) { |
111 bool process(Type* t) { |
112 assert(t != NULL, "invariant"); |
112 assert(t != NULL, "invariant"); |
113 return negation ? !t->excluded() : t->excluded(); |
113 return negation ? !t->excluded() : t->excluded(); |
114 } |
114 } |
115 }; |
115 }; |
116 |
116 |
131 private: |
131 private: |
132 Predicate& _predicate; |
132 Predicate& _predicate; |
133 public: |
133 public: |
134 PredicatedMutexedWriteOp(Operation& operation, Predicate& predicate) : |
134 PredicatedMutexedWriteOp(Operation& operation, Predicate& predicate) : |
135 MutexedWriteOp(operation), _predicate(predicate) {} |
135 MutexedWriteOp(operation), _predicate(predicate) {} |
136 bool process(Type* t) { |
136 bool process(typename Operation::Type* t) { |
137 return _predicate.process(t) ? MutexedWriteOp<Operation>::process(t) : true; |
137 return _predicate.process(t) ? MutexedWriteOp<Operation>::process(t) : true; |
138 } |
138 } |
139 }; |
139 }; |
140 |
140 |
141 template <typename Operation> |
141 template <typename Operation> |
155 private: |
155 private: |
156 Predicate& _predicate; |
156 Predicate& _predicate; |
157 public: |
157 public: |
158 PredicatedConcurrentWriteOp(Operation& operation, Predicate& predicate) : |
158 PredicatedConcurrentWriteOp(Operation& operation, Predicate& predicate) : |
159 ConcurrentWriteOp(operation), _predicate(predicate) {} |
159 ConcurrentWriteOp(operation), _predicate(predicate) {} |
160 bool process(Type* t) { |
160 bool process(typename Operation::Type* t) { |
161 return _predicate.process(t) ? ConcurrentWriteOp<Operation>::process(t) : true; |
161 return _predicate.process(t) ? ConcurrentWriteOp<Operation>::process(t) : true; |
162 } |
162 } |
163 }; |
163 }; |
164 |
164 |
165 template <typename Operation> |
165 template <typename Operation> |