acl  3.5.3.0
acl::mqtt_subscribe类 参考

#include <mqtt_subscribe.hpp>

+ 类 acl::mqtt_subscribe 继承关系图:
+ acl::mqtt_subscribe 的协作图:

Public 成员函数

 mqtt_subscribe (void)
 
 mqtt_subscribe (const mqtt_header &header)
 
 ~mqtt_subscribe (void)
 
mqtt_subscribeset_pkt_id (unsigned short id)
 
mqtt_subscribeadd_topic (const char *topic, mqtt_qos_t qos)
 
unsigned short get_pkt_id (void) const
 
const std::vector< string > & get_topics (void) const
 
const std::vector< mqtt_qos_t > & get_qoses (void) const
 
int update_header_var (const char *data, int dlen)
 
int update_topic_len (const char *data, int dlen)
 
int update_topic_val (const char *data, int dlen)
 
int update_topic_qos (const char *data, int dlen)
 
- Public 成员函数 继承自 acl::mqtt_message
 mqtt_message (mqtt_type_t type)
 
 mqtt_message (const mqtt_header &header)
 
virtual ~mqtt_message (void)
 
mqtt_headerget_header (void)
 
const mqtt_headerget_header (void) const
 

Protected 成员函数

bool to_string (string &out)
 
int update (const char *data, int dlen)
 
bool finished (void) const
 
- Protected 成员函数 继承自 acl::mqtt_message
void pack_add (unsigned char ch, string &out)
 
void pack_add (unsigned short n, string &out)
 
void pack_add (const string &s, string &out)
 
bool unpack_short (const char *data, size_t len, unsigned short &out)
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 acl::mqtt_message
static mqtt_messagecreate_message (const mqtt_header &header)
 
- Protected 属性 继承自 acl::mqtt_message
mqtt_header header_
 

详细描述

mqtt message object for the MQTT_SUBSCRIBE type.

在文件 mqtt_subscribe.hpp10 行定义.

构造及析构函数说明

◆ mqtt_subscribe() [1/2]

acl::mqtt_subscribe::mqtt_subscribe ( void  )

constructor for creating MQTT_SUBSCRIBE mqtt message object.

参见
mqtt_message

◆ mqtt_subscribe() [2/2]

acl::mqtt_subscribe::mqtt_subscribe ( const mqtt_header header)

constructor for creating MQTT_SUBSCRIBE mqtt message object.

参见
mqtt_message

◆ ~mqtt_subscribe()

acl::mqtt_subscribe::~mqtt_subscribe ( void  )

成员函数说明

◆ add_topic()

mqtt_subscribe& acl::mqtt_subscribe::add_topic ( const char *  topic,
mqtt_qos_t  qos 
)

add one topic with its qos.

参数
topic{const char*} the topic of message.
qos{mqtt_qos_t} the qos of the topic.
返回
{mqtt_subscribe&}

◆ finished()

bool acl::mqtt_subscribe::finished ( void  ) const
inlineprotectedvirtual

重载 acl::mqtt_message .

在文件 mqtt_subscribe.hpp73 行定义.

73  {
74  return finished_;
75  }

◆ get_pkt_id()

unsigned short acl::mqtt_subscribe::get_pkt_id ( void  ) const
inline

get the messsage's id.

返回
{unsigned short} should return the value that > 0 && <= 65535.

在文件 mqtt_subscribe.hpp45 行定义.

45  {
46  return pkt_id_;
47  }

◆ get_qoses()

const std::vector<mqtt_qos_t>& acl::mqtt_subscribe::get_qoses ( void  ) const
inline

get all the qoses of all topics.

返回
{const std::vector<mqtt_qos_t>&}

在文件 mqtt_subscribe.hpp61 行定义.

61  {
62  return qoses_;
63  }

◆ get_topics()

const std::vector<string>& acl::mqtt_subscribe::get_topics ( void  ) const
inline

get all the topics.

返回
{const std::vector<string>&}

在文件 mqtt_subscribe.hpp53 行定义.

53  {
54  return topics_;
55  }

◆ set_pkt_id()

mqtt_subscribe& acl::mqtt_subscribe::set_pkt_id ( unsigned short  id)

set message's id

参数
id{unsigned short} should > 0 && <= 65535
返回
{mqtt_subscribe&}

◆ to_string()

bool acl::mqtt_subscribe::to_string ( string out)
protectedvirtual

实现了 acl::mqtt_message.

◆ update()

int acl::mqtt_subscribe::update ( const char *  data,
int  dlen 
)
protectedvirtual

实现了 acl::mqtt_message.

◆ update_header_var()

int acl::mqtt_subscribe::update_header_var ( const char *  data,
int  dlen 
)

◆ update_topic_len()

int acl::mqtt_subscribe::update_topic_len ( const char *  data,
int  dlen 
)

◆ update_topic_qos()

int acl::mqtt_subscribe::update_topic_qos ( const char *  data,
int  dlen 
)

◆ update_topic_val()

int acl::mqtt_subscribe::update_topic_val ( const char *  data,
int  dlen 
)

该类的文档由以下文件生成: