Dripline-Cpp  v2.10.11
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 scarab
16 {
17  class authentication;
18 }
19 
20 namespace DRIPLINE_API dripline
21 {
22 
44  class monitor :
45  public core,
46  public listener_receiver
47  {
48  protected:
49  enum class status
50  {
51  nothing = 0,
52  channel_created = 10,
53  exchange_declared = 20,
54  queue_declared = 30,
55  queue_bound = 40,
56  consuming = 50,
57  listening = 60
58  };
59 
60  public:
61  monitor( const scarab::param_node& a_config, const scarab::authentication& a_auth );
62  monitor( const monitor& ) = delete;
63  monitor( monitor&& a_orig ) = default;
64  virtual ~monitor();
65 
66  monitor& operator=( const monitor& ) = delete;
67  monitor& operator=( monitor&& a_orig ) = default;
68 
69  mv_accessible( status, status );
70 
72  mv_referrable( std::string, name );
73 
76  mv_accessible( bool, json_print );
78  mv_accessible( bool, pretty_print );
79 
80  typedef std::vector< std::string > keys_t;
82  mv_referrable( keys_t, requests_keys );
84  mv_referrable( keys_t, alerts_keys );
85 
86  public:
88  bool start();
89 
91  bool listen();
92 
94  bool stop();
95 
96  protected:
97  bool bind_keys();
98 
99  public:
102  virtual bool listen_on_queue();
103 
106  virtual void submit_message( message_ptr_t a_message );
107  };
108 
109 } /* namespace dripline */
110 
111 #endif /* DRIPLINE_MONITOR_HH_ */
Basic AMQP interactions, including sending messages and interacting with AMQP channels.
Definition: core.hh:75
Convenience class to bring together listener and concurrent_receiver.
Definition: listener.hh:77
Listens for messages sent to a particular set of keys and prints them.
Definition: monitor.hh:47
std::vector< std::string > keys_t
Definition: monitor.hh:80
monitor & operator=(const monitor &)=delete
monitor(const monitor &)=delete
monitor & operator=(monitor &&a_orig)=default
monitor(monitor &&a_orig)=default
#define DRIPLINE_API
Definition: dripline_api.hh:34
std::shared_ptr< message > message_ptr_t
Definition: dripline_fwd.hh:20
Definition: agent.hh:18