13 #include <networktables/NetworkTable.h>
14 #include <wpi/STLExtras.h>
15 #include <wpi/Twine.h>
20 class SendableBuilderImpl;
199 int moduleNumber,
int channel);
243 std::shared_ptr<void> data);
291 void Publish(UID sendableUid, std::shared_ptr<NetworkTable> table);
298 void Update(UID sendableUid);
307 : sendable(sendable_),
309 subsystem(subsystem_),
318 std::shared_ptr<void>& data;
338 std::unique_ptr<Impl> m_impl;
std::shared_ptr< void > SetData(Sendable *sendable, int handle, std::shared_ptr< void > data)
Associates arbitrary data with an object in the registry.
The SendableRegistry class is the public interface for registering sensors and actuators for use on d...
Definition: SendableRegistry.h:26
Definition: SendableBuilderImpl.h:27
std::string GetSubsystem(const Sendable *sendable) const
Gets the subsystem name of an object.
Data passed to ForeachLiveWindow() callback function.
Definition: SendableRegistry.h:303
void Update(UID sendableUid)
Updates network table information from an object.
std::string GetName(const Sendable *sendable) const
Gets the name of an object.
std::shared_ptr< void > GetData(Sendable *sendable, int handle)
Gets arbitrary data associated with an object in the registry.
void Move(Sendable *to, Sendable *from)
Moves an object in the registry (for use in move constructors/assignments).
void ForeachLiveWindow(int dataHandle, wpi::function_ref< void(CallbackData &cbdata)> callback) const
Iterates over LiveWindow-enabled objects in the registry.
static SendableRegistry & GetInstance()
Gets an instance of the SendableRegistry class.
UID GetUniqueId(Sendable *sendable)
Get unique id for an object.
void EnableLiveWindow(Sendable *sendable)
Enables LiveWindow for an object.
void SetSubsystem(Sendable *sendable, const wpi::Twine &subsystem)
Sets the subsystem name of an object.
void Add(Sendable *sendable, const wpi::Twine &name)
Adds an object to the registry.
int GetDataHandle()
Gets a unique handle for setting/getting data with SetData() and GetData().
void DisableLiveWindow(Sendable *sendable)
Disables LiveWindow for an object.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
Sendable * GetSendable(UID uid)
Get sendable object for a given unique id.
void Publish(UID sendableUid, std::shared_ptr< NetworkTable > table)
Publishes an object in the registry to a network table.
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLExtras.h:103
Interface for Sendable objects.
Definition: Sendable.h:17
bool Contains(const Sendable *sendable) const
Determines if an object is in the registry.
A class that enforces constraints on the differential drive kinematics.
Definition: SPIAccelerometerSim.h:16
void SetName(Sendable *sendable, const wpi::Twine &name)
Sets the name of an object.
bool Remove(Sendable *sendable)
Removes an object from the registry.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:85
void AddLW(Sendable *sendable, const wpi::Twine &name)
Adds an object to the registry and LiveWindow.
void AddChild(Sendable *parent, Sendable *child)
Adds a child object to an object.