acl
3.5.3.0
|
#include <mqtt_header.hpp>
Public 成员函数 | |
mqtt_header (mqtt_type_t type) | |
mqtt_header (const mqtt_header &header) | |
virtual | ~mqtt_header (void) |
bool | build_header (string &out) |
int | update (const char *data, int dlen) |
bool | finished (void) const |
void | reset (void) |
mqtt_header & | set_type (mqtt_type_t type) |
mqtt_header & | set_header_flags (char flags) |
mqtt_header & | set_remaing_length (unsigned len) |
mqtt_header & | set_qos (mqtt_qos_t qos) |
mqtt_header & | set_dup (bool yes) |
mqtt_header & | set_remain (bool yes) |
mqtt_type_t | get_type (void) const |
unsigned char | get_header_flags (void) const |
unsigned | get_remaining_length (void) const |
mqtt_qos_t | get_qos (void) const |
bool | is_dup (void) const |
bool | is_remain (void) const |
int | update_header_type (const char *data, int dlen) |
int | update_header_len (const char *data, int dlen) |
mqtt message header class, used for building or parsing mqtt header data.
在文件 mqtt_header.hpp 第 71 行定义.
acl::mqtt_header::mqtt_header | ( | mqtt_type_t | type | ) |
mqtt header constructor, usually for building mqtt message.
type | {mqtt_type_t} |
acl::mqtt_header::mqtt_header | ( | const mqtt_header & | header | ) |
mqtt header constructor, usually for parsing mqtt message.
header | {const mqtt_header&} will be copied internal. |
|
virtual |
bool acl::mqtt_header::build_header | ( | string & | out | ) |
build mqtt header data after initializing the header object by calling the setting methods below like set_xxx.
out | {string&} store mqtt header data. |
|
inline |
|
inline |
mqtt_qos_t acl::mqtt_header::get_qos | ( | void | ) | const |
get the mqtt message's qos.
|
inline |
|
inline |
bool acl::mqtt_header::is_dup | ( | void | ) | const |
check if the duplicated flag has been set in header.
bool acl::mqtt_header::is_remain | ( | void | ) | const |
check if the remain flag has been set in header.
void acl::mqtt_header::reset | ( | void | ) |
reset the status of the mqtt header object for reusing the object.
mqtt_header& acl::mqtt_header::set_dup | ( | bool | yes | ) |
mqtt_header& acl::mqtt_header::set_header_flags | ( | char | flags | ) |
mqtt_header& acl::mqtt_header::set_qos | ( | mqtt_qos_t | qos | ) |
mqtt_header& acl::mqtt_header::set_remain | ( | bool | yes | ) |
mqtt_header& acl::mqtt_header::set_remaing_length | ( | unsigned | len | ) |
mqtt_header& acl::mqtt_header::set_type | ( | mqtt_type_t | type | ) |
int acl::mqtt_header::update | ( | const char * | data, |
int | dlen | ||
) |
parsing mqtt header data in streaming mode.
data | {const char*} the mqtt header data, not NULL. |
dlen | {int} the length of data, must > 0 |
be used as mqtt body or next mqtt message; 0: the data input has been consumed, you can call finished() to check if the mqtt header has completed. -1: some error happened when parsing the input data.0: the header has completed and the length of left data can
int acl::mqtt_header::update_header_len | ( | const char * | data, |
int | dlen | ||
) |
int acl::mqtt_header::update_header_type | ( | const char * | data, |
int | dlen | ||
) |