counter.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CARTOGRAPHER_METRICS_COUNTER_H_
18 #define CARTOGRAPHER_METRICS_COUNTER_H_
19 
20 #include <map>
21 #include <vector>
22 
23 namespace cartographer {
24 namespace metrics {
25 
26 class Counter {
27  public:
28  // Counter instance that does nothing. Safe for use in static initializers.
29  static Counter* Null();
30 
31  virtual ~Counter() = default;
32  virtual void Increment() = 0;
33  virtual void Increment(double by_value) = 0;
34 };
35 
36 } // namespace metrics
37 } // namespace cartographer
38 
39 #endif // CARTOGRAPHER_METRICS_COUNTER_H_
static Counter * Null()
Definition: counter.cc:33


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:58