Skip to content
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

Conversation

elBoberido
Copy link
Member

Signed-off-by: Kraus Mathias (CC-AD/ESW1) mathias.kraus2@de.bosch.com

Copy link
Contributor

@Karsten1987 Karsten1987 left a 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
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto?

Comment on lines 9 to 10
find_package(cpptoml REQUIRED)
message("-- Build with TOML config file support.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider indenting

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alphabetical sort

Comment on lines 20 to 21
DESTINATION share/doc/iceoryx
COMPONENT dev)
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

year

Copy link
Member Author

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
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

year

Copy link
Member Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

year

Copy link
Member Author

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
Copy link
Contributor

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>
README.md Show resolved Hide resolved
Comment on lines +230 to +279
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
Copy link
Contributor

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.

Copy link
Member Author

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)
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

@elBoberido
Copy link
Member Author

oh boy, this PR is pretty hardcore to review.

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."
Copy link

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 :)

Copy link
Contributor

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?!

Copy link

@jeising jeising Jan 29, 2020

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>
@elBoberido elBoberido force-pushed the iox-#13-config-file-and-refactorings branch from 7ce961e to 48cd69e Compare January 30, 2020 09:42
@elBoberido elBoberido merged commit 9336525 into eclipse-iceoryx:master Jan 30, 2020
@elBoberido elBoberido deleted the iox-#13-config-file-and-refactorings branch May 28, 2020 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants