Skip to content

Commit

Permalink
iox-#2327 Remove macros ENUM and STRUCT and c2cpp_binding.h
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebentley15 committed Aug 21, 2024
1 parent c5c7fe6 commit cfc3445
Show file tree
Hide file tree
Showing 19 changed files with 212 additions and 280 deletions.
25 changes: 12 additions & 13 deletions iceoryx_binding_c/include/iceoryx_binding_c/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "iceoryx_binding_c/types.h"

/// @brief client handle
typedef IOX_CLASS UntypedClient* iox_client_t;
typedef struct UntypedClient* iox_client_t;

/// @brief options to be set for a client
typedef struct
Expand All @@ -38,10 +38,10 @@ typedef struct
bool connectOnCreate;

/// @brief Sets whether the server blocks when the client response queue is full
IOX_ENUM iox_QueueFullPolicy responseQueueFullPolicy;
enum iox_QueueFullPolicy responseQueueFullPolicy;

/// @brief Sets whether the client blocks when the server request queue is full
IOX_ENUM iox_ConsumerTooSlowPolicy serverTooSlowPolicy;
enum iox_ConsumerTooSlowPolicy serverTooSlowPolicy;

/// @brief this value will be set exclusively by 'iox_client_options_init' and is not supposed to be modified
/// otherwise
Expand Down Expand Up @@ -87,9 +87,8 @@ void iox_client_deinit(iox_client_t const self);
/// describes the error
/// @note for the user-payload alignment 'IOX_C_CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT' is used
/// for a custom user-payload alignment please use 'iox_client_loan_aligned_request'
IOX_ENUM iox_AllocationResult iox_client_loan_request(iox_client_t const self,
void** const payload,
const uint64_t payloadSize);
enum iox_AllocationResult
iox_client_loan_request(iox_client_t const self, void** const payload, const uint64_t payloadSize);

/// @brief allocates a request in the shared memory with a custom alignment for the user-payload
/// @param[in] self handle of the client
Expand All @@ -98,10 +97,10 @@ IOX_ENUM iox_AllocationResult iox_client_loan_request(iox_client_t const self,
/// @param[in] payloadAlignment user-payload alignment of the allocated request
/// @return on success it returns AllocationResult_SUCCESS otherwise a value which
/// describes the error
IOX_ENUM iox_AllocationResult iox_client_loan_aligned_request(iox_client_t const self,
void** const payload,
const uint64_t payloadSize,
const uint32_t payloadAlignment);
enum iox_AllocationResult iox_client_loan_aligned_request(iox_client_t const self,
void** const payload,
const uint64_t payloadSize,
const uint32_t payloadAlignment);


/// @brief releases ownership of a previously allocated loaned request without sending it
Expand All @@ -114,7 +113,7 @@ void iox_client_release_request(iox_client_t const self, void* const payload);
/// @param[in] payload pointer to the user-payload of the request which should be send
/// @return on success it returns ClientSendResult_SUCCESS otherwise a value which
/// describes the error
IOX_ENUM iox_ClientSendResult iox_client_send(iox_client_t const self, void* const payload);
enum iox_ClientSendResult iox_client_send(iox_client_t const self, void* const payload);

/// @brief connects to the service
/// @param[in] self handle to the client
Expand All @@ -128,14 +127,14 @@ void iox_client_disconnect(iox_client_t const self);
/// @param[in] self handle to the client
/// @return ConnectionState_CONNECTED when successfully connected otherwise an enum which
/// describes the current state
IOX_ENUM iox_ConnectionState iox_client_get_connection_state(iox_client_t const self);
enum iox_ConnectionState iox_client_get_connection_state(iox_client_t const self);

/// @brief retrieve a received respone
/// @param[in] self handle to the client
/// @param[in] payload pointer in which the pointer to the user-payload of the response is stored
/// @return if a chunk could be received it returns ChunkReceiveResult_SUCCESS otherwise
/// an enum which describes the error
IOX_ENUM iox_ChunkReceiveResult iox_client_take_response(iox_client_t const self, const void** const payload);
enum iox_ChunkReceiveResult iox_client_take_response(iox_client_t const self, const void** const payload);

/// @brief release a previously acquired response (via iox_client_take_response)
/// @param[in] self handle to the client
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
#ifndef IOX_BINDING_C_C2CPP_ENUM_TRANSLATION_H
#define IOX_BINDING_C_C2CPP_ENUM_TRANSLATION_H

#include "c2cpp_binding.h"
#include "iceoryx_binding_c/enums.h"
#include "iceoryx_posh/internal/popo/base_subscriber.hpp"
#include "iceoryx_posh/runtime/service_discovery.hpp"

namespace c2cpp
{
iox::popo::ConsumerTooSlowPolicy consumerTooSlowPolicy(const IOX_ENUM iox_ConsumerTooSlowPolicy policy) noexcept;
iox::popo::QueueFullPolicy queueFullPolicy(const IOX_ENUM iox_QueueFullPolicy policy) noexcept;
iox::popo::ConsumerTooSlowPolicy consumerTooSlowPolicy(const enum iox_ConsumerTooSlowPolicy policy) noexcept;
iox::popo::QueueFullPolicy queueFullPolicy(const enum iox_QueueFullPolicy policy) noexcept;
iox::popo::SubscriberEvent subscriberEvent(const iox_SubscriberEvent value) noexcept;
iox::popo::SubscriberState subscriberState(const iox_SubscriberState value) noexcept;

Expand Down
Loading

0 comments on commit cfc3445

Please sign in to comment.