Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/module/lifecycle_client_lib/model/structural_view.uxf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Operation
+ run(amp::stop_token stop_token): std::int32_t virtual = 0</panel_attributes><additional_attributes></additional_attributes></element><element><id>UMLClass</id><coordinates><x>171</x><y>855</y><w>486</w><h>135</h></coordinates><panel_attributes>score::mw::lifecycle::ApplicationContext
--
Operations
+ ApplicationContext(const int32_t argc, const score::StringLiteral argv[])
+ ApplicationContext(const int32_t argc, const char* const argv[])
+ get_arguments(): const std::vector&lt;std::string&gt;&amp; const noexcept
+ get_argument(const amp::string_view flag): std::string const noexcept
--
Expand Down Expand Up @@ -39,7 +39,7 @@ manages</panel_attributes><additional_attributes>10;130;10;10</additional_attrib
Run
--
Operation
+ Run(const int32_t argc, const score::StringLiteral* argv)
+ Run(const int32_t argc, const char* const argv[])
+ AsPosixProcess(Args&amp;&amp;... args): std::int32_t const

--
Expand All @@ -55,7 +55,7 @@ environments</panel_attributes><additional_attributes></additional_attributes></
operation
+ initialize(const ApplicationContext&amp;): std::int32_t override
+ run(amp::stop_token stop_token): std::int32_t override
+ AasApplicationContainer(cosnt std::int32_t argc, const score::StringLiteral* argv, const std::size_t count_expected_applications): noexcept
+ AasApplicationContainer(const std::int32_t argc, const char* const argv[], const std::size_t count_expected_applications): noexcept
+ With&lt;App,...Args&gt;(Args&amp;&amp;.. args) : AasApplicationContainer&amp;
+ Launch() : std::int32_t
--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ std::string MonitorImpl::getIpcPath(void) noexcept(false)
}

