Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
command.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_HPP_
25#define TAPROOT_COMMAND_HPP_
26
27#include "tap/util_macros.hpp"
28
30
31namespace tap
32{
33namespace control
34{
35class Subsystem;
36
44{
45public:
46 Command();
47
48 virtual ~Command();
49
68
69 // This shouldn't be mockable
70 inline int getGlobalIdentifier() const { return globalIdentifier; }
71
80
84 virtual const char* getName() const = 0;
85
93 virtual bool isReady();
94
103 virtual void initialize() = 0;
104
109 virtual void execute() = 0;
110
117 virtual void end(bool interrupted) = 0;
118
129 virtual bool isFinished() const = 0;
130
131private:
136 const int globalIdentifier;
137
138protected:
140}; // class Command
141
142} // namespace control
143
144} // namespace tap
145
146#endif // TAPROOT_COMMAND_HPP_
Definition command.hpp:44
virtual void initialize()=0
command_scheduler_bitmap_t commandRequirementsBitwise
Definition command.hpp:139
virtual ~Command()
Definition command.cpp:35
virtual bool isFinished() const =0
virtual void execute()=0
Command()
Definition command.cpp:33
mockable void addSubsystemRequirement(Subsystem *requirement)
Definition command.cpp:37
virtual const char * getName() const =0
mockable subsystem_scheduler_bitmap_t getRequirementsBitwise() const
Definition command.hpp:64
virtual bool isReady()
Definition command.cpp:46
int getGlobalIdentifier() const
Definition command.hpp:70
virtual void end(bool interrupted)=0
Definition subsystem.hpp:54
uint64_t command_scheduler_bitmap_t
Definition command_scheduler_types.hpp:31
uint64_t subsystem_scheduler_bitmap_t
Definition command_scheduler_types.hpp:32
Definition ballistics.cpp:29
#define mockable
Wrap class functions that are not already virtual in this function if you wish to mock them.
Definition util_macros.hpp:38