MySQL 8.3.0
Source Code Documentation
Gcs_xcom_proxy_impl Class Reference

#include <gcs_xcom_proxy.h>

Inheritance diagram for Gcs_xcom_proxy_impl:
[legend]

Public Member Functions

 Gcs_xcom_proxy_impl ()
 
 Gcs_xcom_proxy_impl (unsigned int wt)
 
 ~Gcs_xcom_proxy_impl () override
 
node_address * new_node_address_uuid (unsigned int n, char const *names[], blob uuids[]) override
 This is an utility member function that is used to call into XCom for creating list with node's addresses and their associated UUIDs. More...
 
void delete_node_address (unsigned int n, node_address *na) override
 This function is responsible to delete the list of nodes that had been previously created by new_node_address. More...
 
bool xcom_client_add_node (connection_descriptor *fd, node_list *nl, uint32_t group_id) override
 This member function is responsible to call into XCom consensus and add a node to the group. More...
 
bool xcom_client_remove_node (node_list *nl, uint32_t group_id) override
 This member function is responsible for triggering the removal of a node from the XCom configuration. More...
 
bool xcom_client_remove_node (connection_descriptor *fd, node_list *nl, uint32_t group_id) override
 This member function is responsible for triggering the removal of a node from the XCom configuration. More...
 
bool xcom_client_get_event_horizon (uint32_t group_id, xcom_event_horizon &event_horizon) override
 This member function is responsible for retrieving the event horizon of the XCom configuration. More...
 
bool xcom_client_set_event_horizon (uint32_t group_id, xcom_event_horizon event_horizon) override
 This member function is responsible for triggering the reconfiguration of the event horizon of the XCom configuration. More...
 
bool xcom_client_set_leaders (uint32_t gid, u_int nr_preferred_leaders, char const *preferred_leaders[], node_no max_nr_leaders) override
 This member function is responsible for triggering the reconfiguration of the leaders of the XCom configuration. More...
 
bool xcom_client_get_leaders (uint32_t gid, leader_info_data &leaders) override
 This member function is responsible for retrieving the leaders of the XCom configuration. More...
 
bool xcom_client_get_synode_app_data (connection_descriptor *con, uint32_t group_id_hash, synode_no_array &synodes, synode_app_data_array &reply) override
 This member function is responsible for retrieving the application payloads decided in the synodes in synodes, from the XCom instance connected to via fd. More...
 
bool xcom_client_set_cache_size (uint64_t size) override
 This member function is responsible for setting a new value for the maximum size of the XCom cache. More...
 
bool xcom_client_boot (node_list *nl, uint32_t group_id) override
 This member function boots XCom. More...
 
connection_descriptorxcom_client_open_connection (std::string, xcom_port port) override
 This member function opens a connection to an XCom instance. More...
 
bool xcom_client_close_connection (connection_descriptor *fd) override
 This member function closes the connection to an XCom instance. More...
 
bool xcom_client_send_data (unsigned long long size, char *data) override
 This member function is responsible for pushing data into consensus on XCom. More...
 
void xcom_init (xcom_port listen_port) override
 This member function initializes XCom. More...
 
void xcom_exit () override
 This member function finishes the XCom thread. More...
 
int xcom_get_ssl_mode (const char *mode) override
 
int xcom_get_ssl_fips_mode (const char *mode) override
 
int xcom_set_ssl_fips_mode (int mode) override
 
int xcom_set_ssl_mode (int mode) override
 
bool xcom_init_ssl () override
 Initialize the SSL. More...
 
void xcom_destroy_ssl () override
 
bool xcom_use_ssl () override
 Return whether the SSL will be used to encrypt data or not. More...
 
void xcom_set_ssl_parameters (ssl_parameters ssl, tls_parameters tls) override
 
site_def const * find_site_def (synode_no synode) override
 
enum_gcs_error xcom_wait_ready () override
 This member waits for XCom to be initialized. More...
 
bool xcom_is_ready () override
 
void xcom_set_ready (bool value) override
 
void xcom_signal_ready () override
 
