iceoryx_binding_c  2.0.2
client.h
1 // Copyright (c) 2022 by Apex.AI Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // SPDX-License-Identifier: Apache-2.0
16 
17 #ifndef IOX_BINDING_C_CLIENT_H
18 #define IOX_BINDING_C_CLIENT_H
19 
20 #include "iceoryx_binding_c/config.h"
21 #include "iceoryx_binding_c/enums.h"
22 #include "iceoryx_binding_c/service_description.h"
23 #include "iceoryx_binding_c/types.h"
24 
26 typedef CLASS UntypedClient* iox_client_t;
27 
29 typedef struct
30 {
33 
35  char nodeName[IOX_CONFIG_NODE_NAME_SIZE];
36 
39 
41  ENUM iox_QueueFullPolicy responseQueueFullPolicy;
42 
44  ENUM iox_ConsumerTooSlowPolicy serverTooSlowPolicy;
45 
48  uint64_t initCheck;
50 
57 void iox_client_options_init(iox_client_options_t* options);
58 
62 bool iox_client_options_is_initialized(const iox_client_options_t* const options);
63 
72 iox_client_t iox_client_init(iox_client_storage_t* self,
73  const char* const service,
74  const char* const instance,
75  const char* const event,
76  const iox_client_options_t* const options);
77 
80 void iox_client_deinit(iox_client_t const self);
81 
90 ENUM iox_AllocationResult iox_client_loan_request(iox_client_t const self,
91  void** const payload,
92  const uint32_t payloadSize);
93 
101 ENUM iox_AllocationResult iox_client_loan_aligned_request(iox_client_t const self,
102  void** const payload,
103  const uint32_t payloadSize,
104  const uint32_t payloadAlignment);
105 
106 
110 void iox_client_release_request(iox_client_t const self, void* const payload);
111 
117 ENUM iox_ClientSendResult iox_client_send(iox_client_t const self, void* const payload);
118 
121 void iox_client_connect(iox_client_t const self);
122 
125 void iox_client_disconnect(iox_client_t const self);
126 
131 ENUM iox_ConnectionState iox_client_get_connection_state(iox_client_t const self);
132 
138 ENUM iox_ChunkReceiveResult iox_client_take_response(iox_client_t const self, const void** const payload);
139 
143 void iox_client_release_response(iox_client_t const self, const void* const payload);
144 
147 void iox_client_release_queued_responses(iox_client_t const self);
148 
152 bool iox_client_has_responses(iox_client_t const self);
153 
157 bool iox_client_has_missed_responses(iox_client_t const self);
158 
162 iox_service_description_t iox_client_get_service_description(iox_client_t const self);
163 #endif
options to be set for a client
Definition: client.h:30
uint64_t responseQueueCapacity
size of the response queue
Definition: client.h:32
ENUM iox_ConsumerTooSlowPolicy serverTooSlowPolicy
Sets whether the client blocks when the server request queue is full.
Definition: client.h:44
uint64_t initCheck
this value will be set exclusively by iox_client_options_init and is not supposed to be modified othe...
Definition: client.h:48
ENUM iox_QueueFullPolicy responseQueueFullPolicy
Sets whether the server blocks when the client response queue is full.
Definition: client.h:41
bool connectOnCreate
Indicates if the client should be connected when created.
Definition: client.h:38
has exactly the size required to store the underlying object of iox_client_t
Definition: types.h:73
Definition: service_description.h:25