OpenSplice C# API  v6.x
OpenSplice C# Data Distribution Service Data-Centric Publish-Subscribe API
DDS.Duration Struct Reference

Duration represents a time interval. More...

Collaboration diagram for DDS.Duration:
Collaboration graph

Public Member Functions

 Duration (int seconds, uint nanoSeconds)
 Create a Duration elapsing a specific amount of time. More...
 
override bool Equals (object obj)
 Test this Duration is equal to the provided Duration. More...
 
override int GetHashCode ()
 Calculates hash of the Duration. More...
 
override string ToString ()
 Converts Duration to a string. More...
 

Static Public Member Functions

static Duration FromMilliseconds (double value)
 Create a Duration based on milliseconds. More...
 
static Duration FromTimeSpan (TimeSpan value)
 Create a Duration based on TimeSpan. More...
 
static bool operator!= (Duration duration1, Duration duration2)
 Test if two Durations are not equal. More...
 
static bool operator== (Duration duration1, Duration duration2)
 Test if two Durations are equal. More...
 

Static Public Attributes

static readonly Duration Infinite = new Duration(InfiniteSec, InfiniteNanoSec)
 Create an infinite Duration. More...
 
static readonly Duration Zero = new Duration(ZeroSec, ZeroNanoSec)
 Create a Duration elapsing zero seconds. More...
 

Properties

uint NanoSec [get, set]
 Gets the nanoseconds part of the Duration. More...
 
int Sec [get, set]
 Gets the seconds part of the Duration. More...
 

Detailed Description

Duration represents a time interval.

Duration can be converted to and from Durations expressed in milliseconds (or other units) as integer types.

Definition at line 65 of file DdsDcpsStructs.cs.

Constructor & Destructor Documentation

◆ Duration()

DDS.Duration.Duration ( int  seconds,
uint  nanoSeconds 
)
inline

Create a Duration elapsing a specific amount of time.

Parameters
secondsAmount of seconds for the Duration.
nanoSecondsAmount of nanoseconds for the Duration.

Definition at line 138 of file DdsDcpsStructs.cs.

Member Function Documentation

◆ Equals()

override bool DDS.Duration.Equals ( object  obj)
inline

Test this Duration is equal to the provided Duration.

Parameters
objDuration to compare.
Returns
true if the Duration is equal.</returns

Definition at line 151 of file DdsDcpsStructs.cs.

◆ FromMilliseconds()

static Duration DDS.Duration.FromMilliseconds ( double  value)
inlinestatic

Create a Duration based on milliseconds.

Parameters
valueMilliseconds value to convert to Duration

Definition at line 125 of file DdsDcpsStructs.cs.

◆ FromTimeSpan()

static Duration DDS.Duration.FromTimeSpan ( TimeSpan  value)
inlinestatic

Create a Duration based on TimeSpan.

Parameters
valueTimeSpan value to convert to Duration

Definition at line 114 of file DdsDcpsStructs.cs.

◆ GetHashCode()

override int DDS.Duration.GetHashCode ( )
inline

Calculates hash of the Duration.

Returns
Hash code.</returns

Definition at line 165 of file DdsDcpsStructs.cs.

◆ operator!=()

static bool DDS.Duration.operator!= ( Duration  duration1,
Duration  duration2 
)
inlinestatic

Test if two Durations are not equal.

Parameters
duration1Duration to compare.
duration2Duration to compare.
Returns
true if the Durations are not equal.</returns

Definition at line 191 of file DdsDcpsStructs.cs.

◆ operator==()

static bool DDS.Duration.operator== ( Duration  duration1,
Duration  duration2 
)
inlinestatic

Test if two Durations are equal.

Parameters
duration1Duration to compare.
duration2Duration to compare.
Returns
true if the Durations are equal.</returns

Definition at line 178 of file DdsDcpsStructs.cs.

◆ ToString()

override string DDS.Duration.ToString ( )
inline

Converts Duration to a string.

Returns
String containing the duration.</returns

Definition at line 202 of file DdsDcpsStructs.cs.

Member Data Documentation

◆ Infinite

readonly Duration DDS.Duration.Infinite = new Duration(InfiniteSec, InfiniteNanoSec)
static

Create an infinite Duration.

Definition at line 101 of file DdsDcpsStructs.cs.

◆ Zero

readonly Duration DDS.Duration.Zero = new Duration(ZeroSec, ZeroNanoSec)
static

Create a Duration elapsing zero seconds.

Definition at line 106 of file DdsDcpsStructs.cs.

Property Documentation

◆ NanoSec

uint DDS.Duration.NanoSec
getset

Gets the nanoseconds part of the Duration.

Definition at line 85 of file DdsDcpsStructs.cs.

◆ Sec

int DDS.Duration.Sec
getset

Gets the seconds part of the Duration.

Definition at line 74 of file DdsDcpsStructs.cs.


The documentation for this struct was generated from the following file: