2023-02-28 01:15:26 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
2017-06-28 21:21:42 +00:00
|
|
|
|
|
|
|
#pragma once
|
2020-04-02 15:02:01 +00:00
|
|
|
#include "common.hpp"
|
2020-03-03 00:49:26 +00:00
|
|
|
|
2023-05-14 04:50:27 +00:00
|
|
|
#include "warning-disable.hpp"
|
|
|
|
#include <functional>
|
|
|
|
#include "warning-enable.hpp"
|
|
|
|
|
2020-04-05 16:52:06 +00:00
|
|
|
namespace streamfx {
|
2023-05-14 04:50:27 +00:00
|
|
|
/** Simple but efficient loader structure for ordered initia-/finalize.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef int32_t loader_priority_t;
|
|
|
|
typedef std::function<void()> loader_function_t;
|
|
|
|
enum loader_priority : loader_priority_t {
|
|
|
|
HIGHEST = INT32_MIN,
|
|
|
|
HIGHER = INT32_MIN / 4 * 3,
|
|
|
|
HIGH = INT32_MIN / 4 * 2,
|
|
|
|
ABOVE = INT32_MIN / 4,
|
|
|
|
NORMAL = 0,
|
|
|
|
BELOW = INT32_MAX / 4,
|
|
|
|
LOW = INT32_MAX / 4 * 2,
|
|
|
|
LOWER = INT32_MAX / 4 * 3,
|
|
|
|
LOWEST = INT32_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct loader {
|
|
|
|
loader(loader_function_t initializer, loader_function_t finalizer, loader_priority_t priority);
|
|
|
|
|
|
|
|
// Usage:
|
|
|
|
// auto loader = streamfx::loader([]() { ... }, []() { ... }, 0);
|
|
|
|
};
|
|
|
|
|
2020-04-05 16:52:06 +00:00
|
|
|
// Threadpool
|
2022-09-18 16:30:15 +00:00
|
|
|
std::shared_ptr<streamfx::util::threadpool::threadpool> threadpool();
|
2020-05-02 16:36:57 +00:00
|
|
|
|
2020-11-28 14:38:56 +00:00
|
|
|
std::filesystem::path data_file_path(std::string_view file);
|
|
|
|
std::filesystem::path config_file_path(std::string_view file);
|
2021-04-16 23:42:54 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_FRONTEND
|
|
|
|
bool open_url(std::string_view url);
|
|
|
|
#endif
|
2020-04-05 16:52:06 +00:00
|
|
|
} // namespace streamfx
|