WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
frc::SendableBuilderImpl Class Reference
Inheritance diagram for frc::SendableBuilderImpl:
frc::SendableBuilder

Public Member Functions

 SendableBuilderImpl (SendableBuilderImpl &&)=default
 
SendableBuilderImploperator= (SendableBuilderImpl &&)=default
 
void SetTable (std::shared_ptr< nt::NetworkTable > table)
 Set the network table. More...
 
std::shared_ptr< nt::NetworkTableGetTable ()
 Get the network table. More...
 
bool IsActuator () const
 Return whether this sendable should be treated as an actuator. More...
 
void UpdateTable ()
 Update the network table values by calling the getters for all properties.
 
void StartListeners ()
 Hook setters for all properties.
 
void StopListeners ()
 Unhook setters for all properties.
 
void StartLiveWindowMode ()
 Start LiveWindow mode by hooking the setters for all properties. More...
 
void StopLiveWindowMode ()
 Stop LiveWindow mode by unhooking the setters for all properties. More...
 
void SetSmartDashboardType (const wpi::Twine &type) override
 Set the string representation of the named data type that will be used by the smart dashboard for this sendable. More...
 
void SetActuator (bool value) override
 Set a flag indicating if this sendable should be treated as an actuator. More...
 
void SetSafeState (std::function< void()> func) override
 Set the function that should be called to set the Sendable into a safe state. More...
 
void SetUpdateTable (std::function< void()> func) override
 Set the function that should be called to update the network table for things other than properties. More...
 
nt::NetworkTableEntry GetEntry (const wpi::Twine &key) override
 Add a property without getters or setters. More...
 
void AddBooleanProperty (const wpi::Twine &key, std::function< bool()> getter, std::function< void(bool)> setter) override
 Add a boolean property. More...
 
void AddDoubleProperty (const wpi::Twine &key, std::function< double()> getter, std::function< void(double)> setter) override
 Add a double property. More...
 
void AddStringProperty (const wpi::Twine &key, std::function< std::string()> getter, std::function< void(wpi::StringRef)> setter) override
 Add a string property. More...
 
void AddBooleanArrayProperty (const wpi::Twine &key, std::function< std::vector< int >()> getter, std::function< void(wpi::ArrayRef< int >)> setter) override
 Add a boolean array property. More...
 
void AddDoubleArrayProperty (const wpi::Twine &key, std::function< std::vector< double >()> getter, std::function< void(wpi::ArrayRef< double >)> setter) override
 Add a double array property. More...
 
void AddStringArrayProperty (const wpi::Twine &key, std::function< std::vector< std::string >()> getter, std::function< void(wpi::ArrayRef< std::string >)> setter) override
 Add a string array property. More...
 
void AddRawProperty (const wpi::Twine &key, std::function< std::string()> getter, std::function< void(wpi::StringRef)> setter) override
 Add a raw property. More...
 
void AddValueProperty (const wpi::Twine &key, std::function< std::shared_ptr< nt::Value >()> getter, std::function< void(std::shared_ptr< nt::Value >)> setter) override
 Add a NetworkTableValue property. More...
 
void AddSmallStringProperty (const wpi::Twine &key, std::function< wpi::StringRef(wpi::SmallVectorImpl< char > &buf)> getter, std::function< void(wpi::StringRef)> setter) override
 Add a string property (SmallString form). More...
 
void AddSmallBooleanArrayProperty (const wpi::Twine &key, std::function< wpi::ArrayRef< int >(wpi::SmallVectorImpl< int > &buf)> getter, std::function< void(wpi::ArrayRef< int >)> setter) override
 Add a boolean array property (SmallVector form). More...
 
void AddSmallDoubleArrayProperty (const wpi::Twine &key, std::function< wpi::ArrayRef< double >(wpi::SmallVectorImpl< double > &buf)> getter, std::function< void(wpi::ArrayRef< double >)> setter) override
 Add a double array property (SmallVector form). More...
 
void AddSmallStringArrayProperty (const wpi::Twine &key, std::function< wpi::ArrayRef< std::string >(wpi::SmallVectorImpl< std::string > &buf)> getter, std::function< void(wpi::ArrayRef< std::string >)> setter) override
 Add a string array property (SmallVector form). More...
 
void AddSmallRawProperty (const wpi::Twine &key, std::function< wpi::StringRef(wpi::SmallVectorImpl< char > &buf)> getter, std::function< void(wpi::StringRef)> setter) override
 Add a raw property (SmallVector form). More...
 

Member Function Documentation

void frc::SendableBuilderImpl::AddBooleanArrayProperty ( const wpi::Twine key,
std::function< std::vector< int >()>  getter,
std::function< void(wpi::ArrayRef< int >)>  setter 
)
overridevirtual

