DEENESPTFRRUARHIKOZHNL

class ara::core::Map::value_compare

[SWS_CORE_01419]

class value_compare {...};

As per corresponding usage in [map]

Header-Datei#include "ara/core/map.h"
Forwarding-Header#include "ara/core/core_fwd.h"
Scopeclass ara::core::Map

User GuideAI-GENERATED

Serves as a function object for comparing two key-value pairs of a map by their keys.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: a8fa08ca7764 Provenance Open questions (3)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Serves as a function object for comparing two key-value pairs of a map by their keys.

The helper class ara::core::Map::value_compare serves as a function object for relationally comparing two value pairs of a map based on their keys using an internally encapsulated comparison predicate [SWS_CORE_01421]. Instantiation is performed in a protected manner primarily by the enclosing map structure, while callers carry out the evaluation via the call operator operator() [SWS_CORE_01423]. Because the operations are not exception-safe according to the specification, calling code must account for possible exceptions from the underlying predicate.

Context

The helper class ara::core::Map::value_compare provides a function object in module core of the AUTOSAR Adaptive Platform, with the help of which two complete key-value elements (value_type) of an associative map can be compared. According to the specification, the class follows the established behavior of the C++ standard library for [map]. Its central task is to make the predicate of type Compare defined for ordering keys applicable to entire value pairs. For this purpose, the class encapsulates an internal instance of this predicate in the protected member variable comp [SWS_CORE_01421]. In this way, value_compare interacts directly with the enclosing data structure ara::core::Map and ensures externally that sorting or search algorithms can consistently compare value pairs by their keys.

Lifecycle

The instantiation of value_compare is subject to strict access restrictions: constructor value_compare(Compare c) is provided with visibility protected [SWS_CORE_01422]. Interpretation: Due to this protected visibility, the creation of new instances is likely primarily reserved for the enclosing class ara::core::Map itself, while ordinary callers obtain ready-to-use function objects from the map. Question Q-f188cfa9cf627a11 (open) Upon construction, the object takes the comparison predicate and stores it in the protected variable comp [SWS_CORE_01421]. A lifecycle with complex state transitions does not exist; after its creation, the instance remains in an immutable execution state. For concurrent operation, this means that parallel read accesses via the call operator are non-critical as long as the encapsulated predicate Compare operates statelessly or thread-safely.

Usage Path

The regular usage path focuses on the repeated evaluation of value pairs via the function call operator operator() [SWS_CORE_01423]. This operator is declared as a const method and accepts two references to constant elements of type value_type. Interpretation: During execution, operator() accesses the key components of the two passed value pairs and passes them to the predicate [SWS_CORE_01421] stored in comp in order to return the relational result as a boolean value. Question Q-207114486c204301 (open) The following diagram illustrates this standardized sequence:

Comparison of two value pairs via value_compareCallervalue_comparecompoperator()(x, y)Extract keys from x and yComparison of keysboolesches ErgebnisReturn bool

Sequence diagram: Sequence of the value comparison via operator() and the encapsulated predicate comp. Sources: [SWS_CORE_01421], [SWS_CORE_01423]

This path is typically used in algorithms that need to check or traverse elements of a map based on their sort order without requiring the user to manually dereference the keys from the value pairs.

Error Scenarios

Regarding robustness and exception handling, it should be noted that neither the constructor [SWS_CORE_01422] nor the call operator operator() [SWS_CORE_01423] is specified as exception-safe; both are explicitly classified as “not exception safe”. Interpretation: In practice, this means that the class does not encapsulate its own exception handling mechanisms and exceptions thrown during the copying or execution of the user-defined predicate Compare are propagated directly to the caller. Question Q-427fd0afbba7bf9e (open) The specification does not define specific error codes for this helper class. Therefore, essential prerequisites for error-free operation are that the passed predicate Compare can be instantiated and executed without error, and that the references to value_type passed to operator() are valid.

This guide is based on the specification of the AUTOSAR Adaptive Platform for Release R25-11.

Member map

Constructors and destructor

1

Operators

1

Constants

1

Class diagram

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__core__Map__value_compare839 value_compare + comp + operator()() + value_compare()

Detail view

Select an entry in the outline.

Constructors and destructor

value_compare function

≙ [map]

ara::core::Map< Key, T, Compare, Allocator >::value_compare::value_ compare (Compare c);

Operators

operator() function

≙ [map]

bool ara::core::Map< Key, T, Compare, Allocator >::value_ compare::operator() (const value_type &x, const value_type &y) const;

Constants

comp variable

≙ [map]

Compare ara::core::Map< Key, T, Compare, Allocator >::value_ compare::comp;

Method documentation

function operator() [SWS_CORE_01423]

bool ara::core::Map< Key, T, Compare, Allocator >::value_ compare::operator() (const value_type &x, const value_type &y) const;

As per corresponding usage in [map]

Header-Datei#include "ara/core/map.h"
Scopeclass ara::core::Map::value_compare
Exception-Sicherheitnot exception safe

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CORE_01423
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_01423@rel:R25-11#93dc6198
Content hash
93dc6198
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_01423
Status: valid/unmigrated Version: rel:R25-11#93dc6198 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CORE_01423@rel:R25-11#93dc6198
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function value_compare [SWS_CORE_01422]

ara::core::Map< Key, T, Compare, Allocator >::value_compare::value_ compare (Compare c);

As per corresponding usage in [map]

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 167c47c6c4cd Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The constructor [SWS_CORE_01422] of the nested helper class ara::core::Map::value_compare initializes a comparison object for value elements using a passed predicate Compare c. According to the specification, the visibility is declared as protected; users therefore do not construct instances directly in regular application code, but typically obtain them via the member function ara::core::Map::value_comp() [SWS_CORE_01489].

Interaction and Semantics

The interaction within the class comprises the following aspects:

  • Storage of the predicate: The passed predicate c is presumably stored in the protected attribute comp [SWS_CORE_01421]. Question Q-59027030aa59242e (open)
  • Evaluation: The stored predicate then serves for evaluation by operator() [SWS_CORE_01423] to compare two elements of type value_type based on their keys.
  • Header inclusion: The declaration is provided via header file #include "ara/core/map.h".

Error Handling and Restrictions

The specification explicitly classifies the function as not exception safe [SWS_CORE_01422]. Specific error codes, DET notifications, or DEM notifications are not defined for this constructor. In addition, callers must not perform direct instantiation outside derived contexts due to the protected visibility (protected).

This text was created by an AI and is based solely on specification data from AUTOSAR R25-11.

Implementer's Guide to follow (complexity I1)

Header-Datei#include "ara/core/map.h"
Scopeclass ara::core::Map::value_compare
Exception-Sicherheitnot exception safe
Sichtbarkeitprotected

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CORE_01422
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_01422@rel:R25-11#2d619be5
Content hash
2d619be5
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_01422
Status: valid/unmigrated Version: rel:R25-11#2d619be5 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CORE_01422@rel:R25-11#2d619be5
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

Documentation of constants / variables

variable comp [SWS_CORE_01421]

Compare ara::core::Map< Key, T, Compare, Allocator >::value_ compare::comp;

As per corresponding usage in [map]

Header-Datei#include "ara/core/map.h"
Scopeclass ara::core::Map::value_compare
Symbolcomp
TypCompare
Sichtbarkeitprotected

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CORE_01421
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CORE_01421@rel:R25-11#d66f4d5d
Content hash
d66f4d5d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Core.pdf#nameddest=SWS_CORE_01421
Status: valid/unmigrated Version: rel:R25-11#d66f4d5d Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CORE_01421@rel:R25-11#d66f4d5d
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill