Skip to content
Draft
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
1 change: 0 additions & 1 deletion score/mw/com/example/ipc_bridge/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ cc_library(
features = COMPILER_WARNING_FEATURES,
deps = [
"//score/mw/com",
"@score_baselibs//score/language/futurecpp",
],
)

Expand Down
12 changes: 6 additions & 6 deletions score/mw/com/example/ipc_bridge/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ using namespace std::chrono_literals;

struct Params
{
score::cpp::optional<std::string> mode;
score::cpp::optional<std::string> instance_manifest;
score::cpp::optional<std::chrono::milliseconds> cycle_time;
score::cpp::optional<unsigned long> cycle_num;
std::optional<std::string> mode;
std::optional<std::string> instance_manifest;
std::optional<std::chrono::milliseconds> cycle_time;
std::optional<unsigned long> cycle_num;
bool check_sample_hash;
};

template <typename ParsedType, typename SavedType = ParsedType>
score::cpp::optional<SavedType> GetValueIfProvided(const boost::program_options::variables_map& args,
std::optional<SavedType> GetValueIfProvided(const boost::program_options::variables_map& args,
std::string arg_string)
{
return (args.count(arg_string) > 0U) ? static_cast<SavedType>(args[arg_string].as<ParsedType>())
: score::cpp::optional<SavedType>();
: std::optional<SavedType>();
}

Params ParseCommandLineArguments(const int argc, const char** argv)
Expand Down
16 changes: 8 additions & 8 deletions score/mw/com/example/ipc_bridge/sample_sender_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#include "score/mw/com/impl/proxy_event.h"
#include <score/assert.hpp>
#include <score/hash.hpp>
#include <score/optional.hpp>

#include <cstring>
#include <fstream>
#include <iostream>
#include <optional>
#include <sstream>
#include <string>
#include <thread>
Expand Down Expand Up @@ -145,18 +145,18 @@ class SampleReceiver
}

const score::mw::com::InstanceSpecifier& instance_specifier_;
score::cpp::optional<std::uint32_t> last_received_;
std::optional<std::uint32_t> last_received_;
std::size_t received_;
bool check_sample_hash_;
};