void xcom_wait_for_xcom_comms_status_change (int &status) override
 Call this method to wait for XCom communications to be initialized. More...
 
bool xcom_has_comms_status_changed () override
 
void xcom_set_comms_status (int status) override
 
void xcom_signal_comms_status_changed (int status) override
 
enum_gcs_error xcom_wait_exit () override
 Call this method to wait for XCom to exit. More...
 
bool xcom_is_exit () override
 This verifies if XCom has finished or not. More...
 
void xcom_set_exit (bool value) override
 This sets whether XCom has finished or not. More...
 
void xcom_signal_exit () override
 This modifies the internal cached status and signals all threads that might be waiting on xcom_wait_exit. More...
 
void xcom_set_cleanup () override
 Clean up variables used to notify states in the XCOM's state machine. More...
 
bool xcom_client_force_config (node_list *nl, uint32_t group_id) override
 This method forces XCom to inject a new configuration in the group, even if it does not contain a majority of members. More...
 
bool get_should_exit () override
 Function that retrieves the value that signals that XCom must be forcefully stopped. More...
 
void set_should_exit (bool should_exit) override
 Function that sets the value that signals that XCom must be forcefully stopped. More...
 
bool xcom_input_connect (std::string const &address, xcom_port port) override
 Opens the input channel to XCom. More...
 
void xcom_input_disconnect () override
 Closes the input channel to XCom. More...
 
bool xcom_input_try_push (app_data_ptr data) override
 Attempts to send the command data to XCom. More...
 
Gcs_xcom_input_queue::future_reply xcom_input_try_push_and_get_reply (app_data_ptr data) override
 Attempts to send the command data to XCom, and returns a future to XCom's reply. More...
 
xcom_input_request_ptr xcom_input_try_pop () override
 Attempts to retrieve incoming commands. More...
 
- Public Member Functions inherited from Gcs_xcom_proxy_base
 Gcs_xcom_proxy_base ()=default
 
 ~Gcs_xcom_proxy_base () override=default
 
bool xcom_boot_node (Gcs_xcom_node_information &node, uint32_t group_id_hash) override
 Function used to boot a node in XCOM. More...
 
