This commit is contained in:
aozhiwei 2024-12-21 16:13:48 +08:00
parent 140f7cd0a6
commit 06a74ea172
5 changed files with 57 additions and 23 deletions

33
third_party/f8/f8/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,33 @@
cmake_minimum_required (VERSION 3.8)
project(f8)
if (${RELEASE})
set(CMAKE_BUILD_TYPE "Release")
message("release mode")
else()
set(CMAKE_BUILD_TYPE "Debug")
message("debug mode")
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -g -std=c++17 ")
if (${ASAN})
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=c++17 -DMYDEBUG -fsanitize=address -fno-omit-frame-pointer")
else()
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=c++17 -DMYDEBUG ")
endif()
# include directories
include_directories(
AFTER
../../a8
../../f8
/usr/include/mysql
/usr/include/jsoncpp
/usr/include/glm
)
aux_source_directory(.
SRC_LIST
)
add_library(f8 STATIC ${SRC_LIST})

View File

@ -16,6 +16,7 @@
#include <f8/tglog.h>
#include <f8/httpclientpool.h>
#include <a8/queue.h>
#include <f8/timer.h>
static const int MAX_ZONE_ID = 100;
static const int MAX_NODE_ID = 8;

View File

@ -2,4 +2,3 @@
#include <a8/a8.h>
#include <f8/types.h>
#include <f8/timer.h>

View File

@ -2,28 +2,6 @@
namespace f8
{
class TimerWp
{
public:
TimerWp(a8::XTimerWp wp): real_obj_(wp) {};
TimerWp() {};
bool expired() { return real_obj_.expired();};
private:
a8::XTimerWp real_obj_;
friend class Timer;
};
class Attacher
{
public:
Attacher();
void ClearTimerList();
private:
a8::Attacher real_obj_;
friend class Timer;
};
class Timer : public a8::Singleton<Timer>
{

View File

@ -20,4 +20,27 @@ namespace f8
IM_SysEnd = 99,
};
class TimerWp
{
public:
TimerWp(a8::XTimerWp wp): real_obj_(wp) {};
TimerWp() {};
bool expired() { return real_obj_.expired();};
private:
a8::XTimerWp real_obj_;
friend class Timer;
};
class Attacher
{
public:
Attacher();
void ClearTimerList();
private:
a8::Attacher real_obj_;
friend class Timer;
};
}