Add a boolean array property.

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddBooleanProperty ( const wpi::Twine key,
std::function< bool()>  getter,
std::function< void(bool)>  setter 
)
overridevirtual

Add a boolean property.

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddDoubleArrayProperty ( const wpi::Twine key,
std::function< std::vector< double >()>  getter,
std::function< void(wpi::ArrayRef< double >)>  setter 
)
overridevirtual

Add a double array property.

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddDoubleProperty ( const wpi::Twine key,
std::function< double()>  getter,
std::function< void(double)>  setter 
)
overridevirtual

Add a double property.

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddRawProperty ( const wpi::Twine key,
std::function< std::string()>  getter,
std::function< void(wpi::StringRef)>  setter 
)
overridevirtual

Add a raw property.

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddSmallBooleanArrayProperty ( const wpi::Twine key,
std::function< wpi::ArrayRef< int >(wpi::SmallVectorImpl< int > &buf)>  getter,
std::function< void(wpi::ArrayRef< int >)>  setter 
)
overridevirtual

Add a boolean array property (SmallVector form).

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddSmallDoubleArrayProperty ( const wpi::Twine key,
std::function< wpi::ArrayRef< double >(wpi::SmallVectorImpl< double > &buf)>  getter,
std::function< void(wpi::ArrayRef< double >)>  setter 
)
overridevirtual

Add a double array property (SmallVector form).

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddSmallRawProperty ( const wpi::Twine key,
std::function< wpi::StringRef(wpi::SmallVectorImpl< char > &buf)>  getter,
std::function< void(wpi::StringRef)>  setter 
)
overridevirtual

Add a raw property (SmallVector form).

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddSmallStringArrayProperty ( const wpi::Twine key,
std::function< wpi::ArrayRef< std::string >(wpi::SmallVectorImpl< std::string > &buf)>  getter,
std::function< void(wpi::ArrayRef< std::string >)>  setter 
)
overridevirtual

Add a string array property (SmallVector form).

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddSmallStringProperty ( const wpi::Twine key,
std::function< wpi::StringRef(wpi::SmallVectorImpl< char > &buf)>  getter,
std::function< void(wpi::StringRef)>  setter 
)
overridevirtual

Add a string property (SmallString form).

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddStringArrayProperty ( const wpi::Twine key,
std::function< std::vector< std::string >()>  getter,
std::function< void(wpi::ArrayRef< std::string >)>  setter 
)
overridevirtual

Add a string array property.

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddStringProperty ( const wpi::Twine key,
std::function< std::string()>  getter,
std::function< void(wpi::StringRef)>  setter 
)
overridevirtual

Add a string property.

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::AddValueProperty ( const wpi::Twine key,
std::function< std::shared_ptr< nt::Value >()>  getter,
std::function< void(std::shared_ptr< nt::Value >)>  setter 
)
overridevirtual

Add a NetworkTableValue property.

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

Implements frc::SendableBuilder.

nt::NetworkTableEntry frc::SendableBuilderImpl::GetEntry ( const wpi::Twine key)
overridevirtual

Add a property without getters or setters.

This can be used to get entry handles for the function called by SetUpdateTable().

Parameters
keyproperty name
Returns
Network table entry

Implements frc::SendableBuilder.

std::shared_ptr<nt::NetworkTable> frc::SendableBuilderImpl::GetTable ( )

Get the network table.

Returns
The network table
bool frc::SendableBuilderImpl::IsActuator ( ) const

Return whether this sendable should be treated as an actuator.

Returns
True if actuator, false if not.
void frc::SendableBuilderImpl::SetActuator ( bool  value)
overridevirtual

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::SetSafeState ( std::function< void()>  func)
overridevirtual

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

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::SetSmartDashboardType ( const wpi::Twine type)
overridevirtual

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

Parameters
typedata type

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::SetTable ( std::shared_ptr< nt::NetworkTable table)

Set the network table.

Must be called prior to any Add* functions being called.

Parameters
tableNetwork table
void frc::SendableBuilderImpl::SetUpdateTable ( std::function< void()>  func)
overridevirtual

Set the function that should be called to update the network table for things other than properties.

Note this function is not passed the network table object; instead it should use the entry handles returned by GetEntry().

Parameters
funcfunction

Implements frc::SendableBuilder.

void frc::SendableBuilderImpl::StartLiveWindowMode ( )

Start LiveWindow mode by hooking the setters for all properties.

Also calls the SafeState function if one was provided.

void frc::SendableBuilderImpl::StopLiveWindowMode ( )

Stop LiveWindow mode by unhooking the setters for all properties.

Also calls the SafeState function if one was provided.


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