Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
tap::control::ToggleCommandMapping Class Reference

#include <toggle_command_mapping.hpp>

Inheritance diagram for tap::control::ToggleCommandMapping:
Collaboration diagram for tap::control::ToggleCommandMapping:

Public Member Functions

 ToggleCommandMapping (Drivers *drivers, const std::vector< Command * > cmds, const RemoteMapState &rms)
 
virtual ~ToggleCommandMapping ()=default
 
void executeCommandMapping (const RemoteMapState &currState) override
 
- Public Member Functions inherited from tap::control::CommandMapping
 CommandMapping (Drivers *drivers, const std::vector< Command * > cmds, const RemoteMapState &rms)
 
virtual ~CommandMapping ()=default
 
virtual bool mappingSubset (const RemoteMapState &mapState)
 
const RemoteMapStategetAssociatedRemoteMapState () const
 
const std::vector< Command * > & getAssociatedCommands () const
 

Additional Inherited Members

- Static Public Member Functions inherited from tap::control::CommandMapping
static bool negKeysSubset (const RemoteMapState &state1, const RemoteMapState &state2)
 
- Protected Member Functions inherited from tap::control::CommandMapping
void addCommands ()
 
void removeCommands ()
 
bool noCommandsScheduled () const
 
- Protected Attributes inherited from tap::control::CommandMapping
const RemoteMapState mapState
 
std::vector< Command * > mappedCommands
 
Driversdrivers
 

Detailed Description

A CommandMapping that adds Commands when the contained mapping is toggled, and removes the Commands when the mapping is untoggled.

When all of the commands in the toggle command mapping naturally ends, the toggle command mapping's internal state is reset to being not toggled.

Constructor & Destructor Documentation

◆ ToggleCommandMapping()

tap::control::ToggleCommandMapping::ToggleCommandMapping ( Drivers drivers,
const std::vector< Command * >  cmds,
const RemoteMapState rms 
)
inline

Constructor must take the set of Commands and the RemoteMapState.

◆ ~ToggleCommandMapping()

virtual tap::control::ToggleCommandMapping::~ToggleCommandMapping ( )
virtualdefault

Member Function Documentation

◆ executeCommandMapping()

void tap::control::ToggleCommandMapping::executeCommandMapping ( const RemoteMapState currState)
overridevirtual

See the class description details about how the commands are added and removed.

Parameters
[in]currStateThe current RemoteMapState of the remote.

Implements tap::control::CommandMapping.


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