24#ifndef GCS_PLUGIN_MESSAGES_INCLUDED
25#define GCS_PLUGIN_MESSAGES_INCLUDED
252 const unsigned char *
buffer,
const unsigned char **payload_item_data,
253 size_t *payload_item_length);
294 const unsigned char *
end) = 0;
304 std::vector<unsigned char> *
buffer,
uint16 payload_item_type,
305 unsigned long long payload_item_length)
const;
315 const unsigned char **
buffer,
uint16 *payload_item_type,
316 unsigned long long *payload_item_length);
327 unsigned char value)
const;
417 unsigned long long length)
const;
430 unsigned long long *
length);
443 unsigned long long length)
const;
455 unsigned char *value,
456 unsigned long long *
length);
This is the base GCS plugin message.
Definition: gcs_plugin_messages.h:64
void decode_payload_item_int2(const unsigned char **buffer, uint16 *type, uint16 *value)
Decodes the given payload item (type, length and value) from the buffer as a 2 bytes integer.
Definition: gcs_plugin_messages.cc:200
enum_cargo_type get_cargo_type() const
Definition: gcs_plugin_messages.h:210
void encode(std::vector< unsigned char > *buffer) const
Encodes the contents of this instance into the buffer.
Definition: gcs_plugin_messages.cc:78
void encode_payload_item_type_and_length(std::vector< unsigned char > *buffer, uint16 payload_item_type, unsigned long long payload_item_length) const
Encodes the given payload item type and length into the buffer.
Definition: gcs_plugin_messages.cc:140
static const int PLUGIN_GCS_MESSAGE_VERSION
The protocol version number.
Definition: gcs_plugin_messages.h:69
int m_version
This header instance protocol version.
Definition: gcs_plugin_messages.h:177
void encode_payload_item_string(std::vector< unsigned char > *buffer, uint16 type, const char *value, unsigned long long length) const
Encodes the given payload item (type, length and value) into the buffer as a char array (variable siz...
Definition: gcs_plugin_messages.cc:250
static void get_first_payload_item_raw_data(const unsigned char *buffer, const unsigned char **payload_item_data, size_t *payload_item_length)
Return the raw data of the first payload item of a given message buffer, without decode the complete ...
Definition: gcs_plugin_messages.cc:128
void encode_header(std::vector< unsigned char > *buffer) const
Encodes the header of this instance into the buffer.
Definition: gcs_plugin_messages.cc:56
unsigned long long get_msg_length()
Definition: gcs_plugin_messages.h:215
void encode_payload_item_int2(std::vector< unsigned char > *buffer, uint16 type, uint16 value) const
Encodes the given payload item (type, length and value) into the buffer as a 2 bytes integer.
Definition: gcs_plugin_messages.cc:190
unsigned short get_header_length()
Definition: gcs_plugin_messages.h:205
static const unsigned int WIRE_PAYLOAD_ITEM_LEN_SIZE
The on-the-wire size of the each payload item size field.
Definition: gcs_plugin_messages.h:104
enum_cargo_type
The different cargo type codes.
Definition: gcs_plugin_messages.h:116
@ CT_TRANSACTION_MESSAGE
Definition: gcs_plugin_messages.h:125
@ CT_CERTIFICATION_MESSAGE
Definition: gcs_plugin_messages.h:122
@ CT_RECOVERY_MESSAGE
Definition: gcs_plugin_messages.h:129
@ CT_TRANSACTION_WITH_GUARANTEE_MESSAGE
Definition: gcs_plugin_messages.h:160
@ CT_GROUP_ACTION_MESSAGE
Definition: gcs_plugin_messages.h:149
@ CT_SINGLE_PRIMARY_MESSAGE
Definition: gcs_plugin_messages.h:145
@ CT_MAX
Definition: gcs_plugin_messages.h:170
@ CT_SYNC_BEFORE_EXECUTION_MESSAGE
Definition: gcs_plugin_messages.h:157
@ CT_MEMBER_INFO_MESSAGE
Definition: gcs_plugin_messages.h:133
@ CT_TRANSACTION_PREPARED_MESSAGE
Definition: gcs_plugin_messages.h:163
@ CT_UNKNOWN
Definition: gcs_plugin_messages.h:118
@ CT_MESSAGE_SERVICE_MESSAGE
Definition: gcs_plugin_messages.h:167
@ CT_MEMBER_INFO_MANAGER_MESSAGE
Definition: gcs_plugin_messages.h:137
@ CT_GROUP_VALIDATION_MESSAGE
Definition: gcs_plugin_messages.h:153
@ CT_PIPELINE_STATS_MEMBER_MESSAGE
Definition: gcs_plugin_messages.h:141
static const unsigned int WIRE_PAYLOAD_ITEM_TYPE_SIZE
The on-the-wire size of the each payload item type field.
Definition: gcs_plugin_messages.h:99
static const unsigned int WIRE_FIXED_HEADER_SIZE
The on-the-wire size of the fixed header.
Definition: gcs_plugin_messages.h:94
virtual void encode_payload(std::vector< unsigned char > *buffer) const =0
Encodes the contents of this instance payload into the buffer.
static const unsigned int WIRE_PAYLOAD_ITEM_HEADER_SIZE
The on-the-wire size of the payload item header.
Definition: gcs_plugin_messages.h:109
enum_cargo_type m_cargo_type
The cargo type code.
Definition: gcs_plugin_messages.h:192
void encode_payload_item_bytes(std::vector< unsigned char > *buffer, uint16 type, const unsigned char *value, unsigned long long length) const
Encodes the given payload item (type, length and value) into the buffer as a byte buffer (variable si...
Definition: gcs_plugin_messages.cc:269
void decode_payload_item_string(const unsigned char **buffer, uint16 *type, std::string *value, unsigned long long *length)
Decodes the given payload item (type, length and value) from the buffer as a char array (variable siz...
Definition: gcs_plugin_messages.cc:259
static void decode_payload_item_char(const unsigned char **buffer, uint16 *type, unsigned char *value)
Decodes the given payload item (type, length and value) from the buffer as a char (1 byte).
Definition: gcs_plugin_messages.cc:179
static const unsigned int WIRE_MSG_LEN_SIZE
The on-the-wire size of the message size field.
Definition: gcs_plugin_messages.h:84
int get_version()
Definition: gcs_plugin_messages.h:200
void decode(const unsigned char *buffer, size_t length)
Decodes the contents of the buffer and sets the field values according to the values decoded.
Definition: gcs_plugin_messages.cc:104
void encode_payload_item_int8(std::vector< unsigned char > *buffer, uint16 type, ulonglong value) const
Encodes the given payload item (type, length and value) into the buffer as a 8 bytes integer.
Definition: gcs_plugin_messages.cc:230
static void decode_payload_item_type_and_length(const unsigned char **buffer, uint16 *payload_item_type, unsigned long long *payload_item_length)
Decodes the given payload item type and length from the buffer.
Definition: gcs_plugin_messages.cc:156
static const unsigned int WIRE_HD_LEN_SIZE
The on-the-wire size of the header length field.
Definition: gcs_plugin_messages.h:79
void encode_payload_item_int4(std::vector< unsigned char > *buffer, uint16 type, uint32 value) const
Encodes the given payload item (type, length and value) into the buffer as a 4 bytes integer.
Definition: gcs_plugin_messages.cc:210
unsigned long long m_msg_len
This is the message length field.
Definition: gcs_plugin_messages.h:187
virtual ~Plugin_gcs_message()=default
void encode_payload_item_char(std::vector< unsigned char > *buffer, uint16 type, unsigned char value) const
Encodes the given payload item (type, length and value) into the buffer as a char (1 byte).
Definition: gcs_plugin_messages.cc:168
static const unsigned int WIRE_VERSION_SIZE
The protocol version number.
Definition: gcs_plugin_messages.h:74
void decode_payload_item_int4(const unsigned char **buffer, uint16 *type, uint32 *value)
Decodes the given payload item (type, length and value) from the buffer as a 4 bytes integer.
Definition: gcs_plugin_messages.cc:220
virtual void decode_payload(const unsigned char *buffer, const unsigned char *end)=0
Decodes the contents of the buffer and sets the payload field values according to the values decoded.
void decode_payload_item_bytes(const unsigned char **buffer, uint16 *type, unsigned char *value, unsigned long long *length)
Decodes the given payload item (type, length and value) from the buffer as a byte buffer (variable si...
Definition: gcs_plugin_messages.cc:279
unsigned short m_fixed_header_len
This header instance length.
Definition: gcs_plugin_messages.h:182
static const unsigned int WIRE_CARGO_TYPE_SIZE
The on-the-wire size of the cargo type field.
Definition: gcs_plugin_messages.h:89
Plugin_gcs_message(enum_cargo_type cargo_type)
Plugin_gcs_message constructor.
Definition: gcs_plugin_messages.cc:50
void decode_payload_item_int8(const unsigned char **buffer, uint16 *type, uint64 *value)
Decodes the given payload item (type, length and value) from the buffer as a 8 bytes integer.
Definition: gcs_plugin_messages.cc:240
void decode_header(const unsigned char **slider)
Decodes the header of the buffer into this instance.
Definition: gcs_plugin_messages.cc:85
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint64_t uint64
Definition: my_inttypes.h:69
uint16_t uint16
Definition: my_inttypes.h:65
uint32_t uint32
Definition: my_inttypes.h:67
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:420
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
required string type
Definition: replication_group_member_actions.proto:34