Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
timestamp_flag.h
Go to the documentation of this file.
1#ifndef ROUTING_KIT_TIMESTAMP_FLAG_H
2#define ROUTING_KIT_TIMESTAMP_FLAG_H
3
4#include <vector>
5
6namespace RoutingKit{
7
9public:
11
12 explicit TimestampFlags(unsigned id_count):last_seen(id_count, 0), current_timestamp(1){}
13
14 bool is_set(unsigned id)const{
15 return last_seen[id] == current_timestamp;
16 }
17
18 void set(unsigned id){
20 }
21
22 void reset_one(unsigned id){
24 }
25
26 void reset_all(){
28 if(current_timestamp == 0){
29 std::fill(last_seen.begin(), last_seen.end(), 0);
31 }
32 }
33
34private:
35 std::vector<unsigned short>last_seen;
36 unsigned short current_timestamp;
37};
38
39} // RoutingKit
40
41#endif
42
void reset_one(unsigned id)
TimestampFlags(unsigned id_count)
std::vector< unsigned short > last_seen
unsigned short current_timestamp
bool is_set(unsigned id) const