mqttidgenerator.h
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef OSDEV_COMPONENTS_MQTT_MLOGICIDGENERATOR_H
#define OSDEV_COMPONENTS_MQTT_MLOGICIDGENERATOR_H
// std
#include <string>
// osdev::components::mqtt
#include "commondefs.h"
namespace osdev {
namespace components {
namespace mqtt {
class MqttIdGenerator
{
public:
/**
* @brief Generates a new MqttId, which is guaranteed to be unique.
* @return A new unique MqttId.
*/
static MqttId generate();
/**
* @brief Returns an MqttId that represents null.
* @return An MqttId that represents null.
*/
static MqttId nullId();
/**
* @brief Returns an MqttId based on a namespace uuid and a given string.
* @param namespaceUuid The namespace in which the MqttId is generated.
* @param name The name for which an MqttId is generated.
*/
static MqttId nameId(MqttId namespaceUuid, const std::string& name);
/**
* @brief Returns an MqttId in the MQTT namespace for a given string.
* @param name The name for which an MqttId is generated.
*/
static MqttId nameId(const std::string& name);
};
} // End namespace mqtt
} // End namespace components
} // End namespace osdev
#endif // OSDEV_COMPONENTS_MQTT_MLOGICIDGENERATOR_H