WPILibC++
unspecified
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Trigger.h
1
/*----------------------------------------------------------------------------*/
2
/* Copyright (c) 2011-2017 FIRST. All Rights Reserved. */
3
/* Open Source Software - may be modified and shared by FRC teams. The code */
4
/* must be accompanied by the FIRST BSD license file in the root directory of */
5
/* the project. */
6
/*----------------------------------------------------------------------------*/
7
8
#pragma once
9
10
#include <memory>
11
#include <string>
12
13
#include "SmartDashboard/Sendable.h"
14
#include "networktables/NetworkTableEntry.h"
15
16
namespace
frc
{
17
18
class
Command;
19
35
class
Trigger
:
public
Sendable
{
36
public
:
37
Trigger
() =
default
;
38
virtual
~
Trigger
() =
default
;
39
bool
Grab();
40
virtual
bool
Get() = 0;
41
void
WhenActive(
Command
* command);
42
void
WhileActive(
Command
* command);
43
void
WhenInactive(
Command
* command);
44
void
CancelWhenActive(
Command
* command);
45
void
ToggleWhenActive(
Command
* command);
46
47
void
InitTable
(std::shared_ptr<nt::NetworkTable> subtable)
override
;
48
std::string
GetSmartDashboardType
()
const override
;
49
50
protected
:
51
nt::NetworkTableEntry
m_pressedEntry;
52
};
53
54
}
// namespace frc
frc
Definition:
Timer.cpp:18
frc::Trigger::InitTable
void InitTable(std::shared_ptr< nt::NetworkTable > subtable) override
Initializes a table for this sendable object.
Definition:
Trigger.cpp:48
frc::Trigger::GetSmartDashboardType
std::string GetSmartDashboardType() const override
Definition:
Trigger.cpp:46
nt::NetworkTableEntry
NetworkTables Entry.
Definition:
NetworkTableEntry.h:30
frc::Sendable
Definition:
Sendable.h:17
frc::Command
The Command class is at the very core of the entire command framework.
Definition:
Command.h:52
frc::Trigger
This class provides an easy way to link commands to inputs.
Definition:
Trigger.h:35
build
cppSource
wpilibc
headers
Buttons
Trigger.h
Generated on Tue Oct 17 2017 20:05:21 for WPILibC++ by
1.8.11