2011-02-27 14:03:57 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
|
|
|
#ifndef ENGINE_ENGINE_H
|
|
|
|
#define ENGINE_ENGINE_H
|
|
|
|
|
|
|
|
#include "kernel.h"
|
|
|
|
#include <engine/shared/jobs.h>
|
|
|
|
|
2017-11-23 14:47:38 +00:00
|
|
|
class CHostLookup : public IJob
|
2011-02-27 14:03:57 +00:00
|
|
|
{
|
2017-11-23 14:47:38 +00:00
|
|
|
private:
|
|
|
|
virtual void Run();
|
|
|
|
|
2011-02-27 14:03:57 +00:00
|
|
|
public:
|
2017-11-23 14:47:38 +00:00
|
|
|
CHostLookup();
|
|
|
|
CHostLookup(const char *pHostname, int Nettype);
|
|
|
|
|
|
|
|
int m_Result;
|
2011-02-27 14:03:57 +00:00
|
|
|
char m_aHostname[128];
|
2011-04-04 16:20:05 +00:00
|
|
|
int m_Nettype;
|
2011-02-27 14:03:57 +00:00
|
|
|
NETADDR m_Addr;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IEngine : public IInterface
|
|
|
|
{
|
|
|
|
MACRO_INTERFACE("engine", 0)
|
|
|
|
|
|
|
|
protected:
|
2011-02-27 16:56:03 +00:00
|
|
|
class CJobPool m_JobPool;
|
2011-02-27 14:03:57 +00:00
|
|
|
|
|
|
|
public:
|
2022-03-12 12:48:05 +00:00
|
|
|
virtual ~IEngine() = default;
|
|
|
|
|
2011-03-05 10:46:24 +00:00
|
|
|
virtual void Init() = 0;
|
2011-02-27 14:03:57 +00:00
|
|
|
virtual void InitLogfile() = 0;
|
2017-11-23 14:47:38 +00:00
|
|
|
virtual void AddJob(std::shared_ptr<IJob> pJob) = 0;
|
2021-03-13 17:10:59 +00:00
|
|
|
static void RunJobBlocking(IJob *pJob);
|
2011-02-27 14:03:57 +00:00
|
|
|
};
|
|
|
|
|
2018-10-07 10:47:32 +00:00
|
|
|
extern IEngine *CreateEngine(const char *pAppname, bool Silent, int Jobs);
|
2021-04-17 14:05:24 +00:00
|
|
|
extern IEngine *CreateTestEngine(const char *pAppname, int Jobs);
|
2011-02-27 14:03:57 +00:00
|
|
|
|
|
|
|
#endif
|