-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iox-#13 add config file parser and some refactorings #38
iox-#13 add config file parser and some refactorings #38
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh boy, this PR is pretty hardcore to review.
Just tried to browse through it and noted some style things.
.gitignore
Outdated
/CMakeLists.txt | ||
.vscode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR missing
@@ -30,7 +30,7 @@ double measureLatency(iox::popo::Publisher& publisher, iox::popo::Subscriber& su | |||
{ | |||
auto start = std::chrono::high_resolution_clock::now(); | |||
// run the performance test | |||
for (uint64_t i = 0; i < NUMBER_OF_ROUNDTRIPS; ++i) | |||
for (int64_t i = 0; i < NUMBER_OF_ROUNDTRIPS; ++i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto
?
iceoryx_posh/CMakeLists.txt
Outdated
find_package(cpptoml REQUIRED) | ||
message("-- Build with TOML config file support.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider indenting
iceoryx_posh/CMakeLists.txt
Outdated
@@ -72,6 +77,7 @@ add_library(iceoryx_posh | |||
source/runtime/message_queue_interface.cpp | |||
source/runtime/message_queue_message.cpp | |||
source/runtime/posh_runtime.cpp | |||
source/runtime/service_discovery_notifier.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alphabetical sort
DESTINATION share/doc/iceoryx | ||
COMPONENT dev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong indentation?
@@ -0,0 +1,685 @@ | |||
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was actually done in a branch in 2019, it just happens that it got ready this year
// /dev/shm | ||
iox::runtime::SharedMemoryCreator<iox::roudi::MiddlewareShm> sut(goodconfig); | ||
} | ||
} // namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missign CR
@@ -0,0 +1,287 @@ | |||
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was actually done in a branch in 2019, it just happens that it got ready this year
@@ -0,0 +1,243 @@ | |||
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was actually done in a branch in 2019, it just happens that it got ready this year
return std::string(c_str()); | ||
} | ||
} // namespace cxx | ||
} // namespace iox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing CR
Signed-off-by: Kraus Mathias (CC-AD/ESW1) <mathias.kraus2@de.bosch.com>
0c13e33
to
9d68aca
Compare
When no config file is specified, this config will be used: | ||
``` | ||
[general] | ||
version = 1 | ||
|
||
[[segment]] | ||
|
||
[[segment.mempool]] | ||
size = 32 | ||
count = 10000 | ||
|
||
[[segment.mempool]] | ||
size = 128 | ||
count = 10000 | ||
|
||
[[segment.mempool]] | ||
size = 1024 | ||
count = 2000 | ||
|
||
[[segment.mempool]] | ||
size = 16384 | ||
count = 500 | ||
|
||
[[segment.mempool]] | ||
size = 131072 | ||
count = 200 | ||
|
||
[[segment.mempool]] | ||
size = 1048576 | ||
count = 50 | ||
|
||
[[segment.mempool]] | ||
size = 2097152 | ||
count = 20 | ||
|
||
[[segment.mempool]] | ||
size = 4194304 | ||
count = 10 | ||
|
||
[[segment.mempool]] | ||
size = 8388608 | ||
count = 10 | ||
|
||
[[segment.mempool]] | ||
size = 16777216 | ||
count = 5 | ||
|
||
[[segment.mempool]] | ||
size = 33554432 | ||
count = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be moved to a separate TOML file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need a fallback, just in case there is no config file specified
@@ -1,10 +1,15 @@ | |||
cmake_minimum_required(VERSION 3.5) | |||
set(iceoryx_posh_VERSION 0.16.0) | |||
set(iceoryx_posh_VERSION 0.16.0.1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michael-poehnl After this pull request has been merged, IMHO we can directly create the new release.
@@ -37,7 +37,7 @@ static constexpr char AnyEventString[]{"65535"}; | |||
static constexpr int32_t MAX_NUMBER_OF_CHARS = 64; | |||
|
|||
/// @brief Scope of a service description | |||
enum class Scope : unsigned int | |||
enum class Scope : uint16_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
mutable std::mutex m_queueAccessMutex; | ||
|
||
// used for starting the timer, first time StartFindService() is called. | ||
/// @todo pbt2kor 3 : Introducing isRunning() method in Timer might be a better idea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rewrite this comment.
#ifdef TOML_CONFIG_FILE | ||
#include "cpptoml.h" | ||
|
||
class TomlRouDiConfigFileParser : public iox::roudi::RouDiConfigFileParser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class will be moved to a separate file as part of the next refactoring.
sorry for the big code drop. this is a temporary exception and will not become the rule. we need a little bit more time for converging our internal codebase with the public one. we are on track, tough and this should happen soon™. Then the PRs will be smaller and focused on the topics |
std::cout << "-b, Start address hint of the shared memory segments" | ||
" e.g. 0x1f4000000" | ||
std::cout << "-c, --config-file Path to the RouDi Config File." | ||
" Have a look at the documentation for the format." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be nice to point to a website here instead of the generic term documentation :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea. Maybe we should have a FAQ where the most common issues are listed and link it here?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually from my point of view it would be fine to add a link to the markdown file in this repo, which describes how the config file works.
But of course: Providing a link to the general documentation in the help text would be nice.
Signed-off-by: Kraus Mathias (CC-AD/ESW1) <mathias.kraus2@de.bosch.com>
7ce961e
to
48cd69e
Compare
Signed-off-by: Kraus Mathias (CC-AD/ESW1) mathias.kraus2@de.bosch.com