fix8  version 1.4.0
Open Source C++ FIX Framework
zeromq_mbus.hpp
Go to the documentation of this file.
1 //-------------------------------------------------------------------------------------------------
2 /*
3 
4 Fix8 is released under the GNU LESSER GENERAL PUBLIC LICENSE Version 3.
5 
6 Fix8 Open Source FIX Engine.
7 Copyright (C) 2010-16 David L. Dight <fix@fix8.org>
8 
9 Fix8 is free software: you can redistribute it and / or modify it under the terms of the
10 GNU Lesser General Public License as published by the Free Software Foundation, either
11 version 3 of the License, or (at your option) any later version.
12 
13 Fix8 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
14 even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 
16 You should have received a copy of the GNU Lesser General Public License along with Fix8.
17 If not, see <http://www.gnu.org/licenses/>.
18 
19 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO
20 THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
21 COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY
22 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO
24 THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
25 YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
26 
27 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT
28 HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED
29 ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
30 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
31 NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
32 THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
33 HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
34 
35 */
36 //-------------------------------------------------------------------------------------------------
37 #ifndef FIX8_ZEROMQ_MBUS_
38 #define FIX8_ZEROMQ_MBUS_
39 
40 //-------------------------------------------------------------------------------------------------
41 #if defined FIX8_HAS_ZEROMQ_MBUS
42 #include <zmq.hpp>
43 
44 //-------------------------------------------------------------------------------------------------
45 namespace FIX8
46 {
47 
48 //-------------------------------------------------------------------------------------------------
49 namespace MBUS
50 {
51 
52 //-------------------------------------------------------------------------------------------------
54 class ZeromqMessage : public GenericMessage
55 {
56 public:
58  ZeromqMessage() {}
59 
61  virtual ~ZeromqMessage() {}
62 };
63 
64 //-------------------------------------------------------------------------------------------------
66 class ZeromqBusSubscriber : public MessageBusSubscriber
67 {
68 public:
70  ZeromqBusSubscriber() {}
71 
73  virtual ~ZeromqBusSubscriber() {}
74 
76  virtual bool receive_message(const GenericMessage *msg) { return false; }
77 };
78 
79 //-------------------------------------------------------------------------------------------------
81 class ZeromqBus : public MessageBus
82 {
83 public:
85  ZeromqBus() {}
86 
88  virtual ~ZeromqBus() {}
89 
91  virtual bool start() { return true; }
92 
94  virtual bool stop() { return true; }
95 
97  virtual bool publish(const f8String& topic, const ZeromqMessage *msg) { return false; }
98 
100  virtual bool subscribe(MessageBusSubscriber *subscriber, const f8String& topic) { return false; }
101 
103  virtual MessageBusSubscriber *subscribe(const f8String& topic) { return nullptr; }
104 
106  virtual bool unsubscribe(MessageBusSubscriber *subscriber, const f8String& topic) { return false; }
107 };
108 
109 //-------------------------------------------------------------------------------------------------
110 
111 } // MBUS
112 } // FIX8
113 
114 #endif // FIX8_HAS_ZEROMQ_MBUS
115 #endif // FIX8_ZEROMQ_MBUS_
std::string f8String
Definition: f8types.hpp:47