2018-04-30 18:18:18 +00:00
|
|
|
#ifndef LLARP_LOGIC_H
|
|
|
|
#define LLARP_LOGIC_H
|
2018-05-20 16:15:16 +00:00
|
|
|
#include <llarp/mem.h>
|
2018-04-30 18:18:18 +00:00
|
|
|
#include <llarp/threadpool.h>
|
|
|
|
#include <llarp/timer.h>
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-04-30 18:18:34 +00:00
|
|
|
struct llarp_logic;
|
2018-04-30 18:18:18 +00:00
|
|
|
|
2018-05-22 15:54:19 +00:00
|
|
|
struct llarp_logic*
|
2018-05-28 13:49:44 +00:00
|
|
|
llarp_init_logic();
|
2018-04-30 18:18:18 +00:00
|
|
|
|
2018-06-06 12:46:26 +00:00
|
|
|
/// single threaded mode logic event loop
|
|
|
|
struct llarp_logic*
|
|
|
|
llarp_init_single_process_logic(struct llarp_threadpool* tp);
|
|
|
|
|
|
|
|
/// single threaded tick
|
|
|
|
void
|
|
|
|
llarp_logic_tick(struct llarp_logic* logic);
|
|
|
|
|
2018-05-22 15:54:19 +00:00
|
|
|
void
|
|
|
|
llarp_free_logic(struct llarp_logic** logic);
|
2018-04-30 18:18:18 +00:00
|
|
|
|
2018-05-22 15:54:19 +00:00
|
|
|
void
|
|
|
|
llarp_logic_queue_job(struct llarp_logic* logic, struct llarp_thread_job job);
|
2018-04-30 18:18:18 +00:00
|
|
|
|
2018-05-22 15:54:19 +00:00
|
|
|
uint32_t
|
|
|
|
llarp_logic_call_later(struct llarp_logic* logic, struct llarp_timeout_job job);
|
|
|
|
void
|
|
|
|
llarp_logic_cancel_call(struct llarp_logic* logic, uint32_t id);
|
2018-04-30 18:18:18 +00:00
|
|
|
|
2018-05-27 12:49:10 +00:00
|
|
|
void
|
|
|
|
llarp_logic_remove_call(struct llarp_logic* logic, uint32_t id);
|
|
|
|
|
2018-05-22 15:54:19 +00:00
|
|
|
void
|
|
|
|
llarp_logic_stop(struct llarp_logic* logic);
|
2018-04-30 18:18:34 +00:00
|
|
|
|
2018-05-22 15:54:19 +00:00
|
|
|
void
|
|
|
|
llarp_logic_mainloop(struct llarp_logic* logic);
|
2018-04-30 18:18:18 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|