mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
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:
committed by
Peter Johnson
parent
31ced30c1e
commit
d89b7dd412
@@ -0,0 +1,78 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2017-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 <memory>
|
||||
#include <string>
|
||||
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
#include "frc/smartdashboard/Sendable.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class SendableBase : public Sendable {
|
||||
public:
|
||||
/**
|
||||
* Creates an instance of the sensor base.
|
||||
*
|
||||
* @param addLiveWindow if true, add this Sendable to LiveWindow
|
||||
*/
|
||||
explicit SendableBase(bool addLiveWindow = true);
|
||||
|
||||
~SendableBase() override;
|
||||
|
||||
using Sendable::SetName;
|
||||
|
||||
std::string GetName() const final;
|
||||
void SetName(const wpi::Twine& name) final;
|
||||
std::string GetSubsystem() const final;
|
||||
void SetSubsystem(const wpi::Twine& subsystem) final;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Add a child component.
|
||||
*
|
||||
* @param child child component
|
||||
*/
|
||||
void AddChild(std::shared_ptr<Sendable> child);
|
||||
|
||||
/**
|
||||
* Add a child component.
|
||||
*
|
||||
* @param child child component
|
||||
*/
|
||||
void AddChild(void* child);
|
||||
|
||||
/**
|
||||
* Sets the name of the sensor with a channel number.
|
||||
*
|
||||
* @param moduleType A string that defines the module name in the label for
|
||||
* the value
|
||||
* @param channel The channel number the device is plugged into
|
||||
*/
|
||||
void SetName(const wpi::Twine& moduleType, int channel);
|
||||
|
||||
/**
|
||||
* Sets the name of the sensor with a module and channel number.
|
||||
*
|
||||
* @param moduleType A string that defines the module name in the label for
|
||||
* the value
|
||||
* @param moduleNumber The number of the particular module type
|
||||
* @param channel The channel number the device is plugged into (usually
|
||||
* PWM)
|
||||
*/
|
||||
void SetName(const wpi::Twine& moduleType, int moduleNumber, int channel);
|
||||
|
||||
private:
|
||||
mutable wpi::mutex m_mutex;
|
||||
std::string m_name;
|
||||
std::string m_subsystem = "Ungrouped";
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
Reference in New Issue
Block a user