Dripline-Cpp  v2.4.2
Dripline Implementation in C++
oscillator_service_endpoints.hh
Go to the documentation of this file.
1 /*
2  * oscillator_service_endpoints.hh
3  *
4  * Created on: May 20, 2019
5  * Author: N.S. Oblath
6  *
7  * Comment by the author: this class is a premier example of why it's annoying to make a software-only service
8  * using endpoints rather than hub. It would be improved by using something like the provider concept.
9  * As it is, however, we have to set the pointers to the service and derived service class in each endpoint
10  * after the service constructor, and this is done in the added function set_pointers().
11  */
12 
13 #ifndef EXAMPLES_OSCILLATOR_SERVICE_ENDPOINTS_HH_
14 #define EXAMPLES_OSCILLATOR_SERVICE_ENDPOINTS_HH_
15 
16 #include "service.hh"
17 
18 #include "oscillator.hh"
19 
20 namespace dripline
21 {
23  {
24  public:
25  oscillator_service_endpoints( const scarab::param_node& a_config = scarab::param_node() );
27 
28  // annoying pointer initialization that has to be done in this setup _before_ executing
29  void set_pointers();
30 
31  void execute();
32 
33  mv_referrable( class oscillator, oscillator );
34 
35  mv_accessible( int, return );
36  };
37 
38 
40  {
41  public:
42  oscillator_ep( const std::string& a_name );
43  virtual ~oscillator_ep();
44 
45  protected:
48  };
49 
51  {
52  public:
53  oscillator_ep_frequency( const std::string& a_name );
54  virtual ~oscillator_ep_frequency();
55 
56  virtual reply_ptr_t do_get_request( const request_ptr_t a_request );
57  virtual reply_ptr_t do_set_request( const request_ptr_t a_request );
58  };
59 
61  {
62  public:
63  oscillator_ep_amplitude( const std::string& a_name );
64  virtual ~oscillator_ep_amplitude();
65 
66  virtual reply_ptr_t do_get_request( const request_ptr_t a_request );
67  virtual reply_ptr_t do_set_request( const request_ptr_t a_request );
68  };
69 
71  {
72  public:
73  oscillator_ep_in_phase( const std::string& a_name );
74  virtual ~oscillator_ep_in_phase();
75 
76  virtual reply_ptr_t do_get_request( const request_ptr_t a_request );
77  };
78 
80  {
81  public:
82  oscillator_ep_quadrature( const std::string& a_name );
83  virtual ~oscillator_ep_quadrature();
84 
85  virtual reply_ptr_t do_get_request( const request_ptr_t a_request );
86  };
87 
89  {
90  public:
91  oscillator_ep_iq( const std::string& a_name );
92  virtual ~oscillator_ep_iq();
93 
94  virtual reply_ptr_t do_get_request( const request_ptr_t a_request );
95  };
96 
97 } /* namespace dripline */
98 
99 #endif /* EXAMPLES_OSCILLATOR_SERVICE_ENDPOINTS_HH_ */
std::shared_ptr< msg_request > request_ptr_t
Definition: dripline_fwd.hh:23
Consumer of Dripline messages on a particular queue.
Definition: service.hh:72
oscillator_service_endpoints * f_osc_svc
std::shared_ptr< msg_reply > reply_ptr_t
Definition: dripline_fwd.hh:24
#define DRIPLINE_EXAMPLES_API
Definition: dripline_api.hh:35
Basic Dripline object capable of receiving and acting on messages.
Definition: endpoint.hh:95