Changeset 239987d for molecuilder/src/Patterns/Observer.cpp
- Timestamp:
- Mar 19, 2010, 4:44:08 PM (16 years ago)
- Children:
- c8d1952
- Parents:
- 9f3025
- git-author:
- Tillmann Crueger <crueger@…> (03/19/10 16:13:28)
- git-committer:
- Tillmann Crueger <crueger@…> (03/19/10 16:44:08)
- File:
-
- 1 edited
-
molecuilder/src/Patterns/Observer.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/Patterns/Observer.cpp
r9f3025 r239987d 10 10 11 11 #include <iostream> 12 #include <cassert> 12 13 #include "Helpers/Assert.hpp" 13 14 14 15 using namespace std; … … 127 128 // observers, but still we are called by one of our sub-Observables 128 129 // we cannot be sure observation will still work at this point 129 cerr << "Circle detected in observation-graph." << endl;130 cerr << "Observation-graph always needs to be a DAG to work correctly!" << endl;131 cerr << "Please check your observation code and fix this!" << endl;130 ASSERT(0,"Circle detected in observation-graph.\n" 131 "Observation-graph always needs to be a DAG to work correctly!\n" 132 "Please check your observation code and fix this!\n"); 132 133 return; 133 134 } … … 148 149 */ 149 150 void Observable::signOn(Observer *target,int priority) { 150 assert(priority>=-20 && priority<=+20 && "Priority out of range [-20:+20]");151 ASSERT(priority>=-20 && priority<=+20, "Priority out of range [-20:+20] when signing on Observer"); 151 152 bool res = false; 152 153 callees_t *callees = 0; … … 172 173 */ 173 174 void Observable::signOff(Observer *target) { 174 assert(callTable.count(this) &&"SignOff called for an Observable without Observers.");175 ASSERT(callTable.count(this),"SignOff called for an Observable without Observers."); 175 176 callees_t *callees = callTable[this]; 176 177 callees_t::iterator iter; … … 188 189 delete callees; 189 190 } 191 } 192 193 bool Observable::isBlocked(){ 194 return depth.count(this) > 0; 190 195 } 191 196
Note:
See TracChangeset
for help on using the changeset viewer.
