32 std::map<std::string, std::string> values{};
44 values[
"name"] = std::move(name);
58 const std::map<std::string, std::string> &
GetNameValues()
const {
return values; }
67 virtual ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash,
bool cancelOtherRequests, std::shared_ptr<ControlRequest> &req) = 0;
116 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash,
bool cancelOtherRequests, std::shared_ptr<ControlRequest> &req)
120 (void)cancelOtherRequests;
122 if (req.get() !=
this)
124 auto const reqCast =
dynamic_cast<EmptyControl *
>(req.get());
125 if (reqCast !=
nullptr)
131 req = std::make_shared<EmptyControl>(*
this);
148 std::stringstream ss;
149 ss <<
"class: EmptyControl" << std::endl;
Information about a control request.
Definition: ControlRequest.hpp:31
ControlInfo(std::string name)
Constructs a new ControlInfo object for the control request of the given name.
Definition: ControlRequest.hpp:42
std::map< std::string, std::string > & GetNameValues()
Gets the map of control parameter names to the corresponding applied value.
Definition: ControlRequest.hpp:52
const std::map< std::string, std::string > & GetNameValues() const
Gets the map of control parameter names to the corresponding applied value.
Definition: ControlRequest.hpp:58
Abstract Control Request class that other control requests extend for use.
Definition: ControlRequest.hpp:65
ControlRequest & operator=(ControlRequest &&)=default
ControlInfo requestReference
Definition: ControlRequest.hpp:70
ControlRequest & operator=(ControlRequest const &)=default
ControlInfo & GetControlInfo()
Gets information about this control request.
Definition: ControlRequest.hpp:93
ControlRequest(ControlRequest const &)=default
ControlRequest(ControlRequest &&)=default
virtual std::string ToString() const =0
const ControlInfo & GetControlInfo() const
Gets information about this control request.
Definition: ControlRequest.hpp:102
virtual ~ControlRequest()=default
ControlRequest(std::string name)
Constructs a new Control Request with the given name.
Definition: ControlRequest.hpp:84
Generic Empty Control class used to do nothing.
Definition: ControlRequest.hpp:115
std::string ToString() const
Definition: ControlRequest.hpp:146
EmptyControl()
Constructs an empty control request.
Definition: ControlRequest.hpp:142
Parent class for all devices.
Definition: ParentDevice.hpp:30
Definition: string_util.hpp:14