1 #ifndef SMQTTTOPIC_FILE
2 #define SMQTTTOPIC_FILE
4 #define SINGLE_LEVEL_WILDCARD "+"
5 #define TOPIC_LEVEL_SEPARATOR "/"
6 #define MULTI_LEVEL_WILDCARD "#"
14 sMQTTTopic(
const char *name,
unsigned short nameLen,
const char *payload,
unsigned short payloadLen);
15 sMQTTTopic(std::string &name,std::string &payload,
char QoS=0);
22 _name = other->Name();
26 _payload =
new char[strlen(other->Payload()) + 1];
27 strcpy(_payload, other->Payload());
36 const char *Payload() {
39 const unsigned char QoS() {
43 bool match(
const std::string &other);
46 sMQTTClientList::iterator cli;
for (cli = clients.begin(); cli != clients.end(); cli++)
if (*cli == client) { clients.erase(cli);
break; }
47 return clients.empty();
49 const sMQTTClientList getSubscribeList() {
56 unsigned short _payloadLen;
58 sMQTTClientList clients;
61 typedef std::vector<sMQTTTopic*> sMQTTTopicList;