WPILibC++ 2023.4.3-108-ge5452e3
frc::NetworkBooleanEvent Class Reference

A Button that uses a NetworkTable boolean field. More...

#include <frc/event/NetworkBooleanEvent.h>

Inheritance diagram for frc::NetworkBooleanEvent:
frc::BooleanEvent

Public Member Functions

 NetworkBooleanEvent (EventLoop *loop, nt::BooleanTopic topic)
 Creates a new event with the given boolean topic determining whether it is active. More...
 
 NetworkBooleanEvent (EventLoop *loop, nt::BooleanSubscriber sub)
 Creates a new event with the given boolean subscriber determining whether it is active. More...
 
 NetworkBooleanEvent (EventLoop *loop, std::shared_ptr< nt::NetworkTable > table, std::string_view topicName)
 Creates a new event with the given boolean topic determining whether it is active. More...
 
 NetworkBooleanEvent (EventLoop *loop, std::string_view tableName, std::string_view topicName)
 Creates a new event with the given boolean topic determining whether it is active. More...
 
 NetworkBooleanEvent (EventLoop *loop, nt::NetworkTableInstance inst, std::string_view tableName, std::string_view topicName)
 Creates a new event with the given boolean topic determining whether it is active. More...
 
- Public Member Functions inherited from frc::BooleanEvent
 BooleanEvent (EventLoop *loop, std::function< bool()> condition)
 Creates a new event with the given condition determining whether it is active. More...
 
bool GetAsBoolean () const
 Check whether this event is active or not. More...
 
void IfHigh (std::function< void()> action)
 Bind an action to this event. More...
 
 operator std::function< bool ()>()
 
template<class T >
CastTo (std::function< T(EventLoop *, std::function< bool()>)> ctor=[](EventLoop *loop, std::function< bool()> condition) { return T(loop, condition);})
 A method to "downcast" a BooleanEvent instance to a subclass (for example, to a command-based version of this class). More...
 
BooleanEvent operator! ()
 Creates a new event that is active when this event is inactive, i.e. More...
 
BooleanEvent operator&& (std::function< bool()> rhs)
 Composes this event with another event, returning a new event that is active when both events are active. More...
 
BooleanEvent operator|| (std::function< bool()> rhs)
 Composes this event with another event, returning a new event that is active when either event is active. More...
 
BooleanEvent Rising ()
 Get a new event that events only when this one newly changes to true. More...
 
BooleanEvent Falling ()
 Get a new event that triggers only when this one newly changes to false. More...
 
BooleanEvent Debounce (units::second_t debounceTime, frc::Debouncer::DebounceType type=frc::Debouncer::DebounceType::kRising)
 Creates a new debounced event from this event - it will become active when this event has been active for longer than the specified period. More...
 

Detailed Description

A Button that uses a NetworkTable boolean field.

This class is provided by the NewCommands VendorDep

Constructor & Destructor Documentation

◆ NetworkBooleanEvent() [1/5]

frc::NetworkBooleanEvent::NetworkBooleanEvent ( EventLoop loop,
nt::BooleanTopic  topic 
)

Creates a new event with the given boolean topic determining whether it is active.

Parameters
loopthe loop that polls this event
topicThe boolean topic that contains the value

◆ NetworkBooleanEvent() [2/5]

frc::NetworkBooleanEvent::NetworkBooleanEvent ( EventLoop loop,
nt::BooleanSubscriber  sub 
)

Creates a new event with the given boolean subscriber determining whether it is active.

Parameters
loopthe loop that polls this event
subThe boolean subscriber that provides the value

◆ NetworkBooleanEvent() [3/5]

frc::NetworkBooleanEvent::NetworkBooleanEvent ( EventLoop loop,
std::shared_ptr< nt::NetworkTable table,
std::string_view  topicName 
)

Creates a new event with the given boolean topic determining whether it is active.

Parameters
loopthe loop that polls this event
tableThe NetworkTable that contains the topic
topicNameThe topic name within the table that contains the value

◆ NetworkBooleanEvent() [4/5]

frc::NetworkBooleanEvent::NetworkBooleanEvent ( EventLoop loop,
std::string_view  tableName,
std::string_view  topicName 
)

Creates a new event with the given boolean topic determining whether it is active.

Parameters
loopthe loop that polls this event
tableNameThe NetworkTable name that contains the topic
topicNameThe topic name within the table that contains the value

◆ NetworkBooleanEvent() [5/5]

frc::NetworkBooleanEvent::NetworkBooleanEvent ( EventLoop loop,
nt::NetworkTableInstance  inst,
std::string_view  tableName,
std::string_view  topicName 
)

Creates a new event with the given boolean topic determining whether it is active.

Parameters
loopthe loop that polls this event
instThe NetworkTable instance to use
tableNameThe NetworkTable that contains the topic
topicNameThe topic name within the table that contains the value

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