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
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
std::map< std::string, std::string > & GetNameValues()
Gets the map of control parameter names to the corresponding applied value.
Definition: ControlRequest.hpp:52
Abstract Control Request class that other control requests extend for use.
Definition: ControlRequest.hpp:65
ControlRequest(ControlRequest const &)=default
const ControlInfo & GetControlInfo() const
Gets information about this control request.
Definition: ControlRequest.hpp:102
ControlRequest & operator=(ControlRequest &&)=default
ControlRequest(std::string name)
Constructs a new Control Request with the given name.
Definition: ControlRequest.hpp:84
ControlRequest(ControlRequest &&)=default
ControlInfo & GetControlInfo()
Gets information about this control request.
Definition: ControlRequest.hpp:93
virtual std::string ToString() const =0
ControlInfo requestReference
Definition: ControlRequest.hpp:70
virtual ~ControlRequest()=default
ControlRequest & operator=(ControlRequest const &)=default
Generic Empty Control class used to do nothing.
Definition: ControlRequest.hpp:115
EmptyControl()
Constructs an empty control request.
Definition: ControlRequest.hpp:142
std::string ToString() const
Definition: ControlRequest.hpp:146
Parent class for all devices.
Definition: ParentDevice.hpp:30
Definition: string_util.hpp:14