score::cpp::optional<std::reference_wrapper<impl::ProxyEvent<MapApiLanesStamped>>> GetMapApiLanesStampedProxyEvent(
std::optional<std::reference_wrapper<impl::ProxyEvent<MapApiLanesStamped>>> GetMapApiLanesStampedProxyEvent(
IpcBridgeProxy& proxy)
{
return proxy.map_api_lanes_stamped_;
}

score::cpp::optional<std::reference_wrapper<impl::GenericProxyEvent>> GetMapApiLanesStampedProxyEvent(
std::optional<std::reference_wrapper<impl::GenericProxyEvent>> GetMapApiLanesStampedProxyEvent(
GenericProxy& generic_proxy)
{
const std::string event_name{"map_api_lanes_stamped"};
Expand Down Expand Up @@ -273,7 +273,7 @@ Result<SampleAllocateePtr<MapApiLanesStamped>> PrepareMapLaneSample(IpcBridgeSke

template <typename ProxyType, typename ProxyEventType>
int EventSenderReceiver::RunAsProxy(const score::mw::com::InstanceSpecifier& instance_specifier,
const score::cpp::optional<std::chrono::milliseconds> cycle_time,
const std::optional<std::chrono::milliseconds> cycle_time,
const std::size_t num_cycles,
bool try_writing_to_data_segment,
bool check_sample_hash)
Expand Down Expand Up @@ -331,7 +331,7 @@ int EventSenderReceiver::RunAsProxy(const score::mw::com::InstanceSpecifier& ins
return EXIT_FAILURE;
}

score::cpp::optional<char> last_received{};
std::optional<char> last_received{};
SampleReceiver receiver{instance_specifier, check_sample_hash};
for (std::size_t cycle = 0U; cycle < num_cycles;)
{
Expand Down Expand Up @@ -466,13 +466,13 @@ int EventSenderReceiver::RunAsSkeleton(const score::mw::com::InstanceSpecifier&

template int EventSenderReceiver::RunAsProxy<IpcBridgeProxy, impl::ProxyEvent<MapApiLanesStamped>>(
const score::mw::com::InstanceSpecifier&,
const score::cpp::optional<std::chrono::milliseconds>,
const std::optional<std::chrono::milliseconds>,
const std::size_t,
bool,
bool);
template int EventSenderReceiver::RunAsProxy<impl::GenericProxy, impl::GenericProxyEvent>(
const score::mw::com::InstanceSpecifier&,
const score::cpp::optional<std::chrono::milliseconds>,
const std::optional<std::chrono::milliseconds>,
const std::size_t,
bool,
bool);
Expand Down
4 changes: 2 additions & 2 deletions score/mw/com/example/ipc_bridge/sample_sender_receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "datatype.h"

#include <score/optional.hpp>
#include <optional>

#include <atomic>
#include <chrono>
Expand All @@ -36,7 +36,7 @@ class EventSenderReceiver
template <typename ProxyType = score::mw::com::IpcBridgeProxy,
typename ProxyEventType = score::mw::com::impl::ProxyEvent<MapApiLanesStamped>>
int RunAsProxy(const score::mw::com::InstanceSpecifier& instance_specifier,
const score::cpp::optional<std::chrono::milliseconds> cycle_time,
const std::optional<std::chrono::milliseconds> cycle_time,
const std::size_t num_cycles,
bool try_writing_to_data_segment = false,
bool check_sample_hash = true);
Expand Down
4 changes: 0 additions & 4 deletions score/mw/com/impl/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ cc_library(
":skeleton_event_binding",
"//score/mw/com/impl/tracing:skeleton_event_tracing",
"//score/mw/com/impl/tracing:skeleton_event_tracing_data",
"@score_baselibs//score/language/futurecpp",
"@score_baselibs//score/result",
],
)
Expand All @@ -246,7 +245,6 @@ cc_library(
deps = [
":error",
":skeleton_event_base",
"@score_baselibs//score/language/futurecpp",
"@score_baselibs//score/result",
"@score_logging//score/mw/log",
],
Expand Down Expand Up @@ -434,7 +432,6 @@ cc_library(
],
deps = [
"proxy_event_binding",
"@score_baselibs//score/language/futurecpp",
],
)

Expand Down Expand Up @@ -901,7 +898,6 @@ cc_gtest_unit_test(
srcs = ["sample_reference_tracker_test.cpp"],
deps = [
":sample_reference_tracker",
"@score_baselibs//score/language/futurecpp",
],
)

Expand Down
3 changes: 0 additions & 3 deletions score/mw/com/impl/bindings/lola/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ cc_library(
":skeleton",
"//score/mw/com/impl/configuration",
"@score_baselibs//score/concurrency",
"@score_baselibs//score/language/futurecpp",
"@score_logging//score/mw/log",
],
)
Expand Down Expand Up @@ -99,7 +98,6 @@ cc_library(
deps = [
":proxy_instance_identifier",
"//score/mw/com/impl/configuration",
"@score_baselibs//score/language/futurecpp",
],
)

Expand All @@ -114,7 +112,6 @@ cc_library(
],
deps = [
"//score/mw/com/impl/configuration",
"@score_baselibs//score/language/futurecpp",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ auto EventDataControlCompositeImpl<AtomicIndirectorType>::GetNextFreeMultiSlot()
-> ControlSlotCompositeIndicator
{
EventSlotStatus::EventTimeStamp oldest_time_stamp{EventSlotStatus::TIMESTSCORE_LANGUAGE_FUTURECPP_MAX};
score::cpp::optional<SlotIndexType> possible_index{};
std::optional<SlotIndexType> possible_index{};
EventDataControl::EventControlSlots::iterator qm_slot_ptr{nullptr};
EventDataControl::EventControlSlots::iterator asil_b_slot_ptr{nullptr};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EventDataControlCompositeAttorney::EventDataControlCompositeAttorney(
}

void EventDataControlCompositeAttorney::PrepareAllocateNextSlot(
const std::pair<score::cpp::optional<SlotIndexType>, bool> expected_result) noexcept
const std::pair<std::optional<SlotIndexType>, bool> expected_result) noexcept
{
event_data_control_composite_.ignore_qm_control_ = expected_result.second;
const auto slot_index =
Expand Down Expand Up @@ -61,14 +61,14 @@ void EventDataControlCompositeAttorney::SetQmControlDisconnected(const bool expe
event_data_control_composite_.ignore_qm_control_ = expected_result;
}

std::pair<EventSlotStatus, score::cpp::optional<EventSlotStatus>> EventDataControlCompositeAttorney::GetSlotStatus(
std::pair<EventSlotStatus, std::optional<EventSlotStatus>> EventDataControlCompositeAttorney::GetSlotStatus(
const SlotIndexType slot_index) const noexcept
{
return {EventSlotStatus(event_data_control_composite_.asil_qm_control_->state_slots_[slot_index]),
event_data_control_composite_.asil_b_control_ != nullptr
? score::cpp::optional<EventSlotStatus>(
? std::optional<EventSlotStatus>(
event_data_control_composite_.asil_b_control_->state_slots_[slot_index])
: score::cpp::optional<EventSlotStatus>{}};
: std::optional<EventSlotStatus>{}};
}

EventDataControlAttorney::EventDataControlAttorney(EventDataControl& event_data_control) noexcept
Expand All @@ -77,7 +77,7 @@ EventDataControlAttorney::EventDataControlAttorney(EventDataControl& event_data_
}

void EventDataControlAttorney::PrepareAllocateNextSlot(
const score::cpp::optional<SlotIndexType> expected_result) noexcept
const std::optional<SlotIndexType> expected_result) noexcept
{
const auto slot_index =
expected_result.has_value() ? expected_result.value() : std::numeric_limits<SlotIndexType>::max();
Expand All @@ -102,7 +102,7 @@ void EventDataControlAttorney::PrepareAllocateNextSlot(
}
}

void EventDataControlAttorney::PrepareReferenceNextEvent(const score::cpp::optional<SlotIndexType> expected_result,
void EventDataControlAttorney::PrepareReferenceNextEvent(const std::optional<SlotIndexType> expected_result,
const EventSlotStatus::EventTimeStamp last_search_time,
const EventSlotStatus::EventTimeStamp upper_limit) noexcept
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "score/mw/com/impl/bindings/lola/event_data_control.h"
#include "score/mw/com/impl/bindings/lola/event_data_control_composite.h"

#include <score/optional.hpp>
#include <optional>

namespace score::mw::com::impl::lola
{
Expand All @@ -29,7 +29,7 @@ class EventDataControlCompositeAttorney
/// \brief Prepares the underlying EventDataControlComposite (its contained EventDataControls) in a way, that the
/// next call to AllocateNextSlot() will return the given expected_result
/// \param expected_result to be expected result for AllocateNextSlot()
void PrepareAllocateNextSlot(const std::pair<score::cpp::optional<SlotIndexType>, bool> expected_result) noexcept;
void PrepareAllocateNextSlot(const std::pair<std::optional<SlotIndexType>, bool> expected_result) noexcept;
/// \brief Prepares the underlying EventDataControlComposite in way, that it returns the expected_result in the next
/// call to IsQmControlDisconnected()
/// \param expected_result to be expected result for IsQmControlDisconnected()
Expand All @@ -38,7 +38,7 @@ class EventDataControlCompositeAttorney
/// \param slot_index index for which the EventSlotStatus shall be returned
/// \return a pair, where first contains the EventSlotStatus of qm control and second (optionally) the
/// EventSlotStatus of the asil_b control.
std::pair<EventSlotStatus, score::cpp::optional<EventSlotStatus>> GetSlotStatus(
std::pair<EventSlotStatus, std::optional<EventSlotStatus>> GetSlotStatus(
const SlotIndexType slot_index) const noexcept;

private:
Expand All @@ -53,7 +53,7 @@ class EventDataControlAttorney
/// \brief Prepares the underlying EventDataControl in a way, that the
/// next call to AllocateNextSlot() will return the given expected_result
/// \param expected_result to be expected result for AllocateNextSlot()
void PrepareAllocateNextSlot(const score::cpp::optional<SlotIndexType> expected_result) noexcept;
void PrepareAllocateNextSlot(const std::optional<SlotIndexType> expected_result) noexcept;

/// \brief Prepares the underlying EventDataControl in a way, that the next call to ReferenceNextEvent() will return
/// the given expected_result.
Expand All @@ -64,7 +64,7 @@ class EventDataControlAttorney
/// \param expected_result to be expected result for ReferenceNextEvent()
/// \param last_search_time see ReferenceNextEvent()
/// \param upper_limit see ReferenceNextEvent()
void PrepareReferenceNextEvent(const score::cpp::optional<SlotIndexType> expected_result,
void PrepareReferenceNextEvent(const std::optional<SlotIndexType> expected_result,
const EventSlotStatus::EventTimeStamp last_search_time,
const EventSlotStatus::EventTimeStamp upper_limit =
EventSlotStatus::TIMESTSCORE_LANGUAGE_FUTURECPP_MAX) noexcept;
Expand Down
2 changes: 1 addition & 1 deletion score/mw/com/impl/bindings/lola/proxy_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
#include "score/result/result.h"

#include <score/assert.hpp>
#include <score/optional.hpp>

#include <exception>
#include <iostream>
#include <limits>
#include <memory>
#include <mutex>
#include <optional>
#include <sstream>
#include <string_view>
#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion score/mw/com/impl/bindings/lola/proxy_event_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ std::optional<std::uint16_t> ProxyEventCommon::GetMaxSampleCount() const noexcep
return subscription_event_state_machine_.GetMaxSampleCount();
}

score::cpp::optional<TransactionLogSet::TransactionLogIndex> ProxyEventCommon::GetTransactionLogIndex() const noexcept
std::optional<TransactionLogSet::TransactionLogIndex> ProxyEventCommon::GetTransactionLogIndex() const noexcept
{
return subscription_event_state_machine_.GetTransactionLogIndex();
}
Expand Down
6 changes: 3 additions & 3 deletions score/mw/com/impl/bindings/lola/proxy_event_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
#include "score/result/result.h"

#include <score/assert.hpp>
#include <score/optional.hpp>
#include <score/utility.hpp>

#include <mutex>
#include <optional>
#include <string_view>

namespace score::mw::com::impl::lola
Expand Down Expand Up @@ -91,7 +91,7 @@ class ProxyEventCommon final
return event_control_;
};
std::optional<std::uint16_t> GetMaxSampleCount() const noexcept;
score::cpp::optional<TransactionLogSet::TransactionLogIndex> GetTransactionLogIndex() const noexcept;
std::optional<TransactionLogSet::TransactionLogIndex> GetTransactionLogIndex() const noexcept;
void NotifyServiceInstanceChangedAvailability(const bool is_available, const pid_t new_event_source_pid) noexcept;

private:
Expand All @@ -104,7 +104,7 @@ class ProxyEventCommon final
{
score::cpp::ignore = test_slot_collector_.emplace(std::move(slot_collector));
};
score::cpp::optional<SlotCollector> test_slot_collector_;
std::optional<SlotCollector> test_slot_collector_;

Proxy& parent_;
ElementFqId event_fq_id_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ LolaServiceId kLolaServiceId{2U};
LolaServiceInstanceId::InstanceId kLolaInstanceId{3U};

const LolaServiceInstanceDeployment kLolaServiceInstanceDeploymentWithMethods{
kLolaInstanceId,
LolaServiceInstanceId{kLolaInstanceId},
{},
{},
{{kDummyMethodName0, LolaMethodInstanceDeployment{kDummyQueueSize0}},
Expand Down Expand Up @@ -893,7 +893,7 @@ TEST_F(ProxyMethodHandlingFixture, EnablingMethodThatDoesNotContainQueueSizeInCo
// empty queue size
const std::optional<LolaMethodInstanceDeployment::QueueSize> empty_queue_size{};
const LolaServiceInstanceDeployment lola_service_instance_deployment_missing_queue_size{
kLolaInstanceId, {}, {}, {{kDummyMethodName0, LolaMethodInstanceDeployment{empty_queue_size}}}};
LolaServiceInstanceId{kLolaInstanceId}, {}, {}, {{kDummyMethodName0, LolaMethodInstanceDeployment{empty_queue_size}}}};
const LolaServiceTypeDeployment lola_service_type_deployment{
kLolaServiceId, {}, {}, {{kDummyMethodName0, kDummyMethodId0}}};

Expand Down
2 changes: 1 addition & 1 deletion score/mw/com/impl/bindings/lola/proxy_method_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ProxyMethodFixture : public ProxyMockedMemoryFixture
make_ServiceIdentifierType("foo"),
QualityType::kASIL_QM,
LolaServiceTypeDeployment{42U},
LolaServiceInstanceDeployment{1U}};
LolaServiceInstanceDeployment{LolaServiceInstanceId{1U}}};

std::unique_ptr<ProxyMethod> unit_{nullptr};

Expand Down
2 changes: 1 addition & 1 deletion score/mw/com/impl/bindings/lola/proxy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ TEST_F(ProxyCreationDeathTest, CreatingProxyWithoutLolaServiceInstanceIdTerminat
// Given a deployment information which contains a lola instance deployment which has no instance ID
const ServiceInstanceDeployment service_instance_deployment_without_instance_id{
service,
LolaServiceInstanceDeployment{score::cpp::optional<LolaServiceInstanceId>{}},
LolaServiceInstanceDeployment{std::optional<LolaServiceInstanceId>{}},
QualityType::kASIL_QM,
kInstanceSpecifier};
const auto identifier =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ auto ServiceDiscoveryClient::OfferService(const InstanceIdentifier instance_iden
}
}

QualityAwareContainer<score::cpp::optional<FlagFile>> flag_files{};
QualityAwareContainer<std::optional<FlagFile>> flag_files{};
// Suppress "AUTOSAR C++14 M6-4-3" rule finding. This rule declares: "A switch statement shall be
// a well-formed switch statement".
// We don't need a break statement at each case as we use fallthrough and return.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class ServiceDiscoveryClient final : public IServiceDiscoveryClient

std::recursive_mutex worker_mutex_;
concurrency::TaskResult<void> worker_thread_result_;
std::unordered_map<InstanceIdentifier, QualityAwareContainer<score::cpp::optional<FlagFile>>> flag_files_;
std::unordered_map<InstanceIdentifier, QualityAwareContainer<std::optional<FlagFile>>> flag_files_;
std::unordered_set<FindServiceHandle> obsolete_search_requests_;
std::mutex flag_files_mutex_;
};
Expand Down
Loading