Skip to content

Commit 69fb06b

Browse files
committed
Fix build. Rename.
1 parent 196ff14 commit 69fb06b

13 files changed

+29
-29
lines changed

SerialPrograms/Source/Controllers/SuperscalarScheduler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ void SuperscalarScheduler::clear() noexcept{
4040
m_pending_clear.store(false, std::memory_order_release);
4141
}
4242

43-
std::vector<std::shared_ptr<const SchedulerCommand>> SuperscalarScheduler::current_live_commands(){
43+
std::vector<std::shared_ptr<const SchedulerResource>> SuperscalarScheduler::current_live_commands(){
4444
WallClock device_sent_time = m_device_sent_time;
45-
std::vector<std::shared_ptr<const SchedulerCommand>> ret;
45+
std::vector<std::shared_ptr<const SchedulerResource>> ret;
4646
for (auto& item : m_live_commands){
4747
if (item.second.busy_time <= device_sent_time && device_sent_time < item.second.done_time){
4848
ret.emplace_back(item.second.command);
@@ -105,7 +105,7 @@ bool SuperscalarScheduler::iterate_schedule(const Cancellable* cancellable){
105105
}
106106

107107
// Compute the resource state at this timestamp.
108-
std::vector<std::shared_ptr<const SchedulerCommand>> state = current_live_commands();
108+
std::vector<std::shared_ptr<const SchedulerResource>> state = current_live_commands();
109109
clear_finished_commands();
110110

111111
m_device_sent_time = next_state_change;
@@ -231,7 +231,7 @@ void SuperscalarScheduler::issue_wait_for_resource(
231231
}
232232
void SuperscalarScheduler::issue_to_resource(
233233
const Cancellable* cancellable,
234-
std::shared_ptr<const SchedulerCommand> resource,
234+
std::shared_ptr<const SchedulerResource> resource,
235235
WallDuration delay, WallDuration hold, WallDuration cooldown
236236
){
237237
if (m_pending_clear.load(std::memory_order_acquire)){

SerialPrograms/Source/Controllers/SuperscalarScheduler.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef PokemonAutomation_Controllers_SuperscalarScheduler_H
88
#define PokemonAutomation_Controllers_SuperscalarScheduler_H
99

10+
#include <memory>
1011
#include <set>
1112
#include <map>
1213
#include <atomic>
@@ -20,15 +21,15 @@ class SuperscalarScheduler;
2021

2122

2223

23-
class SchedulerCommand{
24+
class SchedulerResource{
2425
public:
2526
const size_t id;
2627

27-
SchedulerCommand(size_t id)
28+
SchedulerResource(size_t id)
2829
: id(id)
2930
{}
3031

31-
virtual ~SchedulerCommand() = default;
32+
virtual ~SchedulerResource() = default;
3233
};
3334

3435

@@ -82,7 +83,7 @@ class SuperscalarScheduler{
8283
// The resource must be ready to be used.
8384
void issue_to_resource(
8485
const Cancellable* cancellable,
85-
std::shared_ptr<const SchedulerCommand> resource,
86+
std::shared_ptr<const SchedulerResource> resource,
8687
WallDuration delay, WallDuration hold, WallDuration cooldown
8788
);
8889

@@ -102,13 +103,13 @@ class SuperscalarScheduler{
102103
virtual void push_state(
103104
const Cancellable* cancellable,
104105
WallDuration duration,
105-
std::vector<std::shared_ptr<const SchedulerCommand>> state
106+
std::vector<std::shared_ptr<const SchedulerResource>> state
106107
) = 0;
107108

108109

109110
private:
110111
void clear() noexcept;
111-
std::vector<std::shared_ptr<const SchedulerCommand>> current_live_commands();
112+
std::vector<std::shared_ptr<const SchedulerResource>> current_live_commands();
112113
void clear_finished_commands();
113114
bool iterate_schedule(const Cancellable* cancellable);
114115
void process_schedule(const Cancellable* cancellable);
@@ -145,7 +146,7 @@ class SuperscalarScheduler{
145146
std::set<WallClock> m_state_changes;
146147

147148
struct Command{
148-
std::shared_ptr<const SchedulerCommand> command;
149+
std::shared_ptr<const SchedulerResource> command;
149150
WallClock busy_time; // Timestamp of when resource will be become busy.
150151
WallClock done_time; // Timestamp of when resource will be done being busy.
151152
WallClock free_time; // Timestamp of when resource can be used again.

SerialPrograms/Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerWithScheduler.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ struct SwitchControllerState{
7171
uint16_t gyro[6];
7272
};
7373

74-
class SwitchCommand : public SchedulerCommand{
74+
class SwitchCommand : public SchedulerResource{
7575
public:
76-
using SchedulerCommand::SchedulerCommand;
76+
using SchedulerResource::SchedulerResource;
7777
virtual void apply(SwitchControllerState& state) const = 0;
7878
};
7979
class SwitchCommand_Button : public SwitchCommand{
@@ -171,8 +171,7 @@ inline SplitDpad convert_unified_to_split_dpad(DpadPosition dpad){
171171

172172

173173

174-
class ControllerWithScheduler : protected SuperscalarScheduler
175-
{
174+
class ControllerWithScheduler : protected SuperscalarScheduler{
176175
public:
177176
ControllerWithScheduler(Logger& logger);
178177

SerialPrograms/Source/NintendoSwitch/Controllers/SerialPABotBase/NintendoSwitch_SerialPABotBase_WiredController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void SerialPABotBase_WiredController::stop(){
9595
void SerialPABotBase_WiredController::push_state(
9696
const Cancellable* cancellable,
9797
WallDuration duration,
98-
std::vector<std::shared_ptr<const SchedulerCommand>> state
98+
std::vector<std::shared_ptr<const SchedulerResource>> state
9999
){
100100
// Must be called inside "m_state_lock".
101101

SerialPrograms/Source/NintendoSwitch/Controllers/SerialPABotBase/NintendoSwitch_SerialPABotBase_WiredController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class SerialPABotBase_WiredController final :
223223
virtual void push_state(
224224
const Cancellable* cancellable,
225225
WallDuration duration,
226-
std::vector<std::shared_ptr<const SchedulerCommand>> state
226+
std::vector<std::shared_ptr<const SchedulerResource>> state
227227
) override;
228228

229229
void status_thread();

SerialPrograms/Source/NintendoSwitch/Controllers/SerialPABotBase/NintendoSwitch_SerialPABotBase_WirelessJoycon.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ template <typename JoyconType>
155155
void SerialPABotBase_WirelessJoycon<JoyconType>::push_state_left_joycon(
156156
const Cancellable* cancellable,
157157
WallDuration duration,
158-
std::vector<std::shared_ptr<const SchedulerCommand>> state
158+
std::vector<std::shared_ptr<const SchedulerResource>> state
159159
){
160160
SwitchControllerState controller_state;
161161
for (auto& item : state){
@@ -200,7 +200,7 @@ template <typename JoyconType>
200200
void SerialPABotBase_WirelessJoycon<JoyconType>::push_state_right_joycon(
201201
const Cancellable* cancellable,
202202
WallDuration duration,
203-
std::vector<std::shared_ptr<const SchedulerCommand>> state
203+
std::vector<std::shared_ptr<const SchedulerResource>> state
204204
){
205205
SwitchControllerState controller_state;
206206
for (auto& item : state){
@@ -239,7 +239,7 @@ template <typename JoyconType>
239239
void SerialPABotBase_WirelessJoycon<JoyconType>::push_state(
240240
const Cancellable* cancellable,
241241
WallDuration duration,
242-
std::vector<std::shared_ptr<const SchedulerCommand>> state
242+
std::vector<std::shared_ptr<const SchedulerResource>> state
243243
){
244244
switch (m_controller_type){
245245
case ControllerType::NintendoSwitch_LeftJoycon:

SerialPrograms/Source/NintendoSwitch/Controllers/SerialPABotBase/NintendoSwitch_SerialPABotBase_WirelessJoycon.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,17 @@ class SerialPABotBase_WirelessJoycon :
164164
void push_state_left_joycon(
165165
const Cancellable* cancellable,
166166
WallDuration duration,
167-
std::vector<std::shared_ptr<const SchedulerCommand>> state
167+
std::vector<std::shared_ptr<const SchedulerResource>> state
168168
);
169169
void push_state_right_joycon(
170170
const Cancellable* cancellable,
171171
WallDuration duration,
172-
std::vector<std::shared_ptr<const SchedulerCommand>> state
172+
std::vector<std::shared_ptr<const SchedulerResource>> state
173173
);
174174
virtual void push_state(
175175
const Cancellable* cancellable,
176176
WallDuration duration,
177-
std::vector<std::shared_ptr<const SchedulerCommand>> state
177+
std::vector<std::shared_ptr<const SchedulerResource>> state
178178
) override;
179179

180180
ControllerType m_controller_type;

SerialPrograms/Source/NintendoSwitch/Controllers/SerialPABotBase/NintendoSwitch_SerialPABotBase_WirelessProController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ SerialPABotBase_WirelessProController::~SerialPABotBase_WirelessProController(){
3939
void SerialPABotBase_WirelessProController::push_state(
4040
const Cancellable* cancellable,
4141
WallDuration duration,
42-
std::vector<std::shared_ptr<const SchedulerCommand>> state
42+
std::vector<std::shared_ptr<const SchedulerResource>> state
4343
){
4444
SwitchControllerState controller_state;
4545
for (auto& item : state){

SerialPrograms/Source/NintendoSwitch/Controllers/SerialPABotBase/NintendoSwitch_SerialPABotBase_WirelessProController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class SerialPABotBase_WirelessProController final :
213213
virtual void push_state(
214214
const Cancellable* cancellable,
215215
WallDuration duration,
216-
std::vector<std::shared_ptr<const SchedulerCommand>> state
216+
std::vector<std::shared_ptr<const SchedulerResource>> state
217217
) override;
218218
};
219219

SerialPrograms/Source/NintendoSwitch/Controllers/SysbotBase/SysbotBase3_ProController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void ProController_SysbotBase3::on_message(const std::string& message){
174174
void ProController_SysbotBase3::push_state(
175175
const Cancellable* cancellable,
176176
WallDuration duration,
177-
std::vector<std::shared_ptr<const SchedulerCommand>> state
177+
std::vector<std::shared_ptr<const SchedulerResource>> state
178178
){
179179
// Must be called inside "m_state_lock".
180180

0 commit comments

Comments
 (0)