<commit_before>/**
 * @file    LuTimer.cpp
 * @author  <NAME><<EMAIL>>
 * @date    2017-07-07
 * @version 1.0
 *
 * @brief
 */

#include "lullbc/common/Export.h"

#include "lullbc/core/timer/LuTimer.h"
#include "lullbc/core/timer/LuTimerScheduler.h"

static const int __TimerKey_LuaTimer = 1;
static const int __TimerKey_Timeout= 2;

static int __Timer_PCallErrorHandler(lua_State *l)
{
    size_t errMsgLen;
    const char *errMsg = luaL_tolstring(l, 1, &errMsgLen);

    luaL_traceback(l, l, NULL, 2);
    size_t tbInfoLen;
    const char *tbInfo = luaL_tolstring(l, -1, &tbInfoLen);

    LLBC_String tbAppendedErrMsg;
    tbAppendedErrMsg.append(errMsg, errMsgLen);
    tbAppendedErrMsg.append("\n");
    tbAppendedErrMsg.append(tbInfo, tbInfoLen);

    lua_remove(l, -1);
    lua_pushlstring(l, tbAppendedErrMsg.data(), tbAppendedErrMsg.size());

    return 1;
}

lullbc_Timer::lullbc_Timer(lua_State *l)
: LLBC_Timer((TimeoutFunc)NULL, NULL, lullbc_TimerScheduler::GetLLBCTimerScheduler(l))
, _luaState(l)
, _callableInfo(0)
{
    // Check argument:<commit_msg>fix lullbc compile error<commit_after>/**
 * @file    LuTimer.cpp
 * @author  <NAME><<EMAIL>>
 * @date    2017-07-07
 * @version 1.0
 *
 * @brief
 */

#include "lullbc/common/Export.h"

#include "lullbc/core/timer/LuTimer.h"
#include "lullbc/core/timer/LuTimerScheduler.h"

static const int __TimerKey_LuaTimer = 1;
static const int __TimerKey_Timeout= 2;

static int __Timer_PCallErrorHandler(lua_State *l)
{
    size_t errMsgLen;
    const char *errMsg = luaL_tolstring(l, 1, &errMsgLen);

    luaL_traceback(l, l, NULL, 2);
    size_t tbInfoLen;
    const char *tbInfo = luaL_tolstring(l, -1, &tbInfoLen);

    LLBC_String tbAppendedErrMsg;
    tbAppendedErrMsg.append(errMsg, errMsgLen);
    tbAppendedErrMsg.append("\n");
    tbAppendedErrMsg.append(tbInfo, tbInfoLen);

    lua_remove(l, -1);
    lua_pushlstring(l, tbAppendedErrMsg.data(), tbAppendedErrMsg.size());

    return 1;
}

lullbc_Timer::lullbc_Timer(lua_State *l)
: LLBC_Timer(NULL, NULL, lullbc_TimerScheduler::GetLLBCTimerScheduler(l))
, _luaState(l)
, _callableInfo(0)
{
    // Check argument:
{'fraction_non_alphanumeric': 0.13427230046948357, 'fraction_numerical': 0.016901408450704224, 'mean_word_length': 4.520725388601036, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '511319', 'n_tokens_mistral': 871, 'n_tokens_neox': 830, 'n_words': 148}