paho-mqtt-cpp
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 "MQTTAsync.h"
28#include "mqtt/delivery_token.h"
29#include "mqtt/types.h"
30#include <vector>
31#include <memory>
32
33namespace mqtt {
34
36
42{
43public:
45 using ptr_t = std::shared_ptr<callback>;
47 using const_ptr_t = std::shared_ptr<const callback>;
48
52 virtual ~callback() {}
53
60 virtual void connected(const string& /*cause*/) {}
64 virtual void connection_lost(const string& /*cause*/) {}
68 virtual void message_arrived(const_message_ptr /*msg*/) {}
73 virtual void delivery_complete(delivery_token_ptr /*tok*/) {}
74};
75
78
81
83// end namespace mqtt
84}
85
86#endif // __mqtt_callback_h
87
Definition: callback.h:42
std::shared_ptr< const callback > const_ptr_t
Definition: callback.h:47
std::shared_ptr< callback > ptr_t
Definition: callback.h:45
virtual ~callback()
Definition: callback.h:52
virtual void connected(const string &)
Definition: callback.h:60
virtual void connection_lost(const string &)
Definition: callback.h:64
virtual void delivery_complete(delivery_token_ptr)
Definition: callback.h:73
virtual void message_arrived(const_message_ptr)
Definition: callback.h:68
Definition: async_client.h:49
callback::const_ptr_t const_callback_ptr
Definition: callback.h:80
callback::ptr_t callback_ptr
Definition: callback.h:77
message::const_ptr_t const_message_ptr
Definition: message.h:368
delivery_token::ptr_t delivery_token_ptr
Definition: delivery_token.h:125