WPILibC++ 2022.4.1
wpi::SendableBuilder Class Referenceabstract

#include <wpi/sendable/SendableBuilder.h>

Inheritance diagram for wpi::SendableBuilder:
nt::NTSendableBuilder frc::SendableBuilderImpl

Public Types

enum  BackendKind { kUnknown , kNetworkTables }
 The backend kinds used for the sendable builder. More...
 

Public Member Functions

virtual ~SendableBuilder ()=default
 
virtual void SetSmartDashboardType (std::string_view type)=0
 Set the string representation of the named data type that will be used by the smart dashboard for this sendable. More...
 
virtual void SetActuator (bool value)=0
 Set a flag indicating if this sendable should be treated as an actuator. More...
 
virtual void SetSafeState (std::function< void()> func)=0
 Set the function that should be called to set the Sendable into a safe state. More...
 
virtual void AddBooleanProperty (std::string_view key, std::function< bool()> getter, std::function< void(bool)> setter)=0
 Add a boolean property. More...
 
virtual void AddDoubleProperty (std::string_view key, std::function< double()> getter, std::function< void(double)> setter)=0
 Add a double property. More...
 
virtual void AddStringProperty (std::string_view key, std::function< std::string()> getter, std::function< void(std::string_view)> setter)=0
 Add a string property. More...
 
virtual void AddBooleanArrayProperty (std::string_view key, std::function< std::vector< int >()> getter, std::function< void(wpi::span< const int >)> setter)=0
 Add a boolean array property. More...
 
virtual void AddDoubleArrayProperty (std::string_view key, std::function< std::vector< double >()> getter, std::function< void(wpi::span< const double >)> setter)=0
 Add a double array property. More...
 
virtual void AddStringArrayProperty (std::string_view key, std::function< std::vector< std::string >()> getter, std::function< void(wpi::span< const std::string >)> setter)=0
 Add a string array property. More...
 
virtual void AddRawProperty (std::string_view key, std::function< std::string()> getter, std::function< void(std::string_view)> setter)=0
 Add a raw property. More...
 
virtual void AddSmallStringProperty (std::string_view key, std::function< std::string_view(wpi::SmallVectorImpl< char > &buf)> getter, std::function< void(std::string_view)> setter)=0
 Add a string property (SmallString form). More...
 
virtual void AddSmallBooleanArrayProperty (std::string_view key, std::function< wpi::span< const int >(wpi::SmallVectorImpl< int > &buf)> getter, std::function< void(wpi::span< const int >)> setter)=0
 Add a boolean array property (SmallVector form). More...
 
virtual void AddSmallDoubleArrayProperty (std::string_view key, std::function< wpi::span< const double >(wpi::SmallVectorImpl< double > &buf)> getter, std::function< void(wpi::span< const double >)> setter)=0
 Add a double array property (SmallVector form). More...
 
virtual void AddSmallStringArrayProperty (std::string_view key, std::function< wpi::span< const std::string >(wpi::SmallVectorImpl< std::string > &buf)> getter, std::function< void(wpi::span< const std::string >)> setter)=0
 Add a string array property (SmallVector form). More...
 
virtual void AddSmallRawProperty (std::string_view key, std::function< std::string_view(wpi::SmallVectorImpl< char > &buf)> getter, std::function< void(std::string_view)> setter)=0
 Add a raw property (SmallVector form). More...
 
virtual BackendKind GetBackendKind () const =0
 Gets the kind of backend being used. More...
 
virtual bool IsPublished () const =0
 Return whether this sendable has been published. More...
 
virtual void Update ()=0
 Update the published values by calling the getters for all properties. More...
 
virtual void ClearProperties ()=0
 Clear properties. More...
 

Member Enumeration Documentation

◆ BackendKind

The backend kinds used for the sendable builder.

Enumerator
kUnknown 
kNetworkTables 

Constructor & Destructor Documentation

◆ ~SendableBuilder()

virtual wpi::SendableBuilder::~SendableBuilder ( )
virtualdefault

Member Function Documentation

◆ AddBooleanArrayProperty()

virtual void wpi::SendableBuilder::AddBooleanArrayProperty ( std::string_view  key,
std::function< std::vector< int >()>  getter,
std::function< void(wpi::span< const int >)>  setter 
)
pure virtual

Add a boolean array property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ AddBooleanProperty()

virtual void wpi::SendableBuilder::AddBooleanProperty ( std::string_view  key,
std::function< bool()>  getter,
std::function< void(bool)>  setter 
)
pure virtual

Add a boolean property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

Implemented in frc::SendableBuilderImpl.

◆ AddDoubleArrayProperty()

