LCOV - code coverage report
Current view: top level - src/foreign/RoutingKit/include/routingkit - timestamp_flag.h (source / functions) Coverage Total Hit
Test: lcov.info Lines: 0.0 % 9 0
Test Date: 2026-09-23 15:43:02 Functions: - 0 0

            Line data    Source code
       1              : #ifndef ROUTING_KIT_TIMESTAMP_FLAG_H
       2              : #define ROUTING_KIT_TIMESTAMP_FLAG_H
       3              : 
       4              : #include <vector>
       5              : 
       6              : namespace RoutingKit{
       7              : 
       8            0 : class TimestampFlags{
       9              : public:
      10              :         TimestampFlags(){}
      11              : 
      12            0 :         explicit TimestampFlags(unsigned id_count):last_seen(id_count, 0), current_timestamp(1){}
      13              : 
      14              :         bool is_set(unsigned id)const{
      15            0 :                 return last_seen[id] == current_timestamp;
      16              :         }
      17              :         
      18              :         void set(unsigned id){
      19            0 :                 last_seen[id] = current_timestamp;
      20              :         }
      21              : 
      22              :         void reset_one(unsigned id){
      23            0 :                 last_seen[id] = current_timestamp-1;
      24            0 :         }
      25              : 
      26              :         void reset_all(){
      27            0 :                 ++current_timestamp;
      28            0 :                 if(current_timestamp == 0){
      29              :                         std::fill(last_seen.begin(), last_seen.end(), 0);
      30            0 :                         current_timestamp = 1;
      31              :                 }
      32              :         }
      33              : 
      34              : private:
      35              :         std::vector<unsigned short>last_seen;
      36              :         unsigned short current_timestamp;
      37              : };
      38              : 
      39              : } // RoutingKit
      40              : 
      41              : #endif
      42              : 
        

Generated by: LCOV version 2.0-1