PahoMqttCpp
MQTT C++ Client for POSIX and Windows
Loading...
Searching...
No Matches
callback.h
Go to the documentation of this file.
1
7
8/*******************************************************************************
9 * Copyright (c) 2013-2019 Frank Pagliughi <fpagliughi@mindspring.com>
10 *
11 * All rights reserved. This program and the accompanying materials
12 * are made available under the terms of the Eclipse Public License v2.0
13 * and Eclipse Distribution License v1.0 which accompany this distribution.
14 *
15 * The Eclipse Public License is available at
16 * http://www.eclipse.org/legal/epl-v20.html
17 * and the Eclipse Distribution License is available at
18 * http://www.eclipse.org/org/documents/edl-v10.php.
19 *
20 * Contributors:
21 * Frank Pagliughi - initial implementation and documentation
22 *******************************************************************************/
23
24#ifndef __mqtt_callback_h
25#define __mqtt_callback_h
26
27#include <memory>
28#include <vector>
29
30#include "MQTTAsync.h"
31#include "mqtt/delivery_token.h"
32#include "mqtt/types.h"
33
34namespace mqtt {
35
37
43{
44public:
46 using ptr_t = std::shared_ptr<callback>;
48 using const_ptr_t = std::shared_ptr<const callback>;
49
53 virtual ~callback() {}
54
61 virtual void connected(const string& /*cause*/) {}
65 virtual void connection_lost(const string& /*cause*/) {}
69 virtual void message_arrived(const_message_ptr /*msg*/) {}
74 virtual void delivery_complete(delivery_token_ptr /*tok*/) {}
75};
76
79
82
84} // namespace mqtt
85
86#endif // __mqtt_callback_h
Definition callback.h:43
std::shared_ptr< const callback > const_ptr_t
Definition callback.h:48
std::shared_ptr< callback > ptr_t
Definition callback.h:46
virtual ~callback()
Definition callback.h:53
virtual void connected(const string &)
Definition callback.h:61
virtual void connection_lost(const string &)
Definition callback.h:65
virtual void delivery_complete(delivery_token_ptr)
Definition callback.h:74
virtual void message_arrived(const_message_ptr)
Definition callback.h:69
Definition async_client.h:60
callback::const_ptr_t const_callback_ptr
Definition callback.h:81
callback::ptr_t callback_ptr
Definition callback.h:78
message::const_ptr_t const_message_ptr
Definition message.h:378
delivery_token::ptr_t delivery_token_ptr
Definition delivery_token.h:127