lichao
2021-04-02 83085f2ce99cca05d40a19482151873a55e6393a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * =====================================================================================
 *
 *       Filename:  center.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2021年03月30日 16时22分24秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Li Chao (), 
 *   Organization:  
 *
 * =====================================================================================
 */
#ifndef CENTER_TM9OUQTG
#define CENTER_TM9OUQTG
 
#include "socket.h"
#include <functional>
 
class BHCenter
{
    typedef ShmSocket Socket;
 
public:
    typedef std::function<bool(ShmSocket &socket, bhome_msg::MsgI &imsg, bhome::msg::BHMsg &msg)> MsgHandler;
 
    BHCenter(Socket::Shm &shm);
    BHCenter();
    ~BHCenter() { Stop(); }
    bool Start();
    bool Stop() { return socket_.Stop(); }
 
private:
    ShmSocket socket_;
};
 
#endif // end of include guard: CENTER_TM9OUQTG