mirror of
https://github.com/emqx/neuron.git
synced 2026-10-28 22:59:34 +08:00
@@ -123,7 +123,6 @@ set(NEURON_SOURCES
|
||||
src/core/node_manager.c
|
||||
src/core/template_manager.c
|
||||
src/core/storage.c
|
||||
src/adapter/trans_data.c
|
||||
src/adapter/storage.c
|
||||
src/adapter/adapter.c
|
||||
src/adapter/driver/cache.c
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#include <pthread.h>
|
||||
|
||||
#include "utils/log.h"
|
||||
#include "utils/utextend.h"
|
||||
|
||||
#include "trans_data_manager.h"
|
||||
|
||||
typedef struct data_elem {
|
||||
uint64_t ptr;
|
||||
|
||||
neu_msg_t *msg;
|
||||
int64_t timestamp;
|
||||
|
||||
UT_hash_handle hh;
|
||||
} data_elem_t;
|
||||
|
||||
struct neu_td_mgr {
|
||||
pthread_mutex_t mutex;
|
||||
|
||||
data_elem_t *datas;
|
||||
};
|
||||
|
||||
neu_td_mgr_t *neu_td_mgr_create()
|
||||
{
|
||||
struct neu_td_mgr *manager = calloc(1, sizeof(struct neu_td_mgr));
|
||||
|
||||
pthread_mutex_init(&manager->mutex, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void neu_td_mgr_destroy(neu_td_mgr_t *manager)
|
||||
{
|
||||
pthread_mutex_lock(&manager->mutex);
|
||||
data_elem_t *el = NULL, *tmp = NULL;
|
||||
|
||||
HASH_ITER(hh, manager->datas, el, tmp)
|
||||
{
|
||||
HASH_DEL(manager->datas, el);
|
||||
// free msg
|
||||
free(el);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&manager->mutex);
|
||||
pthread_mutex_destroy(&manager->mutex);
|
||||
|
||||
free(manager)
|
||||
}
|
||||
|
||||
void neu_td_mgr_reg(neu_td_mgr_t *manager, neu_msg_t *msg)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void neu_td_mgr_free(neu_td_mgr_t *manager, neu_msg_t *msg)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool neu_td_mgr_exist(neu_td_mgr_t *manager, neu_msg_t *msg)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void neu_td_mgr_recycle(neu_td_mgr_t *manager)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/**
|
||||
* NEURON IIoT System for Industry 4.0
|
||||
* Copyright (C) 2020-2022 EMQ Technologies Co., Ltd All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
**/
|
||||
|
||||
#ifndef _NEU_TRANS_DATA_MANAGER_H_
|
||||
#define _NEU_TRANS_DATA_MANAGER_H_
|
||||
|
||||
#include "base/msg_internal.h"
|
||||
|
||||
typedef struct neu_td_mgr neu_td_mgr_t;
|
||||
|
||||
neu_td_mgr_t *neu_td_mgr_create();
|
||||
|
||||
void neu_td_mgr_destroy(neu_td_mgr_t *manager);
|
||||
|
||||
void neu_td_mgr_reg(neu_td_mgr_t *manager, neu_msg_t *msg);
|
||||
void neu_td_mgr_free(neu_td_mgr_t *manager, neu_msg_t *msg);
|
||||
bool neu_td_mgr_exist(neu_td_mgr_t *manager, neu_msg_t *msg);
|
||||
|
||||
void neu_td_mgr_recycle(neu_td_mgr_t *manager);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user