2021-11-05 17:34:23 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: Jobs.hpp
|
|
|
|
Date: 2021-11-1
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Aurora::Async
|
|
|
|
{
|
|
|
|
template<class Info_t = AVoid, class Result_t = AVoid>
|
|
|
|
struct FJob
|
|
|
|
{
|
|
|
|
using InfoType_t = Info_t;
|
|
|
|
using ResultType_t = Result_t;
|
|
|
|
|
|
|
|
AuFunction<void(const Info_t &, const Result_t &)> onSuccess;
|
|
|
|
AuFunction<void(const Info_t &)> onFailure;
|
|
|
|
};
|
|
|
|
|
|
|
|
template<class Info_t = AVoid, class Result_t = AVoid>
|
|
|
|
struct CJob
|
|
|
|
{
|
|
|
|
using InfoType_t = Info_t;
|
|
|
|
using ResultType_t = Result_t;
|
|
|
|
|
|
|
|
void(* onSuccess)(const Info_t &, const Result_t &);
|
|
|
|
void(* onFailure)(const Info_t &);
|
|
|
|
};
|
2021-11-08 00:11:01 +00:00
|
|
|
|
|
|
|
using FVoidJob = FJob<AVoid, AVoid>;
|
2021-11-05 17:34:23 +00:00
|
|
|
}
|