Skip to content

Commit de10ade

Browse files
committed
BotBaseContext -> NintendoSwitch::ControllerContext
1 parent b6aa81d commit de10ade

File tree

650 files changed

+2866
-2947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

650 files changed

+2866
-2947
lines changed

ClientSource/Connection/BotBase.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ namespace PokemonAutomation{
1515

1616

1717

18-
void BotBaseContext::wait_for_all_requests() const{
18+
void BotBaseControllerContext::wait_for_all_requests() const{
1919
m_lifetime_sanitizer.check_usage();
2020
m_controller.wait_for_all_requests(this);
2121
}
22-
void BotBaseContext::cancel_now(){
22+
void BotBaseControllerContext::cancel_now(){
2323
m_lifetime_sanitizer.check_usage();
2424
CancellableScope::cancel(nullptr);
2525
m_controller.stop_all_commands();
2626
}
27-
void BotBaseContext::cancel_lazy(){
27+
void BotBaseControllerContext::cancel_lazy(){
2828
m_lifetime_sanitizer.check_usage();
2929
CancellableScope::cancel(nullptr);
3030
m_controller.next_command_interrupt();
3131
}
3232

33-
bool BotBaseContext::cancel(std::exception_ptr exception) noexcept{
33+
bool BotBaseControllerContext::cancel(std::exception_ptr exception) noexcept{
3434
m_lifetime_sanitizer.check_usage();
3535
if (CancellableScope::cancel(std::move(exception))){
3636
return true;
@@ -41,16 +41,16 @@ bool BotBaseContext::cancel(std::exception_ptr exception) noexcept{
4141
return false;
4242
}
4343

44-
bool BotBaseContext::try_issue_request(const BotBaseRequest& request) const{
44+
bool BotBaseControllerContext::try_issue_request(const BotBaseRequest& request) const{
4545
m_lifetime_sanitizer.check_usage();
4646
return m_controller.try_issue_request(request, this);
4747
}
48-
void BotBaseContext::issue_request(const BotBaseRequest& request) const{
48+
void BotBaseControllerContext::issue_request(const BotBaseRequest& request) const{
4949
m_lifetime_sanitizer.check_usage();
5050
m_controller.issue_request(request, this);
5151
}
5252

53-
BotBaseMessage BotBaseContext::issue_request_and_wait(const BotBaseRequest& request) const{
53+
BotBaseMessage BotBaseControllerContext::issue_request_and_wait(const BotBaseRequest& request) const{
5454
m_lifetime_sanitizer.check_usage();
5555
return m_controller.issue_request_and_wait(request, this);
5656
}

ClientSource/Connection/BotBase.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ namespace PokemonAutomation{
1515
class Logger;
1616
struct BotBaseMessage;
1717
class BotBaseRequest;
18-
class BotBaseContext;
18+
class BotBaseControllerContext;
1919

2020

2121

2222
class BotBaseController{
2323
public:
24-
using ContextType = BotBaseContext;
24+
using ContextType = BotBaseControllerContext;
2525

2626
enum class State{
2727
RUNNING,
@@ -82,20 +82,20 @@ class ControllerContext : public CancellableScope{
8282

8383

8484
// A wrapper for BotBase that allows for asynchronous cancelling.
85-
class BotBaseContext final : public ControllerContext{
85+
class BotBaseControllerContext final : public ControllerContext{
8686
public:
8787
using ControllerType = BotBaseController;
8888

8989
public:
90-
BotBaseContext(BotBaseController& botbase)
90+
BotBaseControllerContext(BotBaseController& botbase)
9191
: m_controller(botbase)
9292
{}
93-
BotBaseContext(CancellableScope& parent, BotBaseController& botbase)
93+
BotBaseControllerContext(CancellableScope& parent, BotBaseController& botbase)
9494
: m_controller(botbase)
9595
{
9696
attach(parent);
9797
}
98-
virtual ~BotBaseContext(){
98+
virtual ~BotBaseControllerContext(){
9999
detach();
100100
}
101101

Common/Cpp/LifetimeSanitizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#define PokemonAutomation_LifetimeSanitizer_H
99

1010
#include <stdint.h>
11+
//#include <string>
1112
#include <atomic>
12-
#include <string>
1313
#include "Common/Compiler.h"
1414

1515
#define PA_SANITIZER_ENABLE

Common/Cpp/PanicDump.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
#ifndef PokemonAutomation_PanicDumping_H
88
#define PokemonAutomation_PanicDumping_H
99

10-
#include <string>
1110
#include <functional>
12-
#include "ClientSource/Connection/BotBase.h"
1311

1412
namespace PokemonAutomation{
1513

SerialPrograms/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ file(GLOB MAIN_SOURCES
537537
Source/CommonFramework/Tools/ErrorDumper.h
538538
Source/CommonFramework/Tools/FileDownloader.cpp
539539
Source/CommonFramework/Tools/FileDownloader.h
540-
Source/CommonFramework/Tools/InterruptableCommands.cpp
540+
Source/CommonFramework/Tools/InterruptableCommands.tpp
541541
Source/CommonFramework/Tools/InterruptableCommands.h
542542
Source/CommonFramework/Tools/MultiConsoleErrors.cpp
543543
Source/CommonFramework/Tools/MultiConsoleErrors.h
@@ -547,7 +547,7 @@ file(GLOB MAIN_SOURCES
547547
Source/CommonFramework/Tools/StatsDatabase.h
548548
Source/CommonFramework/Tools/StatsTracking.cpp
549549
Source/CommonFramework/Tools/StatsTracking.h
550-
Source/CommonFramework/Tools/SuperControlSession.cpp
550+
Source/CommonFramework/Tools/SuperControlSession.tpp
551551
Source/CommonFramework/Tools/SuperControlSession.h
552552
Source/CommonFramework/Tools/VideoResolutionCheck.cpp
553553
Source/CommonFramework/Tools/VideoResolutionCheck.h
@@ -791,6 +791,7 @@ file(GLOB MAIN_SOURCES
791791
Source/NintendoSwitch/Commands/NintendoSwitch_Messages_Device.h
792792
Source/NintendoSwitch/Commands/NintendoSwitch_Messages_PushButtons.h
793793
Source/NintendoSwitch/Commands/NintendoSwitch_Messages_Superscalar.h
794+
Source/NintendoSwitch/Controllers/NintendoSwitch_Controller.cpp
794795
Source/NintendoSwitch/Controllers/NintendoSwitch_Controller.h
795796
Source/NintendoSwitch/DevPrograms/BoxDraw.cpp
796797
Source/NintendoSwitch/DevPrograms/BoxDraw.h

SerialPrograms/SerialPrograms.pro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,11 @@ SOURCES += \
282282
Source/CommonFramework/Tools/DebugDumper.cpp \
283283
Source/CommonFramework/Tools/ErrorDumper.cpp \
284284
Source/CommonFramework/Tools/FileDownloader.cpp \
285-
Source/CommonFramework/Tools/InterruptableCommands.cpp \
285+
Source/CommonFramework/Tools/InterruptableCommands.tpp \
286286
Source/CommonFramework/Tools/MultiConsoleErrors.cpp \
287287
Source/CommonFramework/Tools/ProgramEnvironment.cpp \
288288
Source/CommonFramework/Tools/StatsDatabase.cpp \
289289
Source/CommonFramework/Tools/StatsTracking.cpp \
290-
Source/CommonFramework/Tools/SuperControlSession.cpp \
291290
Source/CommonFramework/Tools/VideoResolutionCheck.cpp \
292291
Source/CommonFramework/Tools/VideoStream.cpp \
293292
Source/CommonFramework/VideoPipeline/Backends/CameraImplementations.cpp \
@@ -395,6 +394,7 @@ SOURCES += \
395394
Source/NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.cpp \
396395
Source/NintendoSwitch/Commands/NintendoSwitch_Commands_Routines.cpp \
397396
Source/NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.cpp \
397+
Source/NintendoSwitch/Controllers/NintendoSwitch_Controller.cpp \
398398
Source/NintendoSwitch/DevPrograms/BoxDraw.cpp \
399399
Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp \
400400
Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp \
@@ -1382,11 +1382,13 @@ HEADERS += \
13821382
Source/CommonFramework/Tools/ErrorDumper.h \
13831383
Source/CommonFramework/Tools/FileDownloader.h \
13841384
Source/CommonFramework/Tools/InterruptableCommands.h \
1385+
Source/CommonFramework/Tools/InterruptableCommands.tpp \
13851386
Source/CommonFramework/Tools/MultiConsoleErrors.h \
13861387
Source/CommonFramework/Tools/ProgramEnvironment.h \
13871388
Source/CommonFramework/Tools/StatsDatabase.h \
13881389
Source/CommonFramework/Tools/StatsTracking.h \
13891390
Source/CommonFramework/Tools/SuperControlSession.h \
1391+
Source/CommonFramework/Tools/SuperControlSession.tpp \
13901392
Source/CommonFramework/Tools/VideoResolutionCheck.h \
13911393
Source/CommonFramework/Tools/VideoStream.h \
13921394
Source/CommonFramework/VideoPipeline/Backends/CameraImplementations.h \

SerialPrograms/Source/CommonFramework/Tools/BotBaseHandle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ void BotBaseHandle::thread_body(){
381381
}
382382
});
383383

384-
BotBaseContext context(*m_botbase);
384+
BotBaseControllerContext context(*m_botbase);
385385
while (true){
386386
if (m_state.load(std::memory_order_acquire) != State::READY){
387387
break;

SerialPrograms/Source/CommonFramework/Tools/InterruptableCommands.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99

1010
#include <mutex>
1111
#include <condition_variable>
12+
#include "Common/Cpp/CancellableScope.h"
1213
#include "Common/Cpp/Concurrency/AsyncDispatcher.h"
13-
#include "ClientSource/Connection/BotBase.h"
1414

1515

1616
namespace PokemonAutomation{
1717

18+
class Logger;
1819
class ProgramEnvironment;
1920

2021

0 commit comments

Comments
 (0)