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
4 changes: 2 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Checks: ' -*, bugprone-*, cert-*, clang-analyzer-core.*, clang-analyzer-cplusplus.*, clang-analyzer-security.*, cppcoreguidelines-pro-bounds-pointer-arithmetic, cppcoreguidelines-pro-type-cstyle-cast, hicpp-* '
WarningsAsErrors: 'bugprone-*,cert-*,clang-analyzer-*,hicpp-*'
CheckOptions:
- key: 'hicpp-special-member-functions.AllowSoleDefaultDtor'
- value: 1 # This allows us to make interfaces that have virtual destructor without the other functions
- key: hicpp-special-member-functions.AllowSoleDefaultDtor
value: 1 # This allows us to make interfaces that have virtual destructor without the other functions
3 changes: 2 additions & 1 deletion score/launch_manager/src/alive/src/details/AliveImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ AliveImpl::AliveImpl(

void AliveImpl::ReportCheckpoint(std::uint32_t f_checkpointId) const noexcept(true)
{
(void)ipcClient->sendEmplace(score::lcm::saf::timers::OsClock::getMonotonicSystemClock(), f_checkpointId);
(void)ipcClient->sendEmplace(
score::mw::lifecycle::internal::saf::timers::OsClock::getMonotonicSystemClock(), f_checkpointId);
}

void AliveImpl::connectToPhmDaemon(void) noexcept(false)
Expand Down
6 changes: 3 additions & 3 deletions score/launch_manager/src/alive/src/details/AliveImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class AliveImpl
{
public:
/// @brief The element that is sent via IPC
using CheckpointBufferElement = score::lcm::saf::ifappl::CheckpointBufferElement;
using CheckpointBufferElement = score::mw::lifecycle::internal::saf::ifappl::CheckpointBufferElement;
/// @brief The IPC Connection type
using CheckpointIpcClient = score::lcm::saf::ipc::
IpcClient<CheckpointBufferElement, score::lcm::saf::ifappl::k_maxCheckpointBufferElements>;
using CheckpointIpcClient = score::mw::lifecycle::internal::saf::ipc::
IpcClient<CheckpointBufferElement, score::mw::lifecycle::internal::saf::ifappl::k_maxCheckpointBufferElements>;

/// @brief Non-parametric constructor is not supported
AliveImpl() = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ score::concurrency::InterruptibleFuture<void> GetErrorFuture(ExecErrc errType) n

ControlClient::ControlClient() noexcept
{
static std::function<void(const score::lcm::ExecutionErrorEvent&)> undefinedStateCallback =
[]([[maybe_unused]] const score::lcm::ExecutionErrorEvent& event) {
static std::function<void(const score::mw::lifecycle::ExecutionErrorEvent&)> undefinedStateCallback =
[]([[maybe_unused]] const score::mw::lifecycle::ExecutionErrorEvent& event) {
};

try
Expand Down Expand Up @@ -70,8 +70,8 @@ score::concurrency::InterruptibleFuture<void> ControlClient::ActivateRunTarget(

if (control_client_impl_ != nullptr)
{
static score::lcm::IdentifierHash pg_name{"MainPG"};
score::lcm::IdentifierHash pg_state{"MainPG/" + std::string(runTargetName)};
static score::mw::lifecycle::IdentifierHash pg_name{"MainPG"};
score::mw::lifecycle::IdentifierHash pg_state{"MainPG/" + std::string(runTargetName)};
retVal_ = control_client_impl_->SetState(pg_name, pg_state);
}
else
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class ControlClientImpl final
public:
ControlClientImpl() = delete;

ControlClientImpl(std::function<void(const score::lcm::ExecutionErrorEvent&)> undefinedStateCallback) noexcept;
ControlClientImpl(
std::function<void(const score::mw::lifecycle::ExecutionErrorEvent&)> undefinedStateCallback) noexcept;

// this class is not movable or copyable by definition
ControlClientImpl(const ControlClientImpl&) = delete;
Expand Down Expand Up @@ -117,8 +118,8 @@ class ControlClientImpl final
/// (e.g. Off state for MainPG)
/// @error score::mw::lifecycle::ExecErrc::kGeneralError if any other error occurs.
score::concurrency::InterruptibleFuture<void> SetState(
const score::lcm::IdentifierHash& pg_name,
const score::lcm::IdentifierHash& pg_state) noexcept;
const score::mw::lifecycle::IdentifierHash& pg_name,
const score::mw::lifecycle::IdentifierHash& pg_state) noexcept;

/// @brief Method to retrieve result of Machine State initial transition to Startup state.
///
Expand Down Expand Up @@ -146,8 +147,8 @@ class ControlClientImpl final
/// State.
/// @error score::mw::lifecycle::ExecErrc::kCommunicationError if ControlClient can't communicate with Launch
/// Manager (e.g. IPC link is down)
score::Result<score::lcm::ExecutionErrorEvent> GetExecutionError(
const score::lcm::IdentifierHash& processGroup) noexcept;
score::Result<score::mw::lifecycle::ExecutionErrorEvent> GetExecutionError(
const score::mw::lifecycle::IdentifierHash& processGroup) noexcept;

~ControlClientImpl() noexcept;

Expand All @@ -161,7 +162,7 @@ class ControlClientImpl final
static std::mutex instance_creation_mutex_;

/// @brief callback that ControlClient instance ask us to invoke when there is a problem with PG
std::function<void(const score::lcm::ExecutionErrorEvent&)> undefined_state_callback_;
std::function<void(const score::mw::lifecycle::ExecutionErrorEvent&)> undefined_state_callback_;

/// @brief Array of active requests, that wait for completion from LCM side.
/// When a request has been send to LCM and the answer is not immediately available,
Expand All @@ -170,7 +171,7 @@ class ControlClientImpl final
/// answer arrives from LCM.
std::array<
ControlClientRequestInfo,
static_cast<uint16_t>(score::lcm::internal::ControlClientLimits::kControlClientMaxRequests)>
static_cast<uint16_t>(score::mw::lifecycle::internal::ControlClientLimits::kControlClientMaxRequests)>
control_client_requests_;

/// @brief Semaphore used to protect access to the request_ link of ControlClientChannel,
Expand All @@ -180,7 +181,7 @@ class ControlClientImpl final
/// Please note that synchronization for control_client_requests_ is only needed, when we are booking a slot
/// inside this array. When we are releasing a slot inside this array, this can be done without
/// ipc_request_semaphore_ protection.
score::lcm::internal::osal::Semaphore ipc_request_semaphore_;
score::mw::lifecycle::internal::osal::Semaphore ipc_request_semaphore_;

/// @brief Thread used for monitoring response_ link of ControlClientChannel.
/// Asynchronous nature of ControlClient API means responses to ControlClient requests, will arrive at
Expand All @@ -202,7 +203,7 @@ class ControlClientImpl final

/// @brief Handle to the real IPC communication channel with LCM
/// This handle is used to perform low level communication with LCM.
score::lcm::internal::ControlClientChannelP ipc_channel_;
score::mw::lifecycle::internal::ControlClientChannelP ipc_channel_;

/// @brief Helper method to send a message to LCM, through IPC link (aka request_ link).
///
Expand All @@ -225,7 +226,7 @@ class ControlClientImpl final
///
/// @threadsafety{thread-safe}
score::concurrency::InterruptibleFuture<void> SendIpcMessage(
score::lcm::internal::ControlClientMessage& msg) noexcept;
score::mw::lifecycle::internal::ControlClientMessage& msg) noexcept;
};

} // namespace score::mw::lifecycle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace score::mw::lifecycle::internal::alive
namespace
{

using ApplicationType = score::mw::launch_manager::configuration::ApplicationType;
using ApplicationType = score::mw::lifecycle::internal::configuration::ApplicationType;

bool isSupervisedType(ApplicationType app_type)
{
Expand All @@ -32,7 +32,7 @@ bool isSupervisedType(ApplicationType app_type)

} // namespace

AliveMonitorConfig aliveMonitorConfig(const score::mw::launch_manager::configuration::Config& config)
AliveMonitorConfig aliveMonitorConfig(const score::mw::lifecycle::internal::configuration::Config& config)
{
AliveMonitorConfig result{};
result.evaluation_cycle_ms = config.aliveSupervision().evaluation_cycle_ms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct SupervisedComponentConfig
/// @brief Component short name.
std::string name;
/// @brief Alive-supervision parameters.
std::optional<score::mw::launch_manager::configuration::ComponentAliveSupervision> alive_supervision;
std::optional<score::mw::lifecycle::internal::configuration::ComponentAliveSupervision> alive_supervision;
/// @brief Uid the component runs as.
uid_t uid{};
};
Expand All @@ -51,7 +51,7 @@ struct AliveMonitorConfig

/// @brief Returns a copy of alive-monitor-relevant configuration.
/// @return AliveMonitor configuration
AliveMonitorConfig aliveMonitorConfig(const score::mw::launch_manager::configuration::Config& config);
AliveMonitorConfig aliveMonitorConfig(const score::mw::lifecycle::internal::configuration::Config& config);

} // namespace score::mw::lifecycle::internal::alive

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace score::mw::lifecycle::internal::alive
namespace
{

namespace cfg = score::mw::launch_manager::configuration;
namespace cfg = configuration;

cfg::ComponentConfig makeComponent(
const std::string& name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace score
{
namespace lcm
namespace mw::lifecycle::internal
{
namespace saf
{
Expand Down Expand Up @@ -239,7 +239,7 @@ class FixedSizeVector
};
} // namespace common
} // namespace saf
} // namespace lcm
} // namespace mw::lifecycle::internal
} // namespace score

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace score
{
namespace lcm
namespace mw::lifecycle::internal
{
namespace saf
{
Expand Down Expand Up @@ -125,7 +125,7 @@ class LockedVector final : private FixedSizeVector<Type>

} // namespace common
} // namespace saf
} // namespace lcm
} // namespace mw::lifecycle::internal
} // namespace score

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace score
{
namespace lcm
namespace mw::lifecycle::internal
{
namespace saf
{
Expand Down Expand Up @@ -132,7 +132,7 @@ class Observable

} // namespace common
} // namespace saf
} // namespace lcm
} // namespace mw::lifecycle::internal
} // namespace score

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace score
{
namespace lcm
namespace mw::lifecycle::internal
{
namespace saf
{
Expand Down Expand Up @@ -73,7 +73,9 @@ class TimeSortingBuffer
/// @return Success of push (true) sufficient space in buffer was available
/* RULECHECKER_comment(0, 3, check_cheap_to_copy_in_parameter, "For template argument f_element_r, it is not \
possible to classify cheap_to_copy or expensive_to_copy without referring original object.", true_no_defect) */
bool push(const TimeSortedElementType& f_element_r, const score::lcm::saf::timers::NanoSecondType f_timestamp)
bool push(
const TimeSortedElementType& f_element_r,
const score::mw::lifecycle::internal::saf::timers::NanoSecondType f_timestamp)
{
bool isSuccess{false};
SortChainElement newElement{nullptr, nullptr, f_element_r, f_timestamp};
Expand Down Expand Up @@ -138,7 +140,8 @@ class TimeSortingBuffer
nullptr}; // Pointer to previous element, null pointer means first element (oldest)
SortChainElement* next_p{nullptr}; // Pointer to next element, null pointer means last element (latest)
TimeSortedElementType element{}; // Element to be sorted
score::lcm::saf::timers::NanoSecondType timestamp{0U}; // Timestamp used for sorting the elements
score::mw::lifecycle::internal::saf::timers::NanoSecondType timestamp{
0U}; // Timestamp used for sorting the elements
};

/// Sort elements
Expand Down Expand Up @@ -229,7 +232,7 @@ class TimeSortingBuffer

} // namespace common
} // namespace saf
} // namespace lcm
} // namespace mw::lifecycle::internal
} // namespace score

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@