std::unique_ptr<char[]> MonitorImpl::read_flatbuffer_file() const {
const char* configFilePath = getenv("CONFIG_PATH");
if(!configFilePath) {
const std::string_view configFilePath {getenv("CONFIG_PATH")};
if(!configFilePath.data()) {
return nullptr;
}

logger_r.LogDebug() << "Attempting to read config file from " << configFilePath;

std::ifstream infile;
infile.open(configFilePath, std::ios::binary | std::ios::in);
infile.open(configFilePath.data(), std::ios::binary | std::ios::in);
if (!infile.is_open()) {
return nullptr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ namespace mw
namespace lifecycle
{


AasApplicationContainer::AasApplicationContainer(const std::int32_t argc,
const score::StringLiteral* argv,
const char* const argv[],
const std::size_t count_expected_applications) noexcept
: Application{}, context_{argc, argv}, applications_{}, count_expected_applications_{count_expected_applications}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AasApplicationContainer : public Application
* @param count_expected_applications The expected number of applications.
*/
AasApplicationContainer(const std::int32_t argc,
const score::StringLiteral* argv,
const char* const argv[],
const std::size_t count_expected_applications) noexcept;

AasApplicationContainer(const AasApplicationContainer&) = delete;
Expand Down Expand Up @@ -69,7 +69,7 @@ class AasApplicationContainer : public Application
AasApplicationContainer& With(Args&&... args)
{
SCORE_LANGUAGE_FUTURECPP_ASSERT_PRD_MESSAGE(applications_.size() + 1 <= count_expected_applications_,
"Passed more Applications than expected");
"Passed more Applications than expected");
applications_.push_back(std::make_unique<App>(std::forward<Args>(args)...));
return *this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

score::mw::lifecycle::ApplicationContext::ApplicationContext(
const std::int32_t argc,
const score::StringLiteral argv[]) // NOLINT(modernize-avoid-c-arrays): array tolerated for command line arguments
const char* const argv[]) // NOLINT(modernize-avoid-c-arrays): array tolerated for command line arguments
: m_args(argv, argv + argc), m_app_path(argv[0]) // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic): array
// tolerated for command line arguments
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#define SCORE_MW_LIFECYCLE_APPLICATIONCONTEXT_H

#include "score/memory/string_literal.h"
#include <string_view>
#include <cstdint>
#include <string>
#include <string_view>
#include <vector>

namespace score
Expand All @@ -38,7 +38,7 @@ class ApplicationContext

public:
/* NOLINTNEXTLINE(modernize-avoid-c-arrays): array tolerated for command line arguments */
ApplicationContext(const std::int32_t argc, const score::StringLiteral argv[]);
ApplicationContext(const std::int32_t argc, const char* const argv[]);

/**
* \brief Utility function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace

auto& GetConstructorCallback() noexcept
{
static std::function<void(const std::int32_t argc, const score::StringLiteral argv[])> constructor_callback{};
static std::function<void(const std::int32_t argc, const char* const argv[])> constructor_callback{};
return constructor_callback;
}

Expand All @@ -41,7 +41,7 @@ auto& GetGetArgumentCallback() noexcept

score::mw::lifecycle::ApplicationContextMock::ApplicationContextMock()
{
GetConstructorCallback() = [this](const std::int32_t argc, const score::StringLiteral argv[]) {
GetConstructorCallback() = [this](const std::int32_t argc, const char* const argv[]) {
ctor(argc, argv);
};
GetGetArgumentsCallback() = [this]() -> decltype(auto) {
Expand All @@ -59,7 +59,7 @@ score::mw::lifecycle::ApplicationContextMock::~ApplicationContextMock()
GetGetArgumentCallback() = nullptr;
}

score::mw::lifecycle::ApplicationContext::ApplicationContext(const std::int32_t argc, const score::StringLiteral argv[])
score::mw::lifecycle::ApplicationContext::ApplicationContext(const std::int32_t argc, const char* const argv[])
{
auto& constructor_callback = GetConstructorCallback();
constructor_callback(argc, argv);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ApplicationContextMock
~ApplicationContextMock();

MOCK_METHOD(const std::vector<std::string>&, get_arguments, (), ());
MOCK_METHOD(void, ctor, (const std::int32_t argc, const score::StringLiteral argv[]), ());
MOCK_METHOD(void, ctor, (const std::int32_t argc, const char* const argv[]), ());
MOCK_METHOD(std::string, get_argument, (const std::string_view flag), ());
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ std::int32_t score::mw::lifecycle::LifeCycleManager::run(Application& app, const
const auto run_status = m_app->Run(m_stop_source.get_token()); // LCOV_EXCL_BR_LINE
if (run_status != 0)
{
mw::log::LogError() << "Error occured during Run";
mw::log::LogError() << "Error occurred during Run";
}
mw::log::LogInfo() << "Shutting down Application";
mw::log::LogInfo() << "Application" << application_name << "run finished with" << run_status;
Expand Down
7 changes: 2 additions & 5 deletions score/launch_manager/lifecycle_client/src/runapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#define SCORE_MW_LIFECYCLE_RUNAPPLICATION_H

#include "score/mw/lifecycle/lifecycle_client/lifecyclemanager.h"
#include "score/memory/string_literal.h"
#include "score/mw/lifecycle/lifecycle_client/applicationcontext.h"

#include <cstdint>
Expand All @@ -32,8 +31,7 @@ class Run final
{
public:
Run(const std::int32_t argc,
const score::StringLiteral*
argv) /* NOLINT(modernize-avoid-c-arrays): array tolerated for command line arguments */
const char* const argv[]) /* NOLINT(modernize-avoid-c-arrays): array tolerated for command line arguments */
: context_{argc, argv}
{
}
Expand Down Expand Up @@ -66,7 +64,7 @@ class Run final
template <typename ApplicationType, typename... Args>

/* NOLINTNEXTLINE(modernize-avoid-c-arrays): array tolerated for command line arguments */
std::int32_t run_application(const std::int32_t argc, const score::StringLiteral argv[], Args&&... args)
std::int32_t run_application(const std::int32_t argc, const char* const argv[], Args&&... args)
{
score::mw::lifecycle::Run<ApplicationType> runner(argc, argv);
return runner.AsPosixProcess(std::forward<Args>(args)...);
Expand All @@ -77,4 +75,3 @@ std::int32_t run_application(const std::int32_t argc, const score::StringLiteral
} // namespace score

#endif // SCORE_MW_LIFECYCLE_RUNAPPLICATION_H

Loading