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

Time represents a time value. More...

Collaboration diagram for DDS.Time:
Collaboration graph

Public Member Functions

 Time (int _sec, uint _nanosec)
 Create a Time based on seconds and nanoseconds. More...
 
override bool Equals (object obj)
 Test this Time is equal to the provided Time. More...
 
override int GetHashCode ()
 Calculates hash of the Time. More...
 
DateTime ToDatetime ()
 Create a DateTime struct based on the Time value. More...
 
override string ToString ()
 Converts Time to a string. More...
 

Static Public Member Functions

static Time FromDateTime (DateTime value)
 Create a Time struct based on a DateTime value. More...
 
static bool operator!= (Time left, Time right)
 Test if two Times are not equal. More...
 
static bool operator< (Time left, Time right)
 Test one Time is after another Time. More...
 
static bool operator<= (Time left, Time right)
 Test one Time is equal of before another Time. More...
 
static bool operator== (Time left, Time right)
 Test if two Times are equal. More...
 
static bool operator> (Time left, Time right)
 Test one Time is before another Time. More...
 
static bool operator>= (Time left, Time right)
 Test one Time is equal of after another Time. More...
 

Static Public Attributes

static readonly Time Current = new Time(InvalidSec, InvalidNanoSec-1)
 
static readonly Time Invalid = new Time(InvalidSec, InvalidNanoSec)
 Create an infinite Time. More...
 
static readonly Time Zero = new Time(ZeroSec, ZeroNanoSec)
 

Properties

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

Detailed Description

Time represents a time value.

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

Definition at line 256 of file DdsDcpsStructs.cs.

Constructor & Destructor Documentation

◆ Time()

DDS.Time.Time ( int  _sec,
uint  _nanosec 
)
inline

Create a Time based on seconds and nanoseconds.

Parameters
_secAmount of seconds for the Time.
_nanosecAmount of nanoseconds for the Time.

Definition at line 359 of file DdsDcpsStructs.cs.

Member Function Documentation

◆ Equals()

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

Test this Time is equal to the provided Time.

Parameters
objTime to compare.
Returns
true if the Time is equal.</returns

Definition at line 372 of file DdsDcpsStructs.cs.

◆ FromDateTime()

static Time DDS.Time.FromDateTime ( DateTime  value)
inlinestatic

Create a Time struct based on a DateTime value.

Parameters
valueDateTime value to convert to Duration

Definition at line 308 of file DdsDcpsStructs.cs.

◆ GetHashCode()

override int DDS.Time.GetHashCode ( )
inline

Calculates hash of the Time.

Returns
Hash code.</returns

Definition at line 386 of file DdsDcpsStructs.cs.

◆ operator!=()

static bool DDS.Time.operator!= ( Time  left,
Time  right 
)
inlinestatic

Test if two Times are not equal.

Parameters
leftTime to compare.
rightTime to compare.
Returns
true if the Times not are equal.</returns

Definition at line 412 of file DdsDcpsStructs.cs.

◆ operator<()

static bool DDS.Time.operator< ( Time  left,
Time  right 
)
inlinestatic

Test one Time is after another Time.

Parameters
leftTime to compare.
rightTime to compare.
Returns
true if left > right.</returns

Definition at line 438 of file DdsDcpsStructs.cs.

◆ operator<=()

static bool DDS.Time.operator<= ( Time  left,
Time  right 
)
inlinestatic

Test one Time is equal of before another Time.

Parameters
leftTime to compare.
rightTime to compare.
Returns
true if left <= right.</returns

Definition at line 464 of file DdsDcpsStructs.cs.

◆ operator==()

static bool DDS.Time.operator== ( Time  left,
Time  right 
)
inlinestatic

Test if two Times are equal.

Parameters
leftTime to compare.
rightTime to compare.
Returns
true if the Times are equal.</returns

Definition at line 399 of file DdsDcpsStructs.cs.

◆ operator>()

static bool DDS.Time.operator> ( Time  left,
Time  right 
)
inlinestatic

Test one Time is before another Time.

Parameters
leftTime to compare.
rightTime to compare.
Returns
true if left < right.</returns

Definition at line 425 of file DdsDcpsStructs.cs.

◆ operator>=()

static bool DDS.Time.operator>= ( Time  left,
Time  right 
)
inlinestatic

Test one Time is equal of after another Time.

Parameters
leftTime to compare.
rightTime to compare.
Returns
true if left >= right.</returns

Definition at line 451 of file DdsDcpsStructs.cs.

◆ ToDatetime()

DateTime DDS.Time.ToDatetime ( )
inline

Create a DateTime struct based on the Time value.

Definition at line 318 of file DdsDcpsStructs.cs.

◆ ToString()

override string DDS.Time.ToString ( )
inline

Converts Time to a string.

Returns
String containing the time.</returns

Definition at line 475 of file DdsDcpsStructs.cs.

Member Data Documentation

◆ Current

readonly Time DDS.Time.Current = new Time(InvalidSec, InvalidNanoSec-1)
static

Create a Time with the current time.

Definition at line 300 of file DdsDcpsStructs.cs.

◆ Invalid

readonly Time DDS.Time.Invalid = new Time(InvalidSec, InvalidNanoSec)
static

Create an infinite Time.

Definition at line 290 of file DdsDcpsStructs.cs.

◆ Zero

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

Create an zero Time.

Definition at line 295 of file DdsDcpsStructs.cs.

Property Documentation

◆ NanoSec

uint DDS.Time.NanoSec
getset

Gets the nanoseconds part of the Time.

Definition at line 275 of file DdsDcpsStructs.cs.

◆ Sec

int DDS.Time.Sec
getset

Gets the seconds part of the Time.

Definition at line 264 of file DdsDcpsStructs.cs.


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