Loading...
Searching...
No Matches
objectHit Class Reference

This class describes a combination of target object index and success flag. Behaves somewhat like std::optional. More...

#include <objectHit.H>

Public Member Functions

constexpr objectHit () noexcept
 Default construct. Nothing hit and object index = -1.
 objectHit (const bool success, const label index) noexcept
 Construct from components.
 objectHit (Istream &is)
 Construct from Istream.
bool hit () const noexcept
 Is there a hit?
label index () const noexcept
 Return the hit object index.
label hitObject () const noexcept
 Identical to index().
void reset () noexcept
 Reset to default construct state (false, -1).
void setHit () noexcept
 Set the hit status on.
void setMiss () noexcept
 Set the hit status off.
void setIndex (const label index) noexcept
 Set the hit object index.

Friends

Ostreamoperator<< (Ostream &os, const objectHit &obj)

Detailed Description

This class describes a combination of target object index and success flag. Behaves somewhat like std::optional.

Definition at line 48 of file objectHit.H.

Constructor & Destructor Documentation

◆ objectHit() [1/3]

objectHit ( )
inlineconstexprnoexcept

Default construct. Nothing hit and object index = -1.

Definition at line 70 of file objectHit.H.

References Foam::noexcept.

Referenced by operator<<.

Here is the caller graph for this function:

◆ objectHit() [2/3]

objectHit ( const bool success,
const label index )
inlinenoexcept

Construct from components.

Definition at line 79 of file objectHit.H.

References index(), Foam::noexcept, and success.

Here is the call graph for this function:

◆ objectHit() [3/3]

objectHit ( Istream & is)
inlineexplicit

Construct from Istream.

Definition at line 88 of file objectHit.H.

References Foam::readBool(), and Foam::readLabel().

Here is the call graph for this function:

Member Function Documentation

◆ hit()

bool hit ( ) const
inlinenoexcept

Is there a hit?

Definition at line 102 of file objectHit.H.

References Foam::noexcept.

Referenced by operator<<, and Foam::operator==().

Here is the caller graph for this function:

◆ index()

label index ( ) const
inlinenoexcept

Return the hit object index.

Definition at line 110 of file objectHit.H.

References Foam::noexcept.

Referenced by objectHit(), operator<<, Foam::operator==(), and setIndex().

Here is the caller graph for this function:

◆ hitObject()

label hitObject ( ) const
inlinenoexcept

Identical to index().

Definition at line 118 of file objectHit.H.

References Foam::noexcept.

◆ reset()

void reset ( )
inlinenoexcept

Reset to default construct state (false, -1).

Definition at line 129 of file objectHit.H.

References Foam::noexcept.

◆ setHit()

void setHit ( )
inlinenoexcept

Set the hit status on.

Definition at line 138 of file objectHit.H.

References Foam::noexcept.

◆ setMiss()

void setMiss ( )
inlinenoexcept

Set the hit status off.

Definition at line 146 of file objectHit.H.

References Foam::noexcept.

◆ setIndex()

void setIndex ( const label index)
inlinenoexcept

Set the hit object index.

Definition at line 154 of file objectHit.H.

References index().

Here is the call graph for this function:

◆ operator<<

Ostream & operator<< ( Ostream & os,
const objectHit & obj )
friend

Definition at line 162 of file objectHit.H.

References hit(), index(), objectHit(), os(), and token::SPACE.


The documentation for this class was generated from the following file:
  • src/OpenFOAM/meshes/primitiveShapes/objectHit/objectHit.H