Dripline-Cpp  v2.4.2
Dripline Implementation in C++
monitor.hh
Go to the documentation of this file.
1 /*
2  * monitor.hh
3  *
4  * Created on: Jul 1, 2019
5  * Author: N.S. Oblath
6  */
7 
8 #ifndef DRIPLINE_MONITOR_HH_
9 #define DRIPLINE_MONITOR_HH_
10 
11 #include "core.hh"
12 #include "listener.hh"
13 #include "receiver.hh"
14 
15 namespace DRIPLINE_API dripline
16 {
17 
39  class monitor :
40  public core,
41  public listener_receiver
42  {
43  protected:
44  enum class status
45  {
46  nothing = 0,
47  channel_created = 10,
48  exchange_declared = 20,
49  queue_declared = 30,
50  queue_bound = 40,
51  consuming = 50,
52  listening = 60
53  };
54 
55  public:
56  monitor( const scarab::param_node& a_config = scarab::param_node() );
57  monitor( const monitor& ) = delete;
58  monitor( monitor&& a_orig );
59  virtual ~monitor();
60 
61  monitor& operator=( const monitor& ) = delete;
62  monitor& operator=( monitor&& a_orig );
63 
64  mv_accessible( status, status );
65 
67  mv_referrable( std::string, name );
68 
71  mv_accessible( bool, json_print );
73  mv_accessible( bool, pretty_print );
74 
75  typedef std::vector< std::string > keys_t;
77  mv_referrable( keys_t, requests_keys );
79  mv_referrable( keys_t, alerts_keys );
80 
81  public:
83  bool start();
84 
86  bool listen();
87 
89  bool stop();
90 
91  protected:
92  bool bind_keys();
93 
94  public:
96  virtual bool listen_on_queue();
97 
100  virtual void submit_message( message_ptr_t a_message );
101  };
102 
103 } /* namespace dripline */
104 
105 #endif /* DRIPLINE_MONITOR_HH_ */
Listens for messages sent to a particular set of keys and prints them.
Definition: monitor.hh:39
std::vector< std::string > keys_t
Definition: monitor.hh:75
#define DRIPLINE_API
Definition: dripline_api.hh:34
Convenience class to bring together listener and concurrent_receiver.
Definition: listener.hh:75
Basic AMQP interactions, including sending messages and interacting with AMQP channels.
Definition: core.hh:72
std::shared_ptr< message > message_ptr_t
Definition: dripline_fwd.hh:20