WPILibC++  2020.3.2-60-g3011ebe
frc::SendableHelper< Derived > Class Template Reference

A helper class for use with objects that add themselves to SendableRegistry. More...

#include <SendableHelper.h>

Public Member Functions

 SendableHelper (const SendableHelper &rhs)=default
 
SendableHelperoperator= (const SendableHelper &rhs)=default
 
 SendableHelper (SendableHelper &&rhs)
 
SendableHelperoperator= (SendableHelper &&rhs)
 
std::string GetName () const
 Gets the name of this Sendable object. More...
 
void SetName (const wpi::Twine &name)
 Sets the name of this Sendable object. More...
 
void SetName (const wpi::Twine &subsystem, const wpi::Twine &name)
 Sets both the subsystem name and device name of this Sendable object. More...
 
std::string GetSubsystem () const
 Gets the subsystem name of this Sendable object. More...
 
void SetSubsystem (const wpi::Twine &subsystem)
 Sets the subsystem name of this Sendable object. More...
 

Protected Member Functions

void AddChild (std::shared_ptr< Sendable > child)
 Add a child component. More...
 
void AddChild (void *child)
 Add a child component. More...
 
void SetName (const wpi::Twine &moduleType, int channel)
 Sets the name of the sensor with a channel number. More...
 
void SetName (const wpi::Twine &moduleType, int moduleNumber, int channel)
 Sets the name of the sensor with a module and channel number. More...
 

Detailed Description

template<typename Derived>
class frc::SendableHelper< Derived >

A helper class for use with objects that add themselves to SendableRegistry.

It takes care of properly calling Move() and Remove() on move and destruction. No action is taken if the object is copied. Use public inheritance with CRTP when using this class.

Template Parameters
CRTPderived class

Member Function Documentation

◆ AddChild() [1/2]

template<typename Derived>
void frc::SendableHelper< Derived >::AddChild ( std::shared_ptr< Sendable child)
inlineprotected

Add a child component.

Deprecated:
use SendableRegistry::AddChild()
Parameters
childchild component

◆ AddChild() [2/2]

template<typename Derived>
void frc::SendableHelper< Derived >::AddChild ( void *  child)
inlineprotected

Add a child component.

Deprecated:
use SendableRegistry::AddChild()
Parameters
childchild component

◆ GetName()

template<typename Derived>
std::string frc::SendableHelper< Derived >::GetName ( ) const
inline

Gets the name of this Sendable object.

Deprecated:
use SendableRegistry::GetName()
Returns
Name

◆ GetSubsystem()

template<typename Derived>
std::string frc::SendableHelper< Derived >::GetSubsystem ( ) const
inline

Gets the subsystem name of this Sendable object.

Deprecated:
use SendableRegistry::GetSubsystem().
Returns
Subsystem name

◆ SetName() [1/4]

template<typename Derived>
void frc::SendableHelper< Derived >::SetName ( const wpi::Twine moduleType,
int  channel 
)
inlineprotected

Sets the name of the sensor with a channel number.

Deprecated:
use SendableRegistry::SetName()
Parameters
moduleTypeA string that defines the module name in the label for the value
channelThe channel number the device is plugged into

◆ SetName() [2/4]

template<typename Derived>
void frc::SendableHelper< Derived >::SetName ( const wpi::Twine moduleType,
int  moduleNumber,
int  channel 
)
inlineprotected

Sets the name of the sensor with a module and channel number.

Deprecated:
use SendableRegistry::SetName()
Parameters
moduleTypeA string that defines the module name in the label for the value
moduleNumberThe number of the particular module type
channelThe channel number the device is plugged into (usually PWM)

◆ SetName() [3/4]

template<typename Derived>
void frc::SendableHelper< Derived >::SetName ( const wpi::Twine name)
inline

Sets the name of this Sendable object.

Deprecated:
use SendableRegistry::SetName()
Parameters
namename

◆ SetName() [4/4]

template<typename Derived>
void frc::SendableHelper< Derived >::SetName ( const wpi::Twine subsystem,
const wpi::Twine name 
)
inline

Sets both the subsystem name and device name of this Sendable object.

Deprecated:
use SendableRegistry::SetName()
Parameters
subsystemsubsystem name
namedevice name

◆ SetSubsystem()

template<typename Derived>
void frc::SendableHelper< Derived >::SetSubsystem ( const wpi::Twine subsystem)
inline

Sets the subsystem name of this Sendable object.

Deprecated:
use SendableRegistry::SetSubsystem()
Parameters
subsystemsubsystem name

The documentation for this class was generated from the following file: