2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: Commands.hpp
|
|
|
|
Date: 2021-6-10
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Aurora/Parse/Parse.hpp>
|
|
|
|
|
2021-10-08 19:51:34 +00:00
|
|
|
namespace Aurora::Async
|
|
|
|
{
|
|
|
|
struct WorkerId_t;
|
2021-11-05 17:34:23 +00:00
|
|
|
struct WorkerPId_t;
|
2021-10-08 19:51:34 +00:00
|
|
|
}
|
|
|
|
|
2021-10-23 20:13:40 +00:00
|
|
|
#include "ICommandSubscriber.hpp"
|
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
namespace Aurora::Console::Commands
|
|
|
|
{
|
2021-10-08 19:51:34 +00:00
|
|
|
AUKN_SYM void AddCommand(const AuString &tag, const Parse::ParseObject &commandStructure, const AuSPtr<ICommandSubscriber> &subscriber);
|
2021-06-27 21:25:29 +00:00
|
|
|
|
2021-10-08 19:51:34 +00:00
|
|
|
/**
|
|
|
|
* Dispatch a command to the main thread or aurora async overloaded command dispatcher thread worker id
|
|
|
|
*/
|
2021-06-27 21:25:29 +00:00
|
|
|
AUKN_SYM bool DispatchCommand(const AuString &string);
|
2021-10-08 19:51:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Parses `string` and dispatches the parsed command on the current thread instantly
|
|
|
|
*/
|
|
|
|
AUKN_SYM bool DispatchCommandThisThread(const AuString &string);
|
2021-11-05 17:34:23 +00:00
|
|
|
|
2021-10-08 19:51:34 +00:00
|
|
|
/**
|
|
|
|
* Parses `string` on the current thread and then schedules the ICommandSubscriber callback on the specified thread
|
|
|
|
*/
|
|
|
|
AUKN_SYM bool DispatchCommandToAsyncRunner(const AuString &string, Async::WorkerId_t id);
|
|
|
|
|
2021-11-05 17:34:23 +00:00
|
|
|
|
2021-10-08 19:51:34 +00:00
|
|
|
/**
|
2021-11-05 17:34:23 +00:00
|
|
|
* Parses `string` on the current thread and then schedules the ICommandSubscriber callback on the specified thread
|
2021-10-08 19:51:34 +00:00
|
|
|
*/
|
2021-11-05 17:34:23 +00:00
|
|
|
AUKN_SYM bool DispatchCommandToAsyncRunner(const AuString &string, Async::WorkerPId_t id);
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|