Changeset 1486 for code/branches/network/src/core/InputBuffer.cc
- Timestamp:
- May 30, 2008, 3:02:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/core/InputBuffer.cc
r1446 r1486 88 88 } 89 89 90 void InputBuffer::unregisterListener(InputBufferListener* listener)91 {92 for (std::list<InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )93 {94 if ((*it).listener_ == listener)95 this->listeners_.erase(it++);96 else97 ++it;98 }99 }100 101 90 void InputBuffer::set(const std::string& input, bool update) 102 91 { … … 165 154 void InputBuffer::updated() 166 155 { 167 for (std::list< InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)168 { 169 if ((*it) .bListenToAllChanges_)170 (* (*it).listener_.*(*it).function_)();156 for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it) 157 { 158 if ((*it)->bListenToAllChanges_) 159 (*it)->callFunction(); 171 160 } 172 161 } … … 174 163 void InputBuffer::updated(const char& update, bool bSingleInput) 175 164 { 176 for (std::list< InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)177 { 178 if ((!(*it) .trueKeyFalseChar_) && ((*it).bListenToAllChanges_ || ((*it).char_ == update)) && (!(*it).bOnlySingleInput_ || bSingleInput))179 (* (*it).listener_.*(*it).function_)();165 for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it) 166 { 167 if ((!(*it)->trueKeyFalseChar_) && ((*it)->bListenToAllChanges_ || ((*it)->char_ == update)) && (!(*it)->bOnlySingleInput_ || bSingleInput)) 168 (*it)->callFunction(); 180 169 } 181 170 } … … 195 184 return; 196 185 197 for (std::list< InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)198 { 199 if ((*it) .trueKeyFalseChar_ && ((*it).key_ == evt.key))200 (* (*it).listener_.*(*it).function_)();186 for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it) 187 { 188 if ((*it)->trueKeyFalseChar_ && ((*it)->key_ == evt.key)) 189 (*it)->callFunction(); 201 190 } 202 191
Note: See TracChangeset
for help on using the changeset viewer.