ddnet/src/engine/engine.h

42 lines
931 B
C
Raw Normal View History

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>
class CHostLookup : public IJob
2011-02-27 14:03:57 +00:00
{
private:
virtual void Run();
2011-02-27 14:03:57 +00:00
public:
CHostLookup();
CHostLookup(const char *pHostname, int Nettype);
int m_Result;
2011-02-27 14:03:57 +00:00
char m_aHostname[128];
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:
virtual void Init() = 0;
2011-02-27 14:03:57 +00:00
virtual void InitLogfile() = 0;
virtual void AddJob(std::shared_ptr<IJob> pJob) = 0;
static void RunJobBlocking(IJob *pJob);
2011-02-27 14:03:57 +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