#include "score/mw/launch_manager/alive_monitor/details/daemon/AliveMonitorImpl.hpp"

namespace score
{
namespace lcm
{
namespace saf
{
namespace daemon
namespace score::mw::lifecycle::internal::saf::daemon
{

AliveMonitorImpl::AliveMonitorImpl(
Expand Down Expand Up @@ -78,7 +72,4 @@ bool AliveMonitorImpl::run(std::atomic_bool& cancel_thread) noexcept
return m_daemon->startCyclicExec(cancel_thread);
}

} // namespace daemon
} // namespace saf
} // namespace lcm
} // namespace score
} // namespace score::mw::lifecycle::internal::saf::daemon
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,25 @@

namespace score
{
namespace lcm
namespace mw::lifecycle
{

class IRecoveryClient;

namespace internal
{

namespace saf
{

namespace daemon
{

using SptrIRecoveryClient = std::shared_ptr<score::lcm::IRecoveryClient>;
using UptrISupervisionControlReceiver = std::unique_ptr<score::lcm::ISupervisionControlReceiver>;
using UptrPhmDaemon = std::unique_ptr<score::lcm::saf::daemon::PhmDaemon>;
using OsClock = score::lcm::saf::timers::OsClockInterface;
using Config = score::mw::launch_manager::configuration::Config;
using SptrIRecoveryClient = std::shared_ptr<score::mw::lifecycle::IRecoveryClient>;
using UptrISupervisionControlReceiver = std::unique_ptr<score::mw::lifecycle::ISupervisionControlReceiver>;
using UptrPhmDaemon = std::unique_ptr<score::mw::lifecycle::internal::saf::daemon::PhmDaemon>;
using OsClock = score::mw::lifecycle::internal::saf::timers::OsClockInterface;
using Config = score::mw::lifecycle::internal::configuration::Config;
using AliveMonitorConfig = score::mw::lifecycle::internal::alive::AliveMonitorConfig;

class AliveMonitorImpl : public IAliveMonitor
Expand All @@ -62,7 +65,8 @@ class AliveMonitorImpl : public IAliveMonitor

} // namespace daemon
} // namespace saf
} // namespace lcm
} // namespace internal
} // namespace mw::lifecycle
} // namespace score

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace score
{
namespace lcm
namespace mw::lifecycle::internal
{
namespace saf
{
Expand All @@ -43,6 +43,6 @@ class IAliveMonitor

} // namespace daemon
} // namespace saf
} // namespace lcm
} // namespace mw::lifecycle::internal
} // namespace score
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@
#include "score/mw/launch_manager/alive_monitor/details/supervision/Alive.hpp"
#include "score/mw/launch_manager/alive_monitor/details/timers/Timers_OsClock.hpp"

namespace score
{
namespace lcm
{
namespace saf
{
namespace daemon
namespace score::mw::lifecycle::internal::saf::daemon
{

/* RULECHECKER_comment(0, 6, check_expensive_to_copy_in_parameter, "Move only types cannot be passed by const ref",
Expand Down Expand Up @@ -102,7 +96,4 @@ bool PhmDaemon::construct(const AliveMonitorConfig& config, const SupervisionBuf
return isSuccess;
}

} // namespace daemon
} // namespace saf
} // namespace lcm
} // namespace score
} // namespace score::mw::lifecycle::internal::saf::daemon
Loading
Loading