Skip to main content

SampleInfo

Struct SampleInfo 

Source
pub struct SampleInfo {
    pub sample_state: SampleStateKind,
    pub view_state: ViewStateKind,
    pub instance_state: InstanceStateKind,
    pub disposed_generation_count: i32,
    pub no_writers_generation_count: i32,
    pub sample_rank: i32,
    pub generation_rank: i32,
    pub absolute_generation_rank: i32,
    pub source_timestamp: Time,
    pub instance_handle: InstanceHandle,
    pub publication_handle: InstanceHandle,
    pub valid_data: bool,
}
Expand description

SampleInfo (DDS 1.4 §2.2.2.5.1) — Metadaten pro Sample.

Wird vom DataReader im take/read-Pfad gefuellt. Application- Code soll sich auf diese Felder verlassen, um:

  • neue Samples vs. wiederholt gelesene zu unterscheiden (sample_state),
  • neue Instanzen zu erkennen (view_state == NEW),
  • Lifecycle-Events zu sehen (instance_state, valid_data == false),
  • Reordering / Generations-Wechsel zu folgen (*_generation_count, *_rank).

Fields§

§sample_state: SampleStateKind

Sample-State (READ / NOT_READ).

§view_state: ViewStateKind

View-State (NEW / NOT_NEW).

§instance_state: InstanceStateKind

Instance-State (ALIVE / NOT_ALIVE_*).

§disposed_generation_count: i32

Wieviele Mal die Instanz NOT_ALIVE_DISPOSED → ALIVE durchlaufen hat seit ihrem ersten Sample.

§no_writers_generation_count: i32

Wieviele Mal die Instanz NOT_ALIVE_NO_WRITERS → ALIVE durchlaufen hat seit ihrem ersten Sample.

§sample_rank: i32

Anzahl Samples in derselben Instanz, die nach diesem im Cache stehen (§2.2.2.5.1.5).

§generation_rank: i32

Differenz generation_count zwischen diesem und dem letzten Sample der Instanz im selben Read-Set.

§absolute_generation_rank: i32

Differenz generation_count zwischen diesem und dem aktuellen Generation-Count.

§source_timestamp: Time

Wall-Clock-Zeitpunkt des write/dispose/unregister.

§instance_handle: InstanceHandle

Lokaler Handle der Instanz.

§publication_handle: InstanceHandle

Lokaler Handle des sendenden DataWriters (im offline / unbekannten Fall HANDLE_NIL).

§valid_data: bool

true wenn das Sample Nutzdaten enthaelt; false bei reinem Dispose-/Unregister-Marker (§2.2.2.5.1.13).

Implementations§

Source§

impl SampleInfo

Source

pub fn new_alive( instance: InstanceHandle, publication: InstanceHandle, timestamp: Time, ) -> Self

Konstruiert einen Default-Info-Block fuer ein frisches Sample einer neuen Instanz mit valid_data = true.

Source

pub fn matches_states( &self, sample_mask: u32, view_mask: u32, instance_mask: u32, ) -> bool

Prueft, ob dieses SampleInfo durch die uebergebenen State-Masks akzeptiert wird (Spec §2.2.2.5.3.1, read_w_condition).

Trait Implementations§

Source§

impl Clone for SampleInfo

Source§

fn clone(&self) -> SampleInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SampleInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SampleInfo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for SampleInfo

Source§

fn eq(&self, other: &SampleInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SampleInfo

Source§

impl Eq for SampleInfo

Source§

impl StructuralPartialEq for SampleInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.