objectHit Class Reference

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

Public Member Functions

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

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 50 of file objectHit.H.

Constructor & Destructor Documentation

◆ objectHit() [1/3]

constexpr objectHit ( )
inlineconstexprnoexcept

Default construct. Nothing hit and object = -1.

Definition at line 66 of file objectHit.H.

◆ objectHit() [2/3]

objectHit ( const bool  success,
const label  index 
)
inlinenoexcept

Construct from components.

Definition at line 73 of file objectHit.H.

◆ objectHit() [3/3]

objectHit ( Istream is)
inlineexplicit

Construct from Istream.

Definition at line 80 of file objectHit.H.

Member Function Documentation

◆ hit()

bool hit ( ) const
inlinenoexcept

Is there a hit?

Definition at line 92 of file objectHit.H.

Referenced by Foam::operator==().

Here is the caller graph for this function:

◆ index()

label index ( ) const
inlinenoexcept

Return the hit object index.

Definition at line 98 of file objectHit.H.

◆ hitObject()

label hitObject ( ) const
inlinenoexcept

Identical to index()

Definition at line 104 of file objectHit.H.

Referenced by Foam::operator==().

Here is the caller graph for this function:

◆ reset()

void reset ( )
inlinenoexcept

Reset to default construct state.

Definition at line 113 of file objectHit.H.

◆ setHit()

void setHit ( )
inlinenoexcept

Set the hit status on.

Definition at line 120 of file objectHit.H.

◆ setMiss()

void setMiss ( )
inlinenoexcept

Set the hit status off.

Definition at line 126 of file objectHit.H.

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 134 of file objectHit.H.


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