bool xcom_remove_nodes (Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override
 Function to remove a set of nodes from XCOM. More...
 
bool xcom_remove_nodes (connection_descriptor &con, Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override
 Function to remove a set of nodes from XCOM. More...
 
bool xcom_remove_node (const Gcs_xcom_node_information &node, uint32_t group_id_hash) override
 Function to remove a node from XCOM. More...
 
bool xcom_add_nodes (connection_descriptor &con, Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override
 Function to add a set of nodes to XCOM. More...
 
bool xcom_add_node (connection_descriptor &con, const Gcs_xcom_node_information &node, uint32_t group_id_hash) override
 Function to add a node to XCOM. More...
 
xcom_event_horizon xcom_get_minimum_event_horizon () override
 Function to retrieve XCOM's minimum supported event horizon value. More...
 
xcom_event_horizon xcom_get_maximum_event_horizon () override
 Function to retrieve XCOM's maximum supported event horizon value. More...
 
bool xcom_get_event_horizon (uint32_t group_id_hash, xcom_event_horizon &event_horizon) override
 Function to retrieve XCOM's event horizon. More...
 
bool xcom_set_event_horizon (uint32_t group_id_hash, xcom_event_horizon event_horizon) override
 Function to reconfigure XCOM's event horizon. More...
 
bool xcom_set_leaders (uint32_t group_id_hash, u_int nr_preferred_leaders, char const *preferred_leaders[], node_no max_nr_leaders) override
 
bool xcom_get_leaders (uint32_t group_id_hash, leader_info_data &leaders) override
 
bool xcom_get_synode_app_data (Gcs_xcom_node_information const &xcom_instance, uint32_t group_id_hash, const std::unordered_set< Gcs_xcom_synode > &synode_set, synode_app_data_array &reply) override
 Function to retrieve the application payloads decided on a set of synodes. More...
 
bool xcom_set_cache_size (uint64_t size) override
 Function to reconfigure the maximum size of the XCom cache. More...
 
bool xcom_force_nodes (Gcs_xcom_nodes &nodes, uint32_t group_id_hash) override
 
bool initialize_network_manager () override
 Initializes XCom's Network Manager. More...
 
bool finalize_network_manager () override
 Finalizes XCom's Network Manager. More...
 
bool set_network_manager_active_provider (enum_transport_protocol new_value) override
 Set XCom's network manager active provider. More...
 
- Public Member Functions inherited from Gcs_xcom_proxy
 Gcs_xcom_proxy ()=default
 
virtual ~Gcs_xcom_proxy ()=default
 The destructor. More...
 
virtual bool xcom_force_nodes (Gcs_xcom_nodes &nodes, unsigned int group_id_hash)=0
 Function to force the set of nodes in XCOM's configuration. More...
 

Private Member Functions

enum_gcs_error xcom_wait_for_condition (My_xp_cond_impl &condition, My_xp_mutex_impl &condition_lock, std::function< bool(void)> need_to_wait, std::function< const std::string(int res)> condition_event)
 
 Gcs_xcom_proxy_impl (Gcs_xcom_proxy_impl const &)
 
Gcs_xcom_proxy_imploperator= (Gcs_xcom_proxy_impl const &)
 

Private Attributes

unsigned int m_wait_time
 
My_xp_mutex_impl m_lock_xcom_ready
 
My_xp_cond_impl m_cond_xcom_ready
 
bool m_is_xcom_ready
 
My_xp_mutex_impl m_lock_xcom_comms_status
 
My_xp_cond_impl m_cond_xcom_comms_status
 
int m_xcom_comms_status
 
My_xp_mutex_impl m_lock_xcom_exit
 
My_xp_cond_impl m_cond_xcom_exit
 
bool m_is_xcom_exit
 
My_xp_socket_utilm_socket_util
 
int m_ssl_mode
 
const char * m_server_key_file
 
const char * m_server_cert_file
 
const char * m_client_key_file
 
const char * m_client_cert_file
 
const char * m_ca_file
 
const char * m_ca_path
 
const char * m_crl_file
 
const char * m_crl_path
 
const char * m_cipher
 
const char * m_tls_version
 
const char * m_tls_ciphersuites
 
std::atomic_bool m_should_exit
 
Gcs_xcom_input_queue m_xcom_input_queue
 

Constructor & Destructor Documentation

◆ Gcs_xcom_proxy_impl() [1/3]

Gcs_xcom_proxy_impl::Gcs_xcom_proxy_impl ( )
explicit

◆ Gcs_xcom_proxy_impl() [2/3]

Gcs_xcom_proxy_impl::Gcs_xcom_proxy_impl ( unsigned int  wt)

◆ ~Gcs_xcom_proxy_impl()

Gcs_xcom_proxy_impl::~Gcs_xcom_proxy_impl ( )
override

◆ Gcs_xcom_proxy_impl() [3/3]

Gcs_xcom_proxy_impl::Gcs_xcom_proxy_impl ( Gcs_xcom_proxy_impl const &  )
private

Member Function Documentation

◆ delete_node_address()

void Gcs_xcom_proxy_impl::delete_node_address ( unsigned int  n,
node_address *  na 
)
overridevirtual

This function is responsible to delete the list of nodes that had been previously created by new_node_address.

Parameters
nthe length of the list
nathe list to delete

Implements Gcs_xcom_proxy.

◆ find_site_def()

site_def const * Gcs_xcom_proxy_impl::find_site_def ( synode_no  synode)
overridevirtual

Implements Gcs_xcom_proxy.

◆ get_should_exit()

bool Gcs_xcom_proxy_impl::get_should_exit ( )
overridevirtual

Function that retrieves the value that signals that XCom must be forcefully stopped.

Returns
1 if XCom needs to forcefully exit. 0 otherwise.

Implements Gcs_xcom_proxy.

◆ new_node_address_uuid()

node_address * Gcs_xcom_proxy_impl::new_node_address_uuid ( unsigned int  n,
char const *  names[],
blob  uuids[] 
)
overridevirtual

This is an utility member function that is used to call into XCom for creating list with node's addresses and their associated UUIDs.

Note that callers must provide the UUID.

Parameters
nThe number of elements in the list
namesThe names to be put on the list
uuidsThe UUIDs to be put on the list
Returns
a pointer to the list containing all the elements needed. The caller is responsible to reclaim memory once he is done with this data delete_node_address

Implements Gcs_xcom_proxy.

◆ operator=()

Gcs_xcom_proxy_impl & Gcs_xcom_proxy_impl::operator= ( Gcs_xcom_proxy_impl const &  )
private

◆ set_should_exit()

void Gcs_xcom_proxy_impl::set_should_exit ( bool  should_exit)
overridevirtual

Function that sets the value that signals that XCom must be forcefully stopped.

Implements Gcs_xcom_proxy.

◆ xcom_client_add_node()

bool Gcs_xcom_proxy_impl::xcom_client_add_node ( connection_descriptor fd,
node_list *  nl,
uint32_t  group_id 
)
overridevirtual

This member function is responsible to call into XCom consensus and add a node to the group.

The caller is responsible for ensuring that the session has been opened before open_session and also that the node is not yet in the configuration.

The callee must have opened an XCom connection before calling this function. xcom_client_open_connection.

Parameters
fdthe file descriptor to the XCom connection established earlier
nlThe node list containing the list of peers to add
group_idthe identifier of the group to which the nodes should be added
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of adding a node. Since this is basically an asynchronous function, one needs to wait for the actual view change to validate that the node was added to the configuration.

Implements Gcs_xcom_proxy.

◆ xcom_client_boot()

bool Gcs_xcom_proxy_impl::xcom_client_boot ( node_list *  nl,
uint32_t  group_id 
)
overridevirtual

This member function boots XCom.

Parameters
nlList with a single member - the one that boots the group
group_idthe Group identifier to which the member belongs to
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of booting. Since this is basically an asynchronous function, one needs to wait for XCom to signal it is ready to validate whether it booted.

Implements Gcs_xcom_proxy.

◆ xcom_client_close_connection()

bool Gcs_xcom_proxy_impl::xcom_client_close_connection ( connection_descriptor fd)
overridevirtual

This member function closes the connection to an XCom instance.

Parameters
fdThe connection file descriptor
Returns
true (false) on success (failure)

Implements Gcs_xcom_proxy.

◆ xcom_client_force_config()

bool Gcs_xcom_proxy_impl::xcom_client_force_config ( node_list *  nl,
uint32_t  group_id 
)
overridevirtual

This method forces XCom to inject a new configuration in the group, even if it does not contain a majority of members.

Parameters
nlThe list of nodes that will belong to this new configuration
group_idThe identifier of the group from which the nodes will belong
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of forcing the configuration. Since this is basically an asynchronous function, one needs to wait for the actual view change to validate that the configuration was forced.

Implements Gcs_xcom_proxy.

◆ xcom_client_get_event_horizon()

bool Gcs_xcom_proxy_impl::xcom_client_get_event_horizon ( uint32_t  group_id,
xcom_event_horizon &  event_horizon 
)
overridevirtual

This member function is responsible for retrieving the event horizon of the XCom configuration.

This function REQUIRES a prior call to xcom_open_handlers to establish a connection to XCom.

Parameters
[in]group_idThe identifier of the group from which the event horizon will be retrieved
[out]event_horizonA reference to where the group's event horizon value will be written to
Return values
trueif successful and event_horizon was written to
falseotherwise

Implements Gcs_xcom_proxy.

◆ xcom_client_get_leaders()

bool Gcs_xcom_proxy_impl::xcom_client_get_leaders ( uint32_t  group_id,
leader_info_data &  leaders 
)
overridevirtual

This member function is responsible for retrieving the leaders of the XCom configuration.

Parameters
[in]group_idThe identifier of the group
[out]leadersA reference to where the group's leaders will be written to
Return values
trueif successful and leaders was written to
falseotherwise

Implements Gcs_xcom_proxy.

◆ xcom_client_get_synode_app_data()

bool Gcs_xcom_proxy_impl::xcom_client_get_synode_app_data ( connection_descriptor fd,
uint32_t  group_id,
synode_no_array &  synodes,
synode_app_data_array &  reply 
)
overridevirtual

This member function is responsible for retrieving the application payloads decided in the synodes in synodes, from the XCom instance connected to via fd.

Parameters
[in]fdThe file descriptor to the XCom connection established earlier
[in]group_idThe identifier of the group from which the payloads will be retrieved
[in]synodesThe desired synodes
[out]replyWhere the requested payloads will be written to
Returns
true (false) on success (failure). Success means that XCom had the requested payloads, which were written to reply.

Implements Gcs_xcom_proxy.

◆ xcom_client_open_connection()

connection_descriptor * Gcs_xcom_proxy_impl::xcom_client_open_connection ( std::string  addr,
xcom_port  port 
)
overridevirtual

This member function opens a connection to an XCom instance.

Parameters
addrThe XCom instance address
portThe XCom instance port
Returns
a valid file descriptor on success, -1 otherwise

Implements Gcs_xcom_proxy.

◆ xcom_client_remove_node() [1/2]

bool Gcs_xcom_proxy_impl::xcom_client_remove_node ( connection_descriptor fd,
node_list *  nl,
uint32_t  group_id 
)
overridevirtual

This member function is responsible for triggering the removal of a node from the XCom configuration.

This function is asynchronous, so you need to wait for the view change to actually validate that the removal was successful.

The caller is responsible for making sure that the server to be removed is in the group.

The callee must have opened an XCom connection before calling this function. xcom_client_open_connection.

Parameters
fdthe file descriptor to the XCom connection established earlier
nlThe list of nodes to remove from the group
group_idThe identifier of the group from which the nodes will be removed
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of removing a node. Since this is basically an asynchronous function, one needs to wait for the actual view change to validate that the nodes were removed from the configuration.

Implements Gcs_xcom_proxy.

◆ xcom_client_remove_node() [2/2]

bool Gcs_xcom_proxy_impl::xcom_client_remove_node ( node_list *  nl,
uint32_t  group_id 
)
overridevirtual

This member function is responsible for triggering the removal of a node from the XCom configuration.

This function is asynchronous, so you need to wait for the view change to actually validate that the removal was successful.

The caller is responsible for making sure that the server to be removed is in the group.

This function MUST be called after opening the local XCom session xcom_input_connect.

Parameters
nlThe list of nodes to remove from the group
group_idThe identifier of the group from which the nodes will be removed
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of removing a node. Since this is basically an asynchronous function, one needs to wait for the actual view change to validate that the nodes were removed from the configuration.

Implements Gcs_xcom_proxy.

◆ xcom_client_send_data()

bool Gcs_xcom_proxy_impl::xcom_client_send_data ( unsigned long long  size,
char *  data 
)
overridevirtual

This member function is responsible for pushing data into consensus on XCom.

The caller is responsible to making sure that there is an open XCom session xcom_input_connect and also that the server is part of the XCom configuration before sending data to it.

data must have been allocated by one of the functions of the malloc family, because data will be passed on to XCom. XCom is implemented in C and will use free to dispose of data when it is finished with data.

This function takes ownership of data. This means that this function becomes responsible for the lifetime of data. Since this function takes ownership of data, the caller must not interact with data after passing it to this function.

Parameters
sizethe size of the payload
datathe payload
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't.

Implements Gcs_xcom_proxy.

◆ xcom_client_set_cache_size()

bool Gcs_xcom_proxy_impl::xcom_client_set_cache_size ( uint64_t  size)
overridevirtual

This member function is responsible for setting a new value for the maximum size of the XCom cache.

This function is asynchronous, so the return value indicates only whether the request to change the value was successfully pushed to XCom or not. However, since the cache size is set only for the local node, and makes no further verifications on the value, if XCom processes the request, it will accept the new value. The callers of this function must validate that the value set is within the limits set to the maximum size of the XCom cache.

This function REQUIRES a prior call to xcom_open_handlers to establish a connection to XCom.

Parameters
sizeThe new value for the maximum size of the XCom cache.
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't.

Implements Gcs_xcom_proxy.

◆ xcom_client_set_event_horizon()

bool Gcs_xcom_proxy_impl::xcom_client_set_event_horizon ( uint32_t  group_id,
xcom_event_horizon  event_horizon 
)
overridevirtual

This member function is responsible for triggering the reconfiguration of the event horizon of the XCom configuration.

This function is asynchronous, so you need to poll xcom_get_event_horizon to actually validate that the reconfiguration was successful.

This function REQUIRES a prior call to xcom_open_handlers to establish a connection to XCom.

Parameters
event_horizonThe desired event horizon value
group_idThe identifier of the group from which the nodes will be removed
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of setting the event horizon. Since this is basically an asynchronous function, one needs to busy-wait on xcom_client_get_event_horizon to validate that the event horizon was modified.

Implements Gcs_xcom_proxy.

◆ xcom_client_set_leaders()

bool Gcs_xcom_proxy_impl::xcom_client_set_leaders ( uint32_t  group_id,
u_int  nr_preferred_leaders,
char const *  preferred_leaders[],
node_no  max_nr_leaders 
)
overridevirtual

This member function is responsible for triggering the reconfiguration of the leaders of the XCom configuration.

This function is asynchronous, so you need to poll xcom_get_leaders to actually validate that the reconfiguration was successful.

Parameters
group_idThe identifier of the group
nr_preferred_leadersNumber of preferred leaders, i.e. elements in preferred_leaders
preferred_leadersThe "host:port" of the preferred leaders
max_nr_leadersMaximum number of active leaders
Returns
true (false) on success (failure). Success means that XCom will process our request, failure means it won't. There could be errors later in the process of setting the leaders. Since this is basically an asynchronous function, one needs to busy-wait on xcom_client_get_leaders to validate that the leaders were modified.

Implements Gcs_xcom_proxy.

◆ xcom_destroy_ssl()

void Gcs_xcom_proxy_impl::xcom_destroy_ssl ( )
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_exit()

void Gcs_xcom_proxy_impl::xcom_exit ( )
overridevirtual

This member function finishes the XCom thread.

This function must be called when the XCOM thread was started but the node has not joined a group.

There could be errors later in the process of exiting XCom. Since this is basically an asynchronous function, one needs to wait for the XCom thread to to ensure that XCom terminated.

Implements Gcs_xcom_proxy.

◆ xcom_get_ssl_fips_mode()

int Gcs_xcom_proxy_impl::xcom_get_ssl_fips_mode ( const char *  mode)
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_get_ssl_mode()

int Gcs_xcom_proxy_impl::xcom_get_ssl_mode ( const char *  mode)
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_has_comms_status_changed()

bool Gcs_xcom_proxy_impl::xcom_has_comms_status_changed ( )
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_init()

void Gcs_xcom_proxy_impl::xcom_init ( xcom_port  listen_port)
overridevirtual

This member function initializes XCom.

This function must be called before anything else and from within the XCom thread. It will eventually call the main loop inside XCom.

Parameters
listen_portthe port that the local XCom is to be listening on.

Implements Gcs_xcom_proxy.

◆ xcom_init_ssl()

bool Gcs_xcom_proxy_impl::xcom_init_ssl ( )
overridevirtual

Initialize the SSL.

Returns
true on error. False otherwise.

Implements Gcs_xcom_proxy.

◆ xcom_input_connect()

bool Gcs_xcom_proxy_impl::xcom_input_connect ( std::string const &  address,
xcom_port  port 
)
overridevirtual

Opens the input channel to XCom.

Parameters
addressaddress to connect to
portport to connect to
Return values
trueif successful
falseotherwise

Implements Gcs_xcom_proxy.

◆ xcom_input_disconnect()

void Gcs_xcom_proxy_impl::xcom_input_disconnect ( )
overridevirtual

Closes the input channel to XCom.

Implements Gcs_xcom_proxy.

◆ xcom_input_try_pop()

xcom_input_request_ptr Gcs_xcom_proxy_impl::xcom_input_try_pop ( )
overridevirtual

Attempts to retrieve incoming commands.

(Called by XCom.)

Precondition
The input channel to XCom is open, i.e. xcom_input_connect
Return values
app_data_ptrlinked list of the queued commands if the queue is not empty
nullptrif the queue is empty

Implements Gcs_xcom_proxy.

◆ xcom_input_try_push()

bool Gcs_xcom_proxy_impl::xcom_input_try_push ( app_data_ptr  data)
overridevirtual

Attempts to send the command data to XCom.

(Called by GCS.)

The function takes ownership of data.

Precondition
The input channel to XCom is open, i.e. xcom_input_connect
Parameters
datathe command to send to XCom
Return values
trueif the command was sent to XCom
falseif the command was not sent to XCom

Implements Gcs_xcom_proxy.

◆ xcom_input_try_push_and_get_reply()

Gcs_xcom_input_queue::future_reply Gcs_xcom_proxy_impl::xcom_input_try_push_and_get_reply ( app_data_ptr  data)
overridevirtual

Attempts to send the command data to XCom, and returns a future to XCom's reply.

(Called by GCS.)

The function takes ownership of data.

Precondition
The input channel to XCom is open, i.e. xcom_input_connect
Parameters
datathe command to send to XCom
Returns
a future pointer to a Reply object if successful, a future pointer to nullptr otherwise

Implements Gcs_xcom_proxy.

◆ xcom_is_exit()

bool Gcs_xcom_proxy_impl::xcom_is_exit ( )
overridevirtual

This verifies if XCom has finished or not.

Implements Gcs_xcom_proxy.

◆ xcom_is_ready()

bool Gcs_xcom_proxy_impl::xcom_is_ready ( )
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_set_cleanup()

void Gcs_xcom_proxy_impl::xcom_set_cleanup ( )
overridevirtual

Clean up variables used to notify states in the XCOM's state machine.

Implements Gcs_xcom_proxy.

◆ xcom_set_comms_status()

void Gcs_xcom_proxy_impl::xcom_set_comms_status ( int  status)
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_set_exit()

void Gcs_xcom_proxy_impl::xcom_set_exit ( bool  value)
overridevirtual

This sets whether XCom has finished or not.

Implements Gcs_xcom_proxy.

◆ xcom_set_ready()

void Gcs_xcom_proxy_impl::xcom_set_ready ( bool  value)
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_set_ssl_fips_mode()

int Gcs_xcom_proxy_impl::xcom_set_ssl_fips_mode ( int  mode)
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_set_ssl_mode()

int Gcs_xcom_proxy_impl::xcom_set_ssl_mode ( int  mode)
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_set_ssl_parameters()

void Gcs_xcom_proxy_impl::xcom_set_ssl_parameters ( ssl_parameters  ssl,
tls_parameters  tls 
)
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_signal_comms_status_changed()

void Gcs_xcom_proxy_impl::xcom_signal_comms_status_changed ( int  status)
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_signal_exit()

void Gcs_xcom_proxy_impl::xcom_signal_exit ( )
overridevirtual

This modifies the internal cached status and signals all threads that might be waiting on xcom_wait_exit.

Implements Gcs_xcom_proxy.

◆ xcom_signal_ready()

void Gcs_xcom_proxy_impl::xcom_signal_ready ( )
overridevirtual

Implements Gcs_xcom_proxy.

◆ xcom_use_ssl()

bool Gcs_xcom_proxy_impl::xcom_use_ssl ( )
overridevirtual

Return whether the SSL will be used to encrypt data or not.

Returns
true (false) if XCom will (not) use SSL

Implements Gcs_xcom_proxy.

◆ xcom_wait_exit()

enum_gcs_error Gcs_xcom_proxy_impl::xcom_wait_exit ( )
overridevirtual

Call this method to wait for XCom to exit.

Call this method to wait for XCom to exit. It will block until XCom has exit or an error occurs.

Returns
GCS_OK if success, otherwise GCS_NOK.

Implements Gcs_xcom_proxy.

◆ xcom_wait_for_condition()

enum_gcs_error Gcs_xcom_proxy_impl::xcom_wait_for_condition ( My_xp_cond_impl condition,
My_xp_mutex_impl condition_lock,
std::function< bool(void)>  need_to_wait,
std::function< const std::string(int res)>  condition_event 
)
private

◆ xcom_wait_for_xcom_comms_status_change()

void Gcs_xcom_proxy_impl::xcom_wait_for_xcom_comms_status_change ( int &  status)
overridevirtual

Call this method to wait for XCom communications to be initialized.

Call this method to wait for XCom communications to be initialized. It will block until XCom communications are either OK or error out. The value of the status (XCOM_COMMS_OK or XCOM_COMMS_ERROR) is written into the status out parameters.

Parameters
[out]statusvalue of the XCom communication layer status. It can be either XCOM_COMMS_OK or XCOM_COMMS_ERROR

Implements Gcs_xcom_proxy.

◆ xcom_wait_ready()

enum_gcs_error Gcs_xcom_proxy_impl::xcom_wait_ready ( )
overridevirtual

This member waits for XCom to be initialized.

Implements Gcs_xcom_proxy.

Member Data Documentation

◆ m_ca_file

const char* Gcs_xcom_proxy_impl::m_ca_file
private

◆ m_ca_path

const char* Gcs_xcom_proxy_impl::m_ca_path
private

◆ m_cipher

const char* Gcs_xcom_proxy_impl::m_cipher
private

◆ m_client_cert_file

const char* Gcs_xcom_proxy_impl::m_client_cert_file
private

◆ m_client_key_file

const char* Gcs_xcom_proxy_impl::m_client_key_file
private

◆ m_cond_xcom_comms_status

My_xp_cond_impl Gcs_xcom_proxy_impl::m_cond_xcom_comms_status
private

◆ m_cond_xcom_exit

My_xp_cond_impl Gcs_xcom_proxy_impl::m_cond_xcom_exit
private

◆ m_cond_xcom_ready

My_xp_cond_impl Gcs_xcom_proxy_impl::m_cond_xcom_ready
private

◆ m_crl_file

const char* Gcs_xcom_proxy_impl::m_crl_file
private

◆ m_crl_path

const char* Gcs_xcom_proxy_impl::m_crl_path
private

◆ m_is_xcom_exit

bool Gcs_xcom_proxy_impl::m_is_xcom_exit
private

◆ m_is_xcom_ready

bool Gcs_xcom_proxy_impl::m_is_xcom_ready
private

◆ m_lock_xcom_comms_status

My_xp_mutex_impl Gcs_xcom_proxy_impl::m_lock_xcom_comms_status
private

◆ m_lock_xcom_exit

My_xp_mutex_impl Gcs_xcom_proxy_impl::m_lock_xcom_exit
private

◆ m_lock_xcom_ready

My_xp_mutex_impl Gcs_xcom_proxy_impl::m_lock_xcom_ready
private

◆ m_server_cert_file

const char* Gcs_xcom_proxy_impl::m_server_cert_file
private

◆ m_server_key_file

const char* Gcs_xcom_proxy_impl::m_server_key_file
private

◆ m_should_exit

std::atomic_bool Gcs_xcom_proxy_impl::m_should_exit
private

◆ m_socket_util

My_xp_socket_util* Gcs_xcom_proxy_impl::m_socket_util
private

◆ m_ssl_mode

int Gcs_xcom_proxy_impl::m_ssl_mode
private

◆ m_tls_ciphersuites

const char* Gcs_xcom_proxy_impl::m_tls_ciphersuites
private

◆ m_tls_version

const char* Gcs_xcom_proxy_impl::m_tls_version
private

◆ m_wait_time

unsigned int Gcs_xcom_proxy_impl::m_wait_time
private

◆ m_xcom_comms_status

int Gcs_xcom_proxy_impl::m_xcom_comms_status
private

◆ m_xcom_input_queue

Gcs_xcom_input_queue Gcs_xcom_proxy_impl::m_xcom_input_queue
private

The documentation for this class was generated from the following files: