.. _program_listing_file_src_tap_control_command_mapper.hpp: Program Listing for File command_mapper.hpp =========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/tap/control/command_mapper.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright (c) 2020-2021 Advanced Robotics at the University of Washington * * This file is part of Taproot. * * Taproot is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Taproot is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Taproot. If not, see . */ #ifndef TAPROOT_COMMAND_MAPPER_HPP_ #define TAPROOT_COMMAND_MAPPER_HPP_ #include #include "tap/communication/serial/remote.hpp" #include "tap/util_macros.hpp" namespace tap { class Drivers; namespace control { class CommandMapping; class CommandMapper { public: explicit CommandMapper(Drivers *drivers) : drivers(drivers) {} DISALLOW_COPY_AND_ASSIGN(CommandMapper) mockable ~CommandMapper() = default; mockable void handleKeyStateChange( uint16_t key, tap::communication::serial::Remote::SwitchState leftSwitch, tap::communication::serial::Remote::SwitchState rightSwitch, bool mouseL, bool mouseR); mockable void addMap(CommandMapping *mapping); mockable std::size_t getSize() const { return commandsToRun.size(); } mockable const CommandMapping *getAtIndex(std::size_t index) const; private: std::vector commandsToRun; Drivers *drivers; }; // class CommandMapper } // namespace control } // namespace tap #endif // TAPROOT_COMMAND_MAPPER_HPP_