mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
Replace std::stringstream with llvm::raw_svector_ostream (#345)
A few locations were changed to use std::ostringstream.
This commit is contained in:
committed by
Peter Johnson
parent
7006672b06
commit
b433d98c02
@@ -9,7 +9,7 @@
|
||||
|
||||
#define DEFAULT_SAFETY_EXPIRATION 0.1
|
||||
|
||||
#include <sstream>
|
||||
#include "llvm/raw_ostream.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -21,7 +21,7 @@ class MotorSafety {
|
||||
virtual void StopMotor() = 0;
|
||||
virtual void SetSafetyEnabled(bool enabled) = 0;
|
||||
virtual bool IsSafetyEnabled() const = 0;
|
||||
virtual void GetDescription(std::ostringstream& desc) const = 0;
|
||||
virtual void GetDescription(llvm::raw_ostream& desc) const = 0;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "LiveWindow/LiveWindowSendable.h"
|
||||
#include "MotorSafety.h"
|
||||
#include "SensorBase.h"
|
||||
#include "llvm/raw_ostream.h"
|
||||
#include "simulation/SimContinuousOutput.h"
|
||||
#include "tables/ITable.h"
|
||||
#include "tables/ITableListener.h"
|
||||
@@ -55,7 +56,7 @@ class Relay : public MotorSafety,
|
||||
void StopMotor() override;
|
||||
bool IsSafetyEnabled() const override;
|
||||
void SetSafetyEnabled(bool enabled) override;
|
||||
void GetDescription(std::ostringstream& desc) const override;
|
||||
void GetDescription(llvm::raw_ostream& desc) const override;
|
||||
|
||||
void ValueChanged(ITable* source, llvm::StringRef key,
|
||||
std::shared_ptr<nt::Value> value, bool isNew) override;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "ErrorBase.h"
|
||||
#include "MotorSafety.h"
|
||||
#include "MotorSafetyHelper.h"
|
||||
#include "llvm/raw_ostream.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -97,7 +98,7 @@ class RobotDrive : public MotorSafety, public ErrorBase {
|
||||
void StopMotor() override;
|
||||
bool IsSafetyEnabled() const override;
|
||||
void SetSafetyEnabled(bool enabled) override;
|
||||
void GetDescription(std::ostringstream& desc) const override;
|
||||
void GetDescription(llvm::raw_ostream& desc) const override;
|
||||
|
||||
protected:
|
||||
void InitRobotDrive();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "MotorSafety.h"
|
||||
#include "MotorSafetyHelper.h"
|
||||
#include "PWM.h"
|
||||
#include "llvm/raw_ostream.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -34,7 +35,7 @@ class SafePWM : public PWM, public MotorSafety {
|
||||
void StopMotor();
|
||||
bool IsSafetyEnabled() const;
|
||||
void SetSafetyEnabled(bool enabled);
|
||||
void GetDescription(std::ostringstream& desc) const;
|
||||
void GetDescription(llvm::raw_ostream& desc) const;
|
||||
|
||||
virtual void SetSpeed(double speed);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user