Move CameraServer and WPILib headers into their own folder

The old headers were moved into folders because doing so avoids polluting
the system include directories.

Folder names were also normalized to lowercase.
This commit is contained in:
Tyler Veness
2018-07-20 00:03:45 -07:00
committed by Peter Johnson
parent 31ced30c1e
commit d89b7dd412
728 changed files with 1876 additions and 1851 deletions

View File

@@ -1,92 +0,0 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <functional>
#include <wpi/StringMap.h>
#include <wpi/StringRef.h>
#include "Notifier.h"
namespace frc {
/**
* A class that's a wrapper around a watchdog timer.
*
* When the timer expires, a message is printed to the console and an optional
* user-provided callback is invoked.
*
* The watchdog is initialized disabled, so the user needs to call Enable()
* before use.
*/
class Watchdog {
public:
/**
* Watchdog constructor.
*
* @param timeout The watchdog's timeout in seconds.
* @param callback This function is called when the timeout expires.
*/
explicit Watchdog(double timeout, std::function<void()> callback = [] {});
Watchdog(const Watchdog&) = delete;
Watchdog& operator=(const Watchdog&) = delete;
/**
* Get the time in seconds since the watchdog was last fed.
*/
double GetTime() const;
/**
* Returns true if the watchdog timer has expired.
*/
bool IsExpired() const;
/**
* Adds time since last epoch to the list printed by PrintEpochs().
*
* @param epochName The name to associate with the epoch.
*/
void AddEpoch(wpi::StringRef epochName);
/**
* Prints list of epochs added so far and their times.
*/
void PrintEpochs();
/**
* Resets the watchdog timer.
*
* This also enables the timer if it was previously disabled.
*/
void Reset();
/**
* Enables the watchdog timer.
*/
void Enable();
/**
* Disable the watchdog.
*/
void Disable();
private:
double m_timeout;
std::function<void()> m_callback;
Notifier m_notifier;
double m_startTime = 0.0;
wpi::StringMap<double> m_epochs;
bool m_isExpired = false;
void TimeoutFunc();
};
} // namespace frc