Loading...
Searching...
No Matches
instant Class Reference

An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name. More...

#include <instant.H>

Inheritance diagram for instant:
Collaboration diagram for instant:

Public Member Functions

 instant ()=default
 Default construct, with value = 0 and empty name.
 instant (const instant &)=default
 Copy construct.
 instant (instant &&)=default
 Move construct.
instantoperator= (const instant &)=default
 Copy assignment.
instantoperator= (instant &&)=default
 Move assignment.
 instant (scalar timeValue)
 Construct from timeValue, auto generating the name.
 instant (const word &timeName)
 Copy construct from timeName, parsing timeName for a value.
 instant (word &&timeName)
 Move construct from timeName, parsing timeName for a value.
Public Member Functions inherited from Instant< word >
 Instant (const Instant &)=default
 Copy construct.
Instantoperator= (const Instant &)=default
 Copy assignment.
scalar value () const noexcept
 The value (const access).
const wordname () const noexcept
 The name/key (const access).
bool equal (scalar val) const noexcept
 Is instant value equal to val within (SMALL) rounding?
bool operator<= (scalar val) const noexcept
 Is instant less-equal than val within (SMALL) rounding?
bool operator>= (scalar val) const noexcept
 Is instant greater-equal than val within (SMALL) rounding?

Static Public Member Functions

static label findStart (const UList< instant > &times, const scalar timeVal)
 Find and return index of given start time (linear search).
static Pair< label > findRange (const UList< instant > &times, const scalar timeVal, const label start=-1)
 Find lower/upper indices for given time value in list of instances (linear search) continuing after the given start index.
Static Public Member Functions inherited from Instant< word >
static constexpr bool equal_to (scalar a, scalar b) noexcept
 Are values equal within (SMALL) rounding tolerance?
static constexpr bool less_equal (scalar a, scalar b) noexcept
 Are values less-equal within (SMALL) rounding tolerance?
static constexpr bool greater_equal (scalar a, scalar b) noexcept
 Are values greater_equal within (SMALL) rounding tolerance?

Static Public Attributes

static const char *const typeName = "instant"
 The type name (eg, for pTraits).

Detailed Description

An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.

Source files

Definition at line 53 of file instant.H.

Constructor & Destructor Documentation

◆ instant() [1/6]

instant ( )
default

Default construct, with value = 0 and empty name.

Referenced by instant(), instant(), operator=(), and operator=().

Here is the caller graph for this function:

◆ instant() [2/6]

instant ( const instant & )
default

Copy construct.

References instant().

Here is the call graph for this function:

◆ instant() [3/6]

instant ( instant && )
default

Move construct.

References instant().

Here is the call graph for this function:

◆ instant() [4/6]

instant ( scalar timeValue)
explicit

Construct from timeValue, auto generating the name.

Definition at line 92 of file instant.C.

References Instant< word >::Instant(), and timeName.

Here is the call graph for this function:

◆ instant() [5/6]

instant ( const word & timeName)
explicit

Copy construct from timeName, parsing timeName for a value.

Definition at line 98 of file instant.C.

References Instant< word >::Instant(), Instant< word >::name(), timeName, and Instant< word >::value().

Here is the call graph for this function:

◆ instant() [6/6]

instant ( word && timeName)
explicit

Move construct from timeName, parsing timeName for a value.

Definition at line 106 of file instant.C.

References Instant< word >::Instant(), Instant< word >::name(), timeName, and Instant< word >::value().

Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

instant & operator= ( const instant & )
default

Copy assignment.

References instant().

Here is the call graph for this function:

◆ operator=() [2/2]

instant & operator= ( instant && )
default

Move assignment.

References Instant< word >::Instant(), instant(), and timeName.

Here is the call graph for this function:

◆ findStart()

Foam::label findStart ( const UList< instant > & times,
const scalar timeVal )
static

Find and return index of given start time (linear search).

Definition at line 36 of file instant.C.

References UList< T >::size(), and Instant< word >::value().

Referenced by noiseModel::findStartTimeIndex(), and surfaceNoise::initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findRange()

Foam::Pair< Foam::label > findRange ( const UList< instant > & times,
const scalar timeVal,
const label start = -1 )
static

Find lower/upper indices for given time value in list of instances (linear search) continuing after the given start index.

Returns
the range indices or (-1,-1) if unsuccessful.

Definition at line 53 of file instant.C.

References range, UList< T >::size(), and Instant< word >::value().

Here is the call graph for this function:

Member Data Documentation

◆ typeName

const char *const typeName = "instant"
static

The type name (eg, for pTraits).

Definition at line 64 of file instant.H.


The documentation for this class was generated from the following files: