Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
command_mapper.hpp
Go to the documentation of this file.
1/*****************************************************************************/
2/********** !!! WARNING: CODE GENERATED BY TAPROOT. DO NOT EDIT !!! **********/
3/*****************************************************************************/
4
5/*
6 * Copyright (c) 2020-2021 Advanced Robotics at the University of Washington <robomstr@uw.edu>
7 *
8 * This file is part of Taproot.
9 *
10 * Taproot is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * Taproot is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Taproot. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef TAPROOT_COMMAND_MAPPER_HPP_
25#define TAPROOT_COMMAND_MAPPER_HPP_
26
27#include <vector>
28
30#include "tap/util_macros.hpp"
31
32namespace tap
33{
34class Drivers;
35namespace control
36{
37class CommandMapping;
38
68{
69public:
70 explicit CommandMapper(Drivers *drivers) : drivers(drivers) {}
72 mockable ~CommandMapper() = default;
73
82 uint16_t key,
83 tap::communication::serial::Remote::SwitchState leftSwitch,
84 tap::communication::serial::Remote::SwitchState rightSwitch,
85 bool mouseL,
86 bool mouseR);
87
96 mockable void addMap(CommandMapping *mapping);
97
101 mockable std::size_t getSize() const { return commandsToRun.size(); }
102
107 mockable const CommandMapping *getAtIndex(std::size_t index) const;
108
109private:
117 std::vector<CommandMapping *> commandsToRun;
118
119 Drivers *drivers;
120}; // class CommandMapper
121
122} // namespace control
123} // namespace tap
124
125#endif // TAPROOT_COMMAND_MAPPER_HPP_
Definition drivers.hpp:70
Definition command_mapper.hpp:68
mockable std::size_t getSize() const
Definition command_mapper.hpp:101
mockable void addMap(CommandMapping *mapping)
Definition command_mapper.cpp:67
mockable void handleKeyStateChange(uint16_t key, tap::communication::serial::Remote::SwitchState leftSwitch, tap::communication::serial::Remote::SwitchState rightSwitch, bool mouseL, bool mouseR)
Definition command_mapper.cpp:39
CommandMapper(Drivers *drivers)
Definition command_mapper.hpp:70
mockable const CommandMapping * getAtIndex(std::size_t index) const
Definition command_mapper.cpp:69
Definition command_mapping.hpp:48
Definition ballistics.cpp:29
tap::Drivers Drivers
Definition drivers.hpp:11
fang::Drivers & drivers
Definition robot_singleton.cpp:45
#define mockable
Wrap class functions that are not already virtual in this function if you wish to mock them.
Definition util_macros.hpp:38
#define DISALLOW_COPY_AND_ASSIGN(Typename)
Definition util_macros.hpp:27