WPILibC++  2019.1.1-4-g308bdbe
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
CounterBase.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-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 #pragma once
9 
10 namespace frc {
11 
21 class CounterBase {
22  public:
23  enum EncodingType { k1X, k2X, k4X };
24 
25  CounterBase() = default;
26  virtual ~CounterBase() = default;
27 
28  CounterBase(CounterBase&&) = default;
29  CounterBase& operator=(CounterBase&&) = default;
30 
31  virtual int Get() const = 0;
32  virtual void Reset() = 0;
33  virtual double GetPeriod() const = 0;
34  virtual void SetMaxPeriod(double maxPeriod) = 0;
35  virtual bool GetStopped() const = 0;
36  virtual bool GetDirection() const = 0;
37 };
38 
39 } // namespace frc
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Interface for counting the number of ticks on a digital input channel.
Definition: CounterBase.h:21