10#include <units/frequency.h>
31 virtual ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const = 0;
73 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const override
75 if (req.get() !=
this)
77 auto const reqCast =
dynamic_cast<EmptyControl *
>(req.get());
78 if (reqCast !=
nullptr)
84 req = std::make_shared<EmptyControl>(*
this);
106 std::map<std::string, std::string> controlInfo;
107 controlInfo[
"Name"] =
GetName();
113 std::stringstream ss;
114 ss <<
"class: EmptyControl" << std::endl;
CTREXPORT int c_ctre_phoenix6_RequestControlEmpty(const char *canbus, uint32_t ecuEncoding, double updateTime)
Abstract Control Request class that other control requests extend for use.
Definition ControlRequest.hpp:29
ControlRequest & operator=(ControlRequest &&)=default
ControlRequest & operator=(ControlRequest const &)=default
std::string name
Definition ControlRequest.hpp:34
std::string const & GetName() const
Definition ControlRequest.hpp:52
ControlRequest(ControlRequest const &)=default
virtual std::map< std::string, std::string > GetControlInfo() const =0
Gets information about this control request.
ControlRequest(ControlRequest &&)=default
virtual std::string ToString() const =0
virtual ~ControlRequest()=default
ControlRequest(std::string name)
Constructs a new Control Request with the given name.
Definition ControlRequest.hpp:48
Generic Empty Control class used to do nothing.
Definition ControlRequest.hpp:72
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
Definition ControlRequest.hpp:104
EmptyControl & WithUpdateFreqHz(units::frequency::hertz_t)
Definition ControlRequest.hpp:118
EmptyControl()
Constructs an empty control request.
Definition ControlRequest.hpp:95
std::string ToString() const override
Definition ControlRequest.hpp:111
Parent class for all devices.
Definition ParentDevice.hpp:29
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
Definition StatusCodes.h:18