virtual void wpi::SendableBuilder::AddDoubleArrayProperty ( std::string_view  key,
std::function< std::vector< double >()>  getter,
std::function< void(wpi::span< const double >)>  setter 
)
pure virtual

Add a double array property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ AddDoubleProperty()

virtual void wpi::SendableBuilder::AddDoubleProperty ( std::string_view  key,
std::function< double()>  getter,
std::function< void(double)>  setter 
)
pure virtual

Add a double property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

Implemented in frc::SendableBuilderImpl.

◆ AddRawProperty()

virtual void wpi::SendableBuilder::AddRawProperty ( std::string_view  key,
std::function< std::string()>  getter,
std::function< void(std::string_view)>  setter 
)
pure virtual

Add a raw property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

Implemented in frc::SendableBuilderImpl.

◆ AddSmallBooleanArrayProperty()

virtual void wpi::SendableBuilder::AddSmallBooleanArrayProperty ( std::string_view  key,
std::function< wpi::span< const int >(wpi::SmallVectorImpl< int > &buf)>  getter,
std::function< void(wpi::span< const int >)>  setter 
)
pure virtual

Add a boolean array property (SmallVector form).

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ AddSmallDoubleArrayProperty()

virtual void wpi::SendableBuilder::AddSmallDoubleArrayProperty ( std::string_view  key,
std::function< wpi::span< const double >(wpi::SmallVectorImpl< double > &buf)>  getter,
std::function< void(wpi::span< const double >)>  setter 
)
pure virtual

Add a double array property (SmallVector form).

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ AddSmallRawProperty()

virtual void wpi::SendableBuilder::AddSmallRawProperty ( std::string_view  key,
std::function< std::string_view(wpi::SmallVectorImpl< char > &buf)>  getter,
std::function< void(std::string_view)>  setter 
)
pure virtual

Add a raw property (SmallVector form).

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ AddSmallStringArrayProperty()

virtual void wpi::SendableBuilder::AddSmallStringArrayProperty ( std::string_view  key,
std::function< wpi::span< const std::string >(wpi::SmallVectorImpl< std::string > &buf)>  getter,
std::function< void(wpi::span< const std::string >)>  setter 
)
pure virtual

Add a string array property (SmallVector form).

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ AddSmallStringProperty()

virtual void wpi::SendableBuilder::AddSmallStringProperty ( std::string_view  key,
std::function< std::string_view(wpi::SmallVectorImpl< char > &buf)>  getter,
std::function< void(std::string_view)>  setter 
)
pure virtual

Add a string property (SmallString form).

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ AddStringArrayProperty()

virtual void wpi::SendableBuilder::AddStringArrayProperty ( std::string_view  key,
std::function< std::vector< std::string >()>  getter,
std::function< void(wpi::span< const std::string >)>  setter 
)
pure virtual

Add a string array property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ AddStringProperty()

virtual void wpi::SendableBuilder::AddStringProperty ( std::string_view  key,
std::function< std::string()>  getter,
std::function< void(std::string_view)>  setter 
)
pure virtual

Add a string property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

Implemented in frc::SendableBuilderImpl.

◆ ClearProperties()

virtual void wpi::SendableBuilder::ClearProperties ( )
pure virtual

Clear properties.

Implemented in frc::SendableBuilderImpl.

◆ GetBackendKind()

virtual BackendKind wpi::SendableBuilder::GetBackendKind ( ) const
pure virtual

Gets the kind of backend being used.

Returns
Backend kind

Implemented in nt::NTSendableBuilder.

◆ IsPublished()

virtual bool wpi::SendableBuilder::IsPublished ( ) const
pure virtual

Return whether this sendable has been published.

Returns
True if it has been published, false if not.

Implemented in frc::SendableBuilderImpl.

◆ SetActuator()

virtual void wpi::SendableBuilder::SetActuator ( bool  value)
pure virtual

Set a flag indicating if this sendable should be treated as an actuator.

By default this flag is false.

Parameters
valuetrue if actuator, false if not

Implemented in frc::SendableBuilderImpl.

◆ SetSafeState()

virtual void wpi::SendableBuilder::SetSafeState ( std::function< void()>  func)
pure virtual

Set the function that should be called to set the Sendable into a safe state.

This is called when entering and exiting Live Window mode.

Parameters
funcfunction

Implemented in frc::SendableBuilderImpl.

◆ SetSmartDashboardType()

virtual void wpi::SendableBuilder::SetSmartDashboardType ( std::string_view  type)
pure virtual

Set the string representation of the named data type that will be used by the smart dashboard for this sendable.

Parameters
typedata type

Implemented in frc::SendableBuilderImpl.

◆ Update()

virtual void wpi::SendableBuilder::Update ( )
pure virtual

Update the published values by calling the getters for all properties.

Implemented in frc::SendableBuilderImpl.


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