void BlackBoardInterfaceListContent::serialize() { _payload_size = sizeof(msg) + interface_list->buffer_size(); _payload = malloc(_payload_size); copy_payload(0, &msg, sizeof(msg)); copy_payload(sizeof(msg), interface_list->buffer(), interface_list->buffer_size()); }
void PluginListMessage::serialize() { _payload_size = sizeof(msg) + plugin_list->buffer_size(); _payload = malloc(_payload_size); copy_payload(0, &msg, sizeof(msg)); copy_payload(sizeof(msg), plugin_list->buffer(), plugin_list->buffer_size()); }
message& message::operator=(const message& rhs) { if (&rhs == this) return *this; delete[] (char*) msg_.payload; msg_ = rhs.msg_; copy_payload(rhs.msg_.payload, rhs.msg_.payloadlen); return *this; }
void operator()(U & element) { copy_payload(element, out_); }
tuple_t* make_tuple(int something, payload_t* payload) { tuple_t *tuple = malloc(sizeof(tuple_t)); tuple->something = something; tuple->payload = copy_payload(payload); return tuple; }
message::message(const message& other) : msg_(other.msg_) { copy_payload(other.msg_.payload, other.msg_.payloadlen); }
message::message(const MQTTAsync_message& msg) : msg_(msg) { copy_payload(msg.payload, msg.payloadlen); }
message::message(const std::string& payload) : msg_(MQTTAsync_message_initializer) { copy_payload(payload.data(), payload.length()); }
message::message(const void* payload, size_t len) : msg_(MQTTAsync_message_initializer) { copy_payload(payload, len); }
void message::set_payload(const void* payload, size_t len) { delete[] (char*) msg_.payload; copy_payload(payload, len); }