- Timestamp:
- Nov 21, 2015, 7:05:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc
r9667 r10821 110 110 void InputBuffer::insert(const std::string& input, bool update) 111 111 { 112 for ( unsigned int i = 0; i < input.size(); ++i)113 { 114 this->insert( input[i], false);112 for (auto & elem : input) 113 { 114 this->insert(elem, false); 115 115 116 116 if (update) 117 this->updated( input[i], false);117 this->updated(elem, false); 118 118 } 119 119 … … 170 170 void InputBuffer::updated() 171 171 { 172 for ( std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)173 { 174 if (( *it)->bListenToAllChanges_)175 ( *it)->callFunction();172 for (auto & elem : this->listeners_) 173 { 174 if ((elem)->bListenToAllChanges_) 175 (elem)->callFunction(); 176 176 } 177 177 } … … 179 179 void InputBuffer::updated(const char& update, bool bSingleInput) 180 180 { 181 for ( std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)182 { 183 if ((!( *it)->trueKeyFalseChar_) && ((*it)->bListenToAllChanges_ || ((*it)->char_ == update)) && (!(*it)->bOnlySingleInput_ || bSingleInput))184 ( *it)->callFunction();181 for (auto & elem : this->listeners_) 182 { 183 if ((!(elem)->trueKeyFalseChar_) && ((elem)->bListenToAllChanges_ || ((elem)->char_ == update)) && (!(elem)->bOnlySingleInput_ || bSingleInput)) 184 (elem)->callFunction(); 185 185 } 186 186 } … … 201 201 return; 202 202 203 for ( std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)204 { 205 if (( *it)->trueKeyFalseChar_ && ((*it)->key_ == evt.getKeyCode()))206 ( *it)->callFunction();203 for (auto & elem : this->listeners_) 204 { 205 if ((elem)->trueKeyFalseChar_ && ((elem)->key_ == evt.getKeyCode())) 206 (elem)->callFunction(); 207 207 } 208 208
Note: See TracChangeset
for help on using the changeset viewer.