-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #931 from ApexAI/iox-#930-add-c-binding-for-posh-s…
…ettings Iox #930 add c binding for posh settings
- Loading branch information
Showing
6 changed files
with
279 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef IOX_BINDING_C_CONFIG_H | ||
#define IOX_BINDING_C_CONFIG_H | ||
|
||
#include <stdint.h> | ||
|
||
/// @brief returns maximum supported amount of publishers | ||
uint32_t iox_cfg_max_publishers(); | ||
|
||
/// @brief returns maximum amount of subscribers which can be subscribed to one publisher | ||
uint32_t iox_cfg_max_subscribers_per_publisher(); | ||
|
||
/// @brief returns maximum amount of samples a publisher can acquire at the same time with loan | ||
uint32_t iox_cfg_max_chunks_allocated_per_publisher_simultaneously(); | ||
|
||
/// @brief returns maximum history size for a publisher (e.g. samples which are hold back so | ||
// that new subscribers can acquire past data) | ||
uint64_t iox_cfg_max_publisher_history(); | ||
|
||
/// @brief returns maximum supported amount of subscribers | ||
uint32_t iox_cfg_max_subscribers(); | ||
|
||
/// @brief returns the maximum amount of samples which a subscriber can hold without releasing them | ||
uint32_t iox_cfg_max_chunks_held_per_subscriber_simultaneously(); | ||
|
||
/// @brief returns the maximum subscriber queue capacity which is used when the publisher delivers samples to the | ||
/// subscriber if the queue capacity is reached new samples will discard old samples | ||
uint32_t iox_cfg_max_subscriber_queue_capacity(); | ||
|
||
/// @brief returns the maximum supported amount of condition variables. this determines how many listeners and waitsets | ||
/// can be used in one iceoryx system | ||
uint32_t iox_cfg_max_number_of_condition_variables(); | ||
|
||
/// @brief returns the maximum supported amount of notifiers per condition variable. this determines how many | ||
/// attachments a listener or waitset can have | ||
uint32_t iox_cfg_max_number_of_notifiers_per_condition_variable(); | ||
|
||
/// @brief returns the maximum amount of attachments per waitset | ||
/// @note is less or equal to iox_cfg_max_number_of_notifiers_per_condition_variable | ||
uint32_t iox_cfg_max_number_of_attachments_per_waitset(); | ||
|
||
/// @brief returns the maximum amount of evens per listener | ||
/// @note is less or equal to iox_cfg_max_number_of_notifiers_per_condition_variable | ||
uint32_t iox_cfg_max_number_of_events_per_listener(); | ||
|
||
/// @brief returns the maximum amount of mempools for roudi. restricts also the number of mempools in the roudi config | ||
/// file | ||
uint32_t iox_cfg_max_number_of_mempools(); | ||
|
||
/// @brief returns the maximum number of shared memory segments. restricts also the number of configurable segments in | ||
/// the roudi config file | ||
uint32_t iox_cfg_max_shm_segments(); | ||
|
||
/// @brief returns the maximum supported amount of shared memory providers | ||
uint32_t iox_cfg_max_number_of_memory_provider(); | ||
|
||
/// @brief returns the maximum supported amount of memory blocks per shared memory provider | ||
uint32_t iox_cfg_max_number_of_memory_blocks_per_memory_provider(); | ||
|
||
/// @brief returns the alignment of the user payload when it is not set explicitly | ||
uint32_t iox_cfg_chunk_default_user_payload_alignment(); | ||
|
||
/// @brief returns the size of the user header when no user header is requested by the user | ||
uint32_t iox_cfg_no_user_header_size(); | ||
|
||
/// @brief returns the alignment of the user header when no user header is requested by the user | ||
uint32_t iox_cfg_no_user_header_alignment(); | ||
|
||
/// @brief returns the maximum supported amount of processes which can register at roudi by initializing the posh | ||
/// runtime | ||
uint32_t iox_cfg_max_process_number(); | ||
|
||
/// @brief returns the maximum supported amount of services | ||
uint32_t iox_cfg_max_number_of_services(); | ||
|
||
/// @brief returns the maximum runtime name length | ||
uint32_t iox_cfg_max_runtime_name_length(); | ||
|
||
#endif // IOX_BINDING_C_CONFIG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "iceoryx_posh/iceoryx_posh_types.hpp" | ||
|
||
extern "C" { | ||
#include "iceoryx_binding_c/config.h" | ||
} | ||
|
||
uint32_t iox_cfg_max_publishers() | ||
{ | ||
return iox::MAX_PUBLISHERS; | ||
} | ||
|
||
uint32_t iox_cfg_max_subscribers_per_publisher() | ||
{ | ||
return iox::MAX_SUBSCRIBERS_PER_PUBLISHER; | ||
} | ||
|
||
uint32_t iox_cfg_max_chunks_allocated_per_publisher_simultaneously() | ||
{ | ||
return iox::MAX_CHUNKS_ALLOCATED_PER_PUBLISHER_SIMULTANEOUSLY; | ||
} | ||
|
||
uint64_t iox_cfg_max_publisher_history() | ||
{ | ||
return iox::MAX_PUBLISHER_HISTORY; | ||
} | ||
|
||
uint32_t iox_cfg_max_subscribers() | ||
{ | ||
return iox::MAX_SUBSCRIBERS; | ||
} | ||
|
||
uint32_t iox_cfg_max_chunks_held_per_subscriber_simultaneously() | ||
{ | ||
return iox::MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY; | ||
} | ||
|
||
uint32_t iox_cfg_max_subscriber_queue_capacity() | ||
{ | ||
return iox::MAX_SUBSCRIBER_QUEUE_CAPACITY; | ||
} | ||
|
||
uint32_t iox_cfg_max_number_of_condition_variables() | ||
{ | ||
return iox::MAX_NUMBER_OF_CONDITION_VARIABLES; | ||
} | ||
|
||
uint32_t iox_cfg_max_number_of_notifiers_per_condition_variable() | ||
{ | ||
return iox::MAX_NUMBER_OF_NOTIFIERS_PER_CONDITION_VARIABLE; | ||
} | ||
|
||
uint32_t iox_cfg_max_number_of_attachments_per_waitset() | ||
{ | ||
return iox::MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET; | ||
} | ||
|
||
uint32_t iox_cfg_max_number_of_events_per_listener() | ||
{ | ||
return iox::MAX_NUMBER_OF_EVENTS_PER_LISTENER; | ||
} | ||
|
||
uint32_t iox_cfg_max_number_of_mempools() | ||
{ | ||
return iox::MAX_NUMBER_OF_MEMPOOLS; | ||
} | ||
|
||
uint32_t iox_cfg_max_shm_segments() | ||
{ | ||
return iox::MAX_SHM_SEGMENTS; | ||
} | ||
|
||
uint32_t iox_cfg_max_number_of_memory_provider() | ||
{ | ||
return iox::MAX_NUMBER_OF_MEMORY_PROVIDER; | ||
} | ||
|
||
uint32_t iox_cfg_max_number_of_memory_blocks_per_memory_provider() | ||
{ | ||
return iox::MAX_NUMBER_OF_MEMORY_BLOCKS_PER_MEMORY_PROVIDER; | ||
} | ||
|
||
uint32_t iox_cfg_chunk_default_user_payload_alignment() | ||
{ | ||
return iox::CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT; | ||
} | ||
|
||
uint32_t iox_cfg_no_user_header_size() | ||
{ | ||
return iox::CHUNK_NO_USER_HEADER_SIZE; | ||
} | ||
|
||
uint32_t iox_cfg_no_user_header_alignment() | ||
{ | ||
return iox::CHUNK_NO_USER_HEADER_ALIGNMENT; | ||
} | ||
|
||
uint32_t iox_cfg_max_process_number() | ||
{ | ||
return iox::MAX_PROCESS_NUMBER; | ||
} | ||
|
||
uint32_t iox_cfg_max_number_of_services() | ||
{ | ||
return iox::MAX_NUMBER_OF_SERVICES; | ||
} | ||
|
||
uint32_t iox_cfg_max_runtime_name_length() | ||
{ | ||
return iox::MAX_RUNTIME_NAME_LENGTH; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
extern "C" { | ||
#include "iceoryx_binding_c/config.h" | ||
} | ||
|
||
#include "iceoryx_posh/iceoryx_posh_types.hpp" | ||
|
||
#include "test.hpp" | ||
|
||
namespace | ||
{ | ||
using namespace iox; | ||
|
||
TEST(iox_cfg, valuesAreCorrectlyConnected) | ||
{ | ||
EXPECT_EQ(iox_cfg_max_publishers(), iox::MAX_PUBLISHERS); | ||
EXPECT_EQ(iox_cfg_max_subscribers_per_publisher(), iox::MAX_SUBSCRIBERS_PER_PUBLISHER); | ||
EXPECT_EQ(iox_cfg_max_chunks_allocated_per_publisher_simultaneously(), | ||
iox::MAX_CHUNKS_ALLOCATED_PER_PUBLISHER_SIMULTANEOUSLY); | ||
EXPECT_EQ(iox_cfg_max_publisher_history(), iox::MAX_PUBLISHER_HISTORY); | ||
EXPECT_EQ(iox_cfg_max_subscribers(), iox::MAX_SUBSCRIBERS); | ||
EXPECT_EQ(iox_cfg_max_chunks_held_per_subscriber_simultaneously(), | ||
iox::MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY); | ||
EXPECT_EQ(iox_cfg_max_subscriber_queue_capacity(), iox::MAX_SUBSCRIBER_QUEUE_CAPACITY); | ||
EXPECT_EQ(iox_cfg_max_number_of_condition_variables(), iox::MAX_NUMBER_OF_CONDITION_VARIABLES); | ||
EXPECT_EQ(iox_cfg_max_number_of_notifiers_per_condition_variable(), | ||
iox::MAX_NUMBER_OF_NOTIFIERS_PER_CONDITION_VARIABLE); | ||
EXPECT_EQ(iox_cfg_max_number_of_attachments_per_waitset(), iox::MAX_NUMBER_OF_ATTACHMENTS_PER_WAITSET); | ||
EXPECT_EQ(iox_cfg_max_number_of_events_per_listener(), iox::MAX_NUMBER_OF_EVENTS_PER_LISTENER); | ||
EXPECT_EQ(iox_cfg_max_number_of_mempools(), iox::MAX_NUMBER_OF_MEMPOOLS); | ||
EXPECT_EQ(iox_cfg_max_shm_segments(), iox::MAX_SHM_SEGMENTS); | ||
EXPECT_EQ(iox_cfg_max_number_of_memory_provider(), iox::MAX_NUMBER_OF_MEMORY_PROVIDER); | ||
EXPECT_EQ(iox_cfg_max_number_of_memory_blocks_per_memory_provider(), | ||
iox::MAX_NUMBER_OF_MEMORY_BLOCKS_PER_MEMORY_PROVIDER); | ||
EXPECT_EQ(iox_cfg_chunk_default_user_payload_alignment(), iox::CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT); | ||
EXPECT_EQ(iox_cfg_no_user_header_size(), iox::CHUNK_NO_USER_HEADER_SIZE); | ||
EXPECT_EQ(iox_cfg_no_user_header_alignment(), iox::CHUNK_NO_USER_HEADER_ALIGNMENT); | ||
EXPECT_EQ(iox_cfg_max_process_number(), iox::MAX_PROCESS_NUMBER); | ||
EXPECT_EQ(iox_cfg_max_number_of_services(), iox::MAX_NUMBER_OF_SERVICES); | ||
EXPECT_EQ(iox_cfg_max_runtime_name_length(), iox::MAX_RUNTIME_NAME_LENGTH); | ||
} | ||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters