23#ifndef GCS_PLUGIN_MESSAGES_INCLUDED
24#define GCS_PLUGIN_MESSAGES_INCLUDED
254 const unsigned char *
buffer,
const unsigned char **payload_item_data,
255 size_t *payload_item_length);
273 const unsigned char *
buffer,
const unsigned char *
end,
274 uint16 payload_item_type,
const unsigned char **payload_item_data,
275 unsigned long long *payload_item_length);
304 const uint16 timestamp_payload_item_type);
337 const unsigned char *
end) = 0;
347 std::vector<unsigned char> *
buffer,
uint16 payload_item_type,
348 unsigned long long payload_item_length)
const;
358 const unsigned char **
buffer,
uint16 *payload_item_type,
359 unsigned long long *payload_item_length);
370 unsigned char value)
const;
460 unsigned long long length)
const;
473 unsigned long long *
length);
486 unsigned long long length)
const;
498 unsigned char *value,
499 unsigned long long *
length);
This is the base GCS plugin message.
Definition: gcs_plugin_messages.h:63
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:258
enum_cargo_type get_cargo_type() const
Definition: gcs_plugin_messages.h:212
void encode(std::vector< unsigned char > *buffer) const
Encodes the contents of this instance into the buffer.
Definition: gcs_plugin_messages.cc:77
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:198
static const int PLUGIN_GCS_MESSAGE_VERSION
The protocol version number.
Definition: gcs_plugin_messages.h:68
int m_version
This header instance protocol version.
Definition: gcs_plugin_messages.h:179
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:308
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:127
void encode_header(std::vector< unsigned char > *buffer) const
Encodes the header of this instance into the buffer.
Definition: gcs_plugin_messages.cc:55
unsigned long long get_msg_length()
Definition: gcs_plugin_messages.h:217
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:248
unsigned short get_header_length()
Definition: gcs_plugin_messages.h:207
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:103
enum_cargo_type
The different cargo type codes.
Definition: gcs_plugin_messages.h:115
@ CT_TRANSACTION_MESSAGE
Definition: gcs_plugin_messages.h:124
@ CT_CERTIFICATION_MESSAGE
Definition: gcs_plugin_messages.h:121
@ CT_RECOVERY_MESSAGE
Definition: gcs_plugin_messages.h:128
@ CT_RECOVERY_METADATA_MESSAGE
Definition: gcs_plugin_messages.h:169
@ CT_TRANSACTION_WITH_GUARANTEE_MESSAGE
Definition: gcs_plugin_messages.h:159
@ CT_GROUP_ACTION_MESSAGE
Definition: gcs_plugin_messages.h:148
@ CT_SINGLE_PRIMARY_MESSAGE
Definition: gcs_plugin_messages.h:144
@ CT_MAX
Definition: gcs_plugin_messages.h:172
@ CT_SYNC_BEFORE_EXECUTION_MESSAGE
Definition: gcs_plugin_messages.h:156
@ CT_MEMBER_INFO_MESSAGE
Definition: gcs_plugin_messages.h:132
@ CT_TRANSACTION_PREPARED_MESSAGE
Definition: gcs_plugin_messages.h:162
@ CT_UNKNOWN
Definition: gcs_plugin_messages.h:117
@ CT_MESSAGE_SERVICE_MESSAGE
Definition: gcs_plugin_messages.h:166
@ CT_MEMBER_INFO_MANAGER_MESSAGE
Definition: gcs_plugin_messages.h:136
@ CT_GROUP_VALIDATION_MESSAGE
Definition: gcs_plugin_messages.h:152
@ CT_PIPELINE_STATS_MEMBER_MESSAGE
Definition: gcs_plugin_messages.h:140
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:98
static const unsigned int WIRE_FIXED_HEADER_SIZE
The on-the-wire size of the fixed header.
Definition: gcs_plugin_messages.h:93
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:108
enum_cargo_type m_cargo_type
The cargo type code.
Definition: gcs_plugin_messages.h:194
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:327
static int64_t get_sent_timestamp(const unsigned char *buffer, size_t length, const uint16 timestamp_payload_item_type)
Return the time at which the message contained in the buffer was sent.
Definition: gcs_plugin_messages.cc:169
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:317
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:237
static const unsigned int WIRE_MSG_LEN_SIZE
The on-the-wire size of the message size field.
Definition: gcs_plugin_messages.h:83
int get_version()
Definition: gcs_plugin_messages.h:202
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:103
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:288
static bool get_payload_item_type_raw_data(const unsigned char *buffer, const unsigned char *end, uint16 payload_item_type, const unsigned char **payload_item_data, unsigned long long *payload_item_length)
Return the raw data of the payload item of a given payload type of a given message buffer.
Definition: gcs_plugin_messages.cc:139
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:214
static const unsigned int WIRE_HD_LEN_SIZE
The on-the-wire size of the header length field.
Definition: gcs_plugin_messages.h:78
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:268
unsigned long long m_msg_len
This is the message length field.
Definition: gcs_plugin_messages.h:189
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:226
static const unsigned int WIRE_VERSION_SIZE
The protocol version number.
Definition: gcs_plugin_messages.h:73
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:278
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:337
unsigned short m_fixed_header_len
This header instance length.
Definition: gcs_plugin_messages.h:184
static const unsigned int WIRE_CARGO_TYPE_SIZE
The on-the-wire size of the cargo type field.
Definition: gcs_plugin_messages.h:88
Plugin_gcs_message(enum_cargo_type cargo_type)
Plugin_gcs_message constructor.
Definition: gcs_plugin_messages.cc:49
static 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:298
void decode_header(const unsigned char **slider)
Decodes the header of the buffer into this instance.
Definition: gcs_plugin_messages.cc:84
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
uint64_t uint64
Definition: my_inttypes.h:68
uint16_t uint16
Definition: my_inttypes.h:64
uint32_t uint32
Definition: my_inttypes.h:66
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:75
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:417
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:191
required string type
Definition: replication_group_member_actions.proto:33