From 52ce9893a71311c46d4e9ba14ef2a98b3b715e36 Mon Sep 17 00:00:00 2001 From: fujuntang <fujuntang@smartai.com> Date: 星期日, 26 九月 2021 21:57:24 +0800 Subject: [PATCH] trival version: need confirm whether protobuf can run weil yet. --- src/socket/bus_server_socket.h | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/socket/bus_server_socket.h b/src/socket/bus_server_socket.h index e60c700..ec0e42f 100644 --- a/src/socket/bus_server_socket.h +++ b/src/socket/bus_server_socket.h @@ -18,6 +18,44 @@ typedef std::set<int, std::less<int>, SHM_STL_Allocator<int> > SHMKeySet; typedef std::map<SHMString, SHMKeySet *, std::less<SHMString>, SHM_STL_Allocator<std::pair<const SHMString, SHMKeySet *> > > SHMTopicSubMap; +typedef struct _LinkNode +{ + int data; + int data_fix; + int count; + + _LinkNode *next; +} LinkNode; + +class list +{ + +private: + + LinkNode *head; + +public: + + list() {head = NULL;}; + + void Insert(int aDate, int bDate); + + void Delete(int Data); + + int dataFixGet(int data); + + int dataGet(int data); + + void dataSet(int data, int val); + + int NodeNum(void); + + int nodeGet(int index); + + LinkNode *getHead() {return head;}; + +}; + class BusServerSocket { private: shm_socket_t *shm_socket; @@ -66,6 +104,7 @@ * @return 0 鎴愬姛锛� 鍏朵粬鍊� 澶辫触鐨勯敊璇爜 */ int start(); + int get_data(int val); /** * 鍋滄bus @@ -73,15 +112,16 @@ * @return 0 鎴愬姛锛� 鍏朵粬鍊� 澶辫触鐨勯敊璇爜 */ int stop(); - - + int check_proc(int val, const void *buf, int len, void **buf_ret, int *len_ret, \ + const struct timespec *timeout, const int flag); + void remove_proc(int val); /** * 鑾峰彇soket key */ int get_key() ; - void _data_remove(int val1, int val2); + void _data_remove(int val); }; -- Gitblit v1.8.0