Paho C++  1.0
The Paho MQTT C++ Client Library
 All Classes Files Functions Variables Typedefs Friends
response_options.h
Go to the documentation of this file.
1 
7 #ifndef __mqtt_response_options_h
8 #define __mqtt_response_options_h
9 
10 #include "MQTTAsync.h"
11 #include "mqtt/token.h"
12 #include "mqtt/delivery_token.h"
13 
14 namespace mqtt {
15 
16 class response_options_test;
17 class delivery_response_options_test;
18 class token_test;
19 
21 // response_options
23 
28 {
30  MQTTAsync_responseOptions opts_;
31 
33  token::weak_ptr_t tok_;
34 
36  friend class async_client;
37  friend class response_options_test;
38  friend class token_test;
39 
40 public:
49  response_options(const token_ptr& tok);
54  void set_token(const token_ptr& tok) {
55  tok_ = tok;
56  opts_.context = tok.get();
57  }
58 };
59 
61 // delivery_response_options
63 
69 {
71  MQTTAsync_responseOptions opts_;
72 
75 
77  friend class async_client;
78  friend class delivery_response_options_test;
79 
80 public:
89  delivery_response_options(const delivery_token_ptr& dtok);
94  void set_token(const delivery_token_ptr& dtok) {
95  dtok_ = dtok;
96  opts_.context = dtok.get();
97  }
98 };
99 
101 // end namespace 'mqtt'
102 }
103 
104 #endif // __mqtt_response_options_h
105 
The response options for asynchronous calls targeted at delivery.
Definition: response_options.h:68
Lightweight client for talking to an MQTT server using non-blocking methods that allow an operation t...
Definition: async_client.h:60
void set_token(const token_ptr &tok)
Sets the callback context to a generic token.
Definition: response_options.h:54
std::weak_ptr< token > weak_ptr_t
Weak pointer to an object of this class.
Definition: token.h:157
std::weak_ptr< delivery_token > weak_ptr_t
Weak pointer to an object of this class.
Definition: delivery_token.h:61
void set_token(const delivery_token_ptr &dtok)
Sets the callback context to a delivery token.
Definition: response_options.h:94
Declaration of MQTT delivery_token class.
The response options for various asynchronous calls.
Definition: response_options.h:27
response_options()
Create an empty response object.
delivery_response_options()
Create an empty delivery response object.
Declaration of MQTT token class.