Classe Reference#
This section contains all classes tagged with @api.
-
class ComErrorDomain : public score::result::ErrorDomain#
Error domain for mw::com (CommunicationManagement).
- Feature API:
This class implements the ErrorDomain interface for the mw::com API. \requirement SWS_CM_11329 \threadsafe
Public Functions
-
inline std::string_view MessageFor(const score::result::ErrorCode &code) const noexcept final override#
Translates an error code into a human readable message.
- Todo:
Gcc compiler bug leads to a compiler warning if override is not added, even if final keyword is there (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010). When bug is fixed, remove the override keyword from the MessageFor function signature and the AUTOSAR.MEMB.VIRTUAL.SPEC klocwork suppression.
- Feature API:
This function is required by the std::error_domain interface
- Parameters:
code – The error code to translates
- Returns:
returns a string view to the human readable message \threadsafe
-
class FindServiceHandle#
A FindServiceHandle is returned by any StartFindService() method and is used to identify different searches. It needs to be passed to StopFindService() in order to cancel a respective search.
- Feature API:
\requirement SWS_CM_00303
Public Functions
-
FindServiceHandle() = delete#
-
~FindServiceHandle() noexcept = default#
-
FindServiceHandle &operator=(const FindServiceHandle &other) = default#
CopyAssignment for FindServiceHandle.
- Feature API:
- Parameters:
other – The FindServiceHandle *this shall be constructed from
- Post:
*this == other
- Returns:
The FindServiceHandle that was constructed
-
FindServiceHandle(const FindServiceHandle &other) = default#
CopyConstructor for FindServiceHandle.
- Feature API:
- Parameters:
other – The FindServiceHandle to copy from
- Returns:
The FindServiceHandle that was constructed
-
FindServiceHandle(FindServiceHandle &&other) noexcept = default#
MoveAssignment for FindServiceHandle.
- Feature API:
- Parameters:
other – The FindServiceHandle *this shall be constructed from
- Post:
*this == other
- Returns:
The FindServiceHandle that was constructed
-
FindServiceHandle &operator=(FindServiceHandle &&other) noexcept = default#
MoveAssignment for FindServiceHandle.
- Feature API:
- Parameters:
other – The FindServiceHandle *this shall be constructed from
- Post:
*this == other
- Returns:
The FindServiceHandle that was constructed
Friends
-
friend bool operator==(const FindServiceHandle &lhs, const FindServiceHandle &rhs) noexcept#
Compares two instances for equality.
- Feature API:
- Parameters:
lhs – The first instance to check for equality
rhs – The second instance to check for equality
- Returns:
true if lhs and rhs equal, false otherwise
-
friend bool operator<(const FindServiceHandle &lhs, const FindServiceHandle &rhs) noexcept#
LessThanComparable operator.
- Feature API:
- Parameters:
lhs – The first FindServiceHandle instance to compare
rhs – The second FindServiceHandle instance to compare
- Returns:
true if lhs is less then rhs, false otherwise
-
friend mw::log::LogStream &operator<<(mw::log::LogStream &log_stream, const FindServiceHandle &find_service_handle)#
Stream operator which enables logging of FindServiceHandle via mw::log::LogStream.
- Feature API:
- Parameters:
log_stream – The log stream to write to
find_service_handle – The FindServiceHandle to log
- Returns:
The log stream passed in as parameter
-
friend std::ostream &operator<<(std::ostream &ostream_out, const FindServiceHandle &find_service_handle)#
Stream operator which enables logging of FindServiceHandle via std::ostream.
- Feature API:
- Parameters:
ostream_out – The output stream to write to
find_service_handle – The FindServiceHandle to log
- Returns:
The output stream passed in as parameter
-
class GenericProxy : public score::mw::com::impl::ProxyBase#
GenericProxy is a non-binding specific Proxy class which doesn’t require any type information for its events. This means that it can connect to a service providing instance (skeleton) just based on deployment information specified at runtime.
- Todo:
The EventMap, events, needs to be populated with actual GenericProxyEvents.
- Feature API:
It contains a map of events which can access strongly-typed events in a type-erased way i.e. by accessing a raw memory buffer. It is the generic analogue of a Proxy, which contains strongly-typed events. While the Proxy is usually generated from the IDL, a GenericProxy can be manually instantiated at runtime based on deployment information.
Public Types
-
using EventMapView = ServiceElementMapView<GenericProxyEvent>#
Public Functions
-
~GenericProxy() noexcept#
-
GenericProxy(const GenericProxy&) = delete#
-
GenericProxy &operator=(const GenericProxy&) = delete#
-
GenericProxy(GenericProxy &&other) noexcept#
-
GenericProxy &operator=(GenericProxy &&other) noexcept#
-
EventMapView GetEvents() const noexcept#
Returns a read-only view to the name-keyed map of events.
- Feature API:
Note
The returned view is valid as long as the GenericProxy lives.
- Returns:
View to the event map.
Public Static Functions
-
static Result<GenericProxy> Create(HandleType instance_handle) noexcept#
Exception-less GenericProxy constructor.
- Feature API:
- Parameters:
instance_handle – Handle to the instance
- Returns:
Result containing the created GenericProxy instance or an error code.
Friends
- friend class test::GenericProxyAttorney
-
class InstanceIdentifier#
Represents a specific instance of a given service \requirement SWS_CM_00302.
- Feature API:
Public Functions
-
InstanceIdentifier() = delete#
-
~InstanceIdentifier() noexcept = default#
-
InstanceIdentifier &operator=(const InstanceIdentifier &other) = default#
CopyAssignment for InstanceIdentifier.
ctor from serialized representation.
Constructor is required by adaptive AUTOSAR Standard. But it uses exceptions, thus we will not implement it.
explicit InstanceIdentifier(std::string_view value);
- Feature API:
- Parameters:
other – The InstanceIdentifier *this shall be constructed from
- Post:
*this == other
- Returns:
The InstanceIdentifier that was constructed
-
InstanceIdentifier(const InstanceIdentifier&) = default#
Copy constructor for InstanceIdentifier.
- Feature API:
- Parameters:
other – The InstanceIdentifier to copy from
- Returns:
The InstanceIdentifier that was constructed
-
InstanceIdentifier(InstanceIdentifier&&) noexcept = default#
Move constructor for InstanceIdentifier.
- Feature API:
- Parameters:
other – The InstanceIdentifier to move from
- Post:
*this == other
- Returns:
The moved InstanceIdentifier
-
InstanceIdentifier &operator=(InstanceIdentifier &&other) noexcept = default#
MoveAssignment for InstanceIdentifier.
- Feature API:
- Parameters:
other – The InstanceIdentifier *this shall be constructed from
- Post:
*this == other
- Returns:
The InstanceIdentifier that was constructed
-
std::string_view ToString() const noexcept#
Returns the serialized form of the unknown internals of this class as a meaningful string.
- Feature API:
- Returns:
A non-owning string representation of the internals of this class
Public Static Functions
-
static score::Result<InstanceIdentifier> Create(std::string &&serialized_format) noexcept#
Exception-less constructor to create InstanceIdentifier from a serialized InstanceIdentifier created with InstanceIdentifier::ToString().
- Feature API:
- Parameters:
serialized_format – The serialized format to create the InstanceIdentifier from
- Returns:
The created InstanceIdentifier or an error
- Pre:
The score::mw::com::impl::Runtime singleton must have been created (then the configuration is “locked”) before calling this API, i.e. Only then has a valid Configuration pointer been registered (by the Runtime constructor) into which the reconstructed deployments are added. Currently, there is no public API whose sole purpose is to initialize/create the Runtime singleton; in practice any prior public score::mw::com call that reaches Runtime::getInstance() (e.g. creating a Skeleton/Proxy, FindService, or - as a last resort - score::mw::com::runtime::ResolveInstanceIDs called with a dummy InstanceSpecifier) triggers this. If the configuration has not been set, kInvalidConfiguration is returned.
Friends
-
friend bool operator==(const InstanceIdentifier &lhs, const InstanceIdentifier &rhs) noexcept#
Compares two instances for equality.
- Feature API:
- Parameters:
lhs – The first instance to check for equality
rhs – The second instance to check for equality
- Returns:
true if other and *this equal, false otherwise
-
friend bool operator<(const InstanceIdentifier &lhs, const InstanceIdentifier &rhs) noexcept#
LessThanComparable operator.
- Feature API:
- Parameters:
lhs – The first InstanceIdentifier instance to compare
rhs – The second InstanceIdentifier instance to compare
- Returns:
true if *this is less then other, false otherwise
-
class InstanceSpecifier#
Identifier for an application port. Maps design to deployment. \requirement SWS_CM_00350.
- Feature API:
Public Functions
-
std::string_view ToString() const noexcept#
Convert the InstanceSpecifier to a string representation.
- Feature API:
- Returns:
A string representation of the InstanceSpecifier.
Public Static Functions
-
static score::Result<InstanceSpecifier> Create(std::string &&shortname_path) noexcept#
Create an InstanceSpecifier from a shortname path.
- Feature API:
- Parameters:
shortname_path – The shortname path to create the InstanceSpecifier from.
- Returns:
A Result containing the created InstanceSpecifier or an error.
-
template<typename T>
static inline score::Result<InstanceSpecifier> Create(T &&shortname_path) noexcept# Create an InstanceSpecifier from various string-like types (deprecated template version).
Converting former static score::Result<InstanceSpecifier> Create(const std::string_view shortname_path) to this method template fixes the potential “ambiguity”, when calling Create() with a string literal. With the former (non-template) signature, there would be an ambiguity between both Create() overloads, one with std::string&& and one with std::string_view. But replacing the std::string_view overload with the method-template solves the ambiguity, because Template Create(T&&) Matches, as T = const char(&)[]
- Deprecated:
Use Create(std::string&&) instead for better performance.
- Parameters:
shortname_path – The shortname path to create the InstanceSpecifier from (convertible to std::string_view).
- Returns:
A Result containing the created InstanceSpecifier or an error.
-
class ProxyTrait#
Encapsulates all necessary attributes for a proxy.
The main idea of these traits are to ease the interface creation for a user. It reduces the necessary generated code to a bare minimum.
Thanks to these traits a user can construct an interface as follows:
template <typename Trait> class TheInterface : public Trait::Base { public: using Trait::Base::Base;
typename Trait::template Event<DataType1> struct_event_1_{*this, event_name_0}; typename Trait::template Event<DataType2> struct_event_2_{*this, event_name_1};
typename Trait::template Field<DataType1, WithGetter, WithSetter, WithNotifier> struct_field_1_{*this, field_name_0}; typename Trait::template Field<DataType2, WithNotifier> struct_field_2_{*this, field_name_1};
typename Trait::template Method<void(InArgType1)> struct_method_1_{*this, method_name_0}; typename Trait::template Method<ReturnType()> struct_method_2_{*this, method_name_1};
}; Notes regarding template args: a field takes its data type plus a pack of tags from {WithGetter, WithSetter, WithNotifier}. WithGetter / WithSetter enable Get() / Set() on the proxy. WithNotifier enables the proxy notifier public API (Subscribe, Unsubscribe, GetSubscriptionState, GetFreeSampleCount, GetNumNewSamplesAvailable, SetReceiveHandler, UnsetReceiveHandler, GetNewSamples). At least one of WithGetter or WithNotifier must be present, otherwise the value would be invisible to consumers. The skeleton-side Update/Allocate are part of every field. A method has a template arg describing the method signature in the form ReturnType(InArgType1, InArgType2, …). InArgs and ReturnType are optional. Therefore, these are valid signatures:
void()
ReturnType1()
void(InArgType1, InArgType2)
ReturnType1(InArgType1)
Having a defined interface, it is then possible to interpret this interface as proxy via
using TheProxy = AsProxy<TheInterface>, respectively as skeleton viausing TheSkeleton = AsSkeleton<TheInterface>.- Feature API:
Defines the trait types used by proxy interfaces following the trait pattern. This trait provides ProxyBase as the base class, ProxyEvent for events, and ProxyField for fields. Used as a template parameter when defining service interfaces that will be instantiated as proxies (client-side).
Public Types
-
using Base = ProxyBase#
-
template<typename SampleType>
using Event = ProxyEvent<SampleType>#
-
template<typename SampleType, typename ...Tags>
using Field = ProxyField<SampleType, Tags...>#
-
template<typename MethodSignature>
using Method = ProxyMethod<MethodSignature>#
-
class SkeletonTrait#
Encapsulates all necessary attributes for a skeleton.
- Feature API:
Defines the trait types used by skeleton interfaces following the trait pattern. This trait provides SkeletonBase as the base class, SkeletonEvent for events, and SkeletonField for fields. Used as a template parameter when defining service interfaces that will be instantiated as skeletons (server-side).
Public Types
-
using Base = SkeletonBase#
-
template<typename SampleType>
using Event = SkeletonEvent<SampleType>#
-
template<typename SampleType, typename ...Tags>
using Field = SkeletonField<SampleType, Tags...>#
-
template<typename MethodSignature>
using Method = SkeletonMethod<MethodSignature>#
-
class RuntimeConfiguration#
RuntimeConfiguration object which a user can construct and pass to the public InitializeRuntime call.
- Feature API:
Public Functions
-
RuntimeConfiguration()#
Default constructor which initialiases the stored configuration path with a default value.
It can be useful for debugging purposes for an application to want to explicitly initialize the runtime using defaults to check configuration parsing.
-
RuntimeConfiguration(const std::int32_t argc, score::StringLiteral argv[])#
Constructor which initialiases the stored configuration path from command line arguments.
- Feature API:
The constructor parses the command line arguments for a specific key to extract the configuration path. If the key is not found, a default path is used.
- Parameters:
argc – The number of command line arguments.
argv – The array of command line arguments.
-
explicit RuntimeConfiguration(filesystem::Path configuration_path)#
Constructor which initialiases the stored configuration path with the provided path.
- Feature API:
- Parameters:
configuration_path – The configuration path to be stored.
-
const filesystem::Path &GetConfigurationPath() const &#
Returns the stored configuration path.
- Feature API:
- Returns:
The stored configuration path.