Free Electron
ZeroCatalog_czmq.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __zeromq_ZeroCatalog_h__
8 #define __zeromq_ZeroCatalog_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Catalog over ZeroMQ
17 
18  @ingroup zeromq
19 *//***************************************************************************/
20 class FE_DL_EXPORT ZeroCatalog:
21  public ConnectedCatalog,
22  public Initialize<ZeroCatalog>
23 {
24  public:
25 
26  ZeroCatalog(void);
27 virtual ~ZeroCatalog(void);
28 
29  void initialize(void);
30 
31 virtual Result connectAsServer(short a_port);
32 virtual Result connectAsClient(String a_address,short a_port);
33 
34 virtual void broadcast(String a_name,String a_property);
35 
36 virtual Result disconnect(void);
37 
38  private:
39 
40  class FE_DL_EXPORT ReceiverTask: public Thread::Functor
41  {
42  public:
43  ReceiverTask(void):
44  m_terminate(FALSE) {}
45 virtual void operate(void);
46 
47  hp<ZeroCatalog> m_hpZeroCatalog;
48  zsock_t* m_pSocket;
49  BWORD m_terminate;
50  };
51 
52  Thread* m_pReceiverThread;
53  ReceiverTask m_receiverTask;
54 
55  String m_endpoint;
56  zsock_t* m_pSocket;
57  zframe_t* m_pMsgID;
58 };
59 
60 } /* namespace ext */
61 } /* namespace fe */
62 
63 #endif /* __zeromq_ZeroCatalog_h__ */
kernel
Definition: namespace.dox:3
Result
Generalized return value indicating success or failure, and why.
Definition: Result.h:24