DEENESPTFRRUARHIKOZHNL

struct ara::tsync::UserData

[SWS_TS_14230] Upstream: RS_TS_00014 wording not yet imported

struct UserData {...};

Structure to define user data. .

Header-Datei#include "ara/tsync/synchronized_time_base_status.h"
Forwarding-Header#include "ara/tsync/tsync_fwd.h"
Scopenamespace ara::tsync

User GuideAI-GENERATED

Provides a buffer for transmitting small application-specific user data for synchronized time bases.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 44e6e39606c3 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Provides a buffer for transmitting small application-specific user data for synchronized time bases.

The structure ara::tsync::UserData serves to transmit compact application-specific user data within synchronized time bases. It manages a static buffer with an immutable upper limit of three bytes defined via kMaxUserDataSize [SWS_TS_14231]. Applications write user data into the array and indicate the number of actually valid bytes via the field size [SWS_TS_14232]. As a central boundary condition, the applying program logic must ensure that size never exceeds the defined maximum capacity and that accesses to uninitialized buffer areas are avoided.

Context

The data structure ara::tsync::UserData serves within the functional cluster for time synchronization (tsync) of the AUTOSAR Adaptive Platform to encapsulate application-specific user data within synchronized time bases. The structure is declared in header file ara/tsync/synchronized_time_base_status.h. Its primary responsibility is to provide a compact, statically sized memory area for supplementary application data transmitted or evaluated together with time information. The maximum size of this user data is set to exactly three bytes by the static constant kMaxUserDataSize [SWS_TS_14231]. Array data of type ara::core::Array<ara::core::Byte, kMaxUserDataSize> is used for buffering the actual user data bytes [SWS_TS_14233]. This buffer is supplemented by field size, which indicates the number of actually valid user data bytes in the buffer [SWS_TS_14232]. Interpretation: Due to its definition location in header ara/tsync/synchronized_time_base_status.h, UserData is likely to serve primarily as a status field for transmitting small supplementary application-related information such as control flags or counters. Question Q-a0fb20686141f042 (open) Time-providing services and receiving applications that query or forward the status of a synchronized time base typically act as interaction partners.

Lifecycle

As an ordinary C++ structure (value object), UserData has no complex internal lifecycle and completely avoids dynamic memory allocations. Instances typically originate on the stack or as an embedded data member of higher-level status structures. Initialization takes place directly via member initialization or standard C++ assignment. Regarding ownership, the structure is subject to value semantics: creating components fully own their local instance and pass it by copy or reference to interfaces. Since UserData implements no internal synchronization mechanisms or mutex locks, concurrent read and write access from multiple threads to the same instance is not thread-safe. Applications must protect concurrent accesses through external synchronization measures, whereas independent instances can be used safely in concurrent contexts. Destruction requires no explicit cleanup of resources because the contained data member data [SWS_TS_14233] is statically allocated.

Usage Path

A typical usage path comprises populating, forwarding, and evaluating the data buffer. First, a transmitting or status-providing component creates an instance of UserData. The user data is then copied into the array data, whereby a maximum of kMaxUserDataSize bytes may be occupied [SWS_TS_14231], [SWS_TS_14233]. Immediately thereafter, the component sets the field size to the actual number of bytes written [SWS_TS_14232]. On the receiver side, the processing application first checks the value of size [SWS_TS_14232]. If size is greater than zero, the application reads exactly this valid prefix from buffer data [SWS_TS_14233]. Values outside this range, i.e., from index size to kMaxUserDataSize - 1, are ignored because they may contain undefined or outdated residual data.

Error Scenarios

Error situations in UserData result primarily from inconsistencies between the size specification and the buffer capacity. If the field size assumes a value that exceeds the defined maximum size kMaxUserDataSize of three bytes [SWS_TS_14231], this represents a violation of specification limits. In such a case, iterative reading of data [SWS_TS_14233] risks buffer overflows or out-of-bounds accesses to the array. Another risk consists of reading data erroneously when size is equal to zero [SWS_TS_14232], as no valid user data is present in this state. Error codes or exceptions are not generated by the structure itself; validating preconditions – especially size <= kMaxUserDataSize – is therefore entirely the responsibility of the applying program logic.

This guide is based on the AUTOSAR Adaptive R25-11 specification. All statements rely on the referenced SWS requirements.

Member map

Class diagram

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

G nara__tsync__UserData398 «struct» UserData + data + kMaxUserDataSize + size

Detail view

Select an entry in the outline.

Constants

data variable

User data buffer (maximum size: kMaxUserDataSize). .

Maximum number of user data bytes. .

static constexpr std::size_t kMaxUserDataSize = 3u;
size variable

Number of valid user data bytes in data. .

Documentation of constants / variables

variable data [SWS_TS_14233] Upstream: RS_TS_00014 wording not yet imported

ara::core::Array<ara::core::Byte, kMaxUserDataSize> data;

User data buffer (maximum size: kMaxUserDataSize). .

Header-Datei#include "ara/tsync/synchronized_time_base_status.h"
Scopestruct ara::tsync::UserData
Symboldata
Typara::core::Array< ara::core::Byte, kMaxUserDataSize >

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

Record
AUTOSAR/AP/record/SWS_TS_14233
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_14233@rel:R25-11#1f27c5a4
Content hash
1f27c5a4
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_14233
Status: valid/unmigrated Version: rel:R25-11#1f27c5a4 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_TS_14233@rel:R25-11#1f27c5a4
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

variable kMaxUserDataSize [SWS_TS_14231] Upstream: RS_TS_00014 wording not yet imported

static constexpr std::size_t kMaxUserDataSize = 3u;

Maximum number of user data bytes. .

Header-Datei#include "ara/tsync/synchronized_time_base_status.h"
Scopestruct ara::tsync::UserData
SymbolkMaxUserDataSize
Typstd::size_t

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

Record
AUTOSAR/AP/record/SWS_TS_14231
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_14231@rel:R25-11#df87c9f1
Content hash
df87c9f1
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_14231
Status: valid/unmigrated Version: rel:R25-11#df87c9f1 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_TS_14231@rel:R25-11#df87c9f1
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

variable size [SWS_TS_14232] Upstream: RS_TS_00014 wording not yet imported

std::size_t size;

Number of valid user data bytes in data. .

Header-Datei#include "ara/tsync/synchronized_time_base_status.h"
Scopestruct ara::tsync::UserData
Symbolsize
Typstd::size_t

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

Record
AUTOSAR/AP/record/SWS_TS_14232
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_TS_14232@rel:R25-11#ddf624eb
Content hash
ddf624eb
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_TimeSynchronization.pdf#nameddest=SWS_TS_14232
Status: valid/unmigrated Version: rel:R25-11#ddf624eb 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_TS_14232@rel:R25-11#ddf624eb
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