WPILibC++  unspecified
Telemetry.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #ifndef CSCORE_TELEMETRY_H_
9 #define CSCORE_TELEMETRY_H_
10 
11 #include <wpi/SafeThread.h>
12 
13 #include "cscore_cpp.h"
14 
15 namespace cs {
16 
17 class SourceImpl;
18 
19 class Telemetry {
20  friend class TelemetryTest;
21 
22  public:
23  static Telemetry& GetInstance() {
24  static Telemetry instance;
25  return instance;
26  }
27  ~Telemetry();
28 
29  void Start();
30  void Stop();
31 
32  // User interface
33  void SetPeriod(double seconds);
34  double GetElapsedTime();
35  int64_t GetValue(CS_Handle handle, CS_TelemetryKind kind, CS_Status* status);
36  double GetAverageValue(CS_Handle handle, CS_TelemetryKind kind,
37  CS_Status* status);
38 
39  // Telemetry events
40  void RecordSourceBytes(const SourceImpl& source, int quantity);
41  void RecordSourceFrames(const SourceImpl& source, int quantity);
42 
43  private:
44  Telemetry();
45 
46  class Thread;
48 };
49 
50 } // namespace cs
51 
52 #endif // CSCORE_TELEMETRY_H_
Definition: CvSourceImpl.h:19
Definition: Telemetry.cpp:22
Definition: Telemetry.h:19
Definition: SourceImpl.h:30