<commit_before>﻿extern "C"
{
#include "eal/lmice_eal_common.h"
#include "eal/lmice_eal_hash.h"
#include "eal/lmice_eal_shm.h"
#include "eal/lmice_eal_event.h"
#include "eal/lmice_trace.h"
#include "eal/lmice_eal_thread.h"
#include "eal/lmice_eal_spinlock.h"

}

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

class lmice_resource
{
public:
    void* operator() () const
    {
        return m_ptr;
    }
private:
    void* m_ptr;
    int size;
};

class lmice_event_callback
{
public:
    virtual ~lmice_event_callback() {}
    virtual int operator() (void* pdata) = 0;
};

#define MAX_CLIENT_COUNT 200
#define ALL_INSTANCE (const char*)0
enum lmice_common
{
    TICK_NOW = 0,
    TIMER_NOW = 0,
    NO_TRUST_COMPUTION_SUPPORT = 0,
    NO_QOS_SUPPORT=0,
    DEFAULT_SESSION_ID = 0,
    PUBLISH_TYPE = 1,
    SUBSCRIBE_TYPE = 2,
    FREE_RESOURCE = 0,
    MODIFY_RESOURCE = 1,
    WORK_RESOURCE = 2,
    TICKER_TYPE = 1,
    TIMER_TYPE = 2,
    CUSTOM_TYPE = 3,
    INFINITY = -1
};

struct lmice_instance_info_s
{
    uint32_t version;
    uint32_t size;

    uint64_t process_id;    //system process id
    uint64_t instance_id;   //client or server instance identity
};

typedef struct lmice_instance_info_s lmice_instance_info_t;

struct lmice_time_s
{
    int64_t system_time;
    int64_t tick_rate;
    int64_t tick_time;
    int64_t tick_zero_system_time;
};
typedef struct lmice_time_s lmice_time_t;

struct lmice_server_info_s
{
    uint64_t lock;
    uint64_t eid;
    lmice_time_t tm;
    lmice_instance_info_t inst[MAX_CLIENT_COUNT];

};

typedef struct lmice_server_info_s lmice_server_info_t;

struct lmice_resource_s
{
    int32_t         type;   //publish subscribe
    int32_t         state;  // 0 freed 1 using
    lmice_shm_t     shm;
    lmice_event_t   evt;
};
typedef struct lmice_resource_s lmice_resource_t;

struct lmice_timer_s
{
    int32_t type;                   //ticker timer
    int32_t state;                  // 状态
    int32_t size;                   // 触发计数量
    int32_t tick;                   // 周期长度
    lmice_event_t   evt;            // 响应事件

    // 状态量
    int64_t count;                  // 已完成触发数量
    int64_t begin_tick;             // 开始时间
};
typedef struct lmice_timer_s lmice_timer_t;

struct lmice_custom_event_s
{
    int32_t state;
    int32_t size;
    uint64_t evts[16];
    lmice_event_t evt;
};
typedef struct lmice_custom_event_s lmice_custom_event_t;<commit_msg>example1<commit_after>﻿extern "C"
{
#include "eal/lmice_eal_common.h"
#include "eal/lmice_eal_hash.h"
#include "eal/lmice_eal_shm.h"
#include "eal/lmice_eal_event.h"
#include "eal/lmice_trace.h"
#include "eal/lmice_eal_thread.h"
#include "eal/lmice_eal_spinlock.h"

}

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

class lmice_resource
{
public:
    void* operator() () const
    {
        return m_ptr;
    }
private:
    void* m_ptr;
    int size;
};

class lmice_event_callback
{
public:
    virtual ~lmice_event_callback() {}
    virtual int operator() (void* pdata) = 0;
};

#define MAX_CLIENT_COUNT 200
#define ALL_INSTANCE (const char*)0
enum lmice_common
{
    TICK_NOW = 0,
    TIMER_NOW = 0,
    NO_TRUST_COMPUTION_SUPPORT = 0,
    NO_QOS_SUPPORT=0,
    DEFAULT_SESSION_ID = 0,
    PUBLISH_TYPE = 1,
    SUBSCRIBE_TYPE = 2,
    FREE_RESOURCE = 0,
    MODIFY_RESOURCE = 1,
    WORK_RESOURCE = 2,
    TICKER_TYPE = 1,
    TIMER_TYPE = 2,
    CUSTOM_TYPE = 3,
    INFINITY = -1,

    PUBLISH_RESOURCE_TYPE = 1,
    SUBSCRIBE_RESOURCE_TYPE = 2,
    TIMER_EVENT_TYPE = 3,
    TICKER_EVENT_TYPE = 4,
    CUSTOM_EVENT_TYPE = 5,
    QOS_CONTROL_TYPE = 6,
    TRUST_CONTROL_TYPE
};

struct lmice_instance_info_s
{
    uint32_t version;
    uint32_t size;

    uint64_t process_id;    //system process id
    uint64_t instance_id;   //client or server instance identity
};

typedef struct lmice_instance_info_s lmice_instance_info_t;

struct lmice_time_s
{
    int64_t system_time;
    int64_t tick_rate;
    int64_t tick_time;
    int64_t tick_zero_system_time;
};
typedef struct lmice_time_s lmice_time_t;

struct lmice_server_info_s
{
    uint64_t lock;
    uint64_t eid;
    lmice_time_t tm;
    lmice_instance_info_t inst[MAX_CLIENT_COUNT];

};

typedef struct lmice_server_info_s lmice_server_info_t;

struct lmice_resource_s
{
    int32_t         type;   // publish subscribe
    uint32_t        size;   // struct size(bytes)
    int32_t         state;  // 0 freed 1 modify 2 work
    int64_t         time;   // state lock time
    lmice_shm_t     shm;
    lmice_event_t   evt;
};
typedef struct lmice_resource_s lmice_resource_t;

struct lmice_timer_s
{
    int32_t type;                   //ticker timer
    int32_t state;                  // 状态
    int32_t size;                   // 触发计数量
    int32_t tick;                   // 周期长度
    lmice_event_t   evt;            // 响应事件

    // 状态量
    int64_t count;                  // 已完成触发数量
    int64_t begin_tick;             // 开始时间
};
typedef struct lmice_timer_s lmice_timer_t;

struct lmice_custom_event_s
{
    int32_t state;
    int32_t size;
    uint64_t evts[16];
    lmice_event_t evt;
};
typedef struct lmice_custom_event_s lmice_custom_event_t;
{'fraction_non_alphanumeric': 0.08242823894491855, 'fraction_numerical': 0.027540729247478666, 'mean_word_length': 2.726156069364162, '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': '2324663', 'n_tokens_mistral': 2253, 'n_tokens_neox': 2116, 'n_words': 413}