* Delete a timer task with the same timestamp * @pararm o {T*} * @return {int} Return value >= 0 indicates remaining number of timer tasks * with the same timestamp, * returns -1 indicates this timer task does not exist */
| 37 | * returns -1 indicates this timer task does not exist |
| 38 | */ |
| 39 | int del(T* o) { |
| 40 | for (typename std::vector<T*>::iterator it = objs_.begin(); |
| 41 | it != objs_.end(); ++it) { |
| 42 | |
| 43 | if (*it == o) { |
| 44 | objs_.erase(it); |
| 45 | return (int) objs_.size(); |
| 46 | } |
| 47 | } |
| 48 | return -1; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Get all timer task collection with the same timestamp |