KunalTyagi

tracker pseudoCode

Mar 17th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. bool Tracker<T>::CONFIRMING
  2. {
  3.     if (skipTracking)
  4.     {
  5.         _current = supplied;
  6.         return true;
  7.     }
  8.     else
  9.     {
  10.         _findTrackedObj();
  11.     }
  12.  
  13.     // if no object tracked, continue previous, and decrement the counter
  14.     if (_equalityFunctor(_current, _empty))
  15.     {
  16.         // @TODO: debug
  17.         _current = _prev;
  18.         --_objectTrackCount;
  19.         _checkObjCountBounds();
  20.         return false;
  21.     }
  22.     else
  23.     {
  24.         ++_objectTrackCount;  // no bound check required
  25.         _previous = _current;
  26.     }
  27.     return true;
  28. }
  29.  
  30. template <class T>
  31. bool Tracker<T>::TRACKING
  32. {
  33.     _findTrackedObj(isWindowDynamic);
  34.     if (_equalityFunctor(_current, _empty))
  35.     {
  36.         _current = _prev;
  37.         --_objectTrackCount;  // no bound check required
  38.         return false;
  39.     }
  40.     else
  41.     {
  42.         _previous = _current;
  43.         ++_objectTrackCount;
  44.         _checkObjCountBounds();
  45.         if (_history.size() >= bufferLength)
  46.         {
  47.             _history.pop();
  48.         }
  49.         _history.push(_current.getPoint());
  50.     }
  51.     return true;
  52. }
Add Comment
Please, Sign In to add comment