Public Member Functions | List of all members
UPstream::communicator Class Reference

Wrapper class for allocating/freeing communicators. More...

Public Member Functions

 communicator (const communicator &)=delete
 No copy construct. More...
 
void operator= (const communicator &)=delete
 No copy assignment. More...
 
 communicator () noexcept
 Default construct (a placeholder communicator) More...
 
 communicator (communicator &&c)
 Move construct, takes ownership. More...
 
 communicator (const label parent, const labelUList &subRanks, const bool doPstream=true)
 Allocate a communicator based on given parent. More...
 
 ~communicator ()
 Free allocated communicator and group. More...
 
bool good () const noexcept
 True if communicator is non-negative (ie, was allocated) More...
 
label comm () const noexcept
 The communicator label. More...
 
void reset ()
 Free allocated communicator and group. More...
 
void reset (label parent, const labelUList &subRanks)
 Allocate with subRanks of parent communicator. More...
 
void reset (communicator &&c)
 Take ownership, free allocated communicator and group. More...
 
void operator= (communicator &&c)
 Move assignment, takes ownership. More...
 
 operator label () const noexcept
 Cast to label - the same as comm() More...
 

Detailed Description

Wrapper class for allocating/freeing communicators.

Definition at line 440 of file UPstream.H.

Constructor & Destructor Documentation

◆ communicator() [1/4]

communicator ( const communicator )
delete

No copy construct.

◆ communicator() [2/4]

communicator ( )
inlinenoexcept

Default construct (a placeholder communicator)

Definition at line 459 of file UPstream.H.

◆ communicator() [3/4]

communicator ( communicator &&  c)
inline

Move construct, takes ownership.

Definition at line 464 of file UPstream.H.

References Foam::constant::universal::c.

◆ communicator() [4/4]

communicator ( const label  parent,
const labelUList subRanks,
const bool  doPstream = true 
)
inline

Allocate a communicator based on given parent.

Parameters
parentThe parent communicator
subRanksThe sub-ranks of parent to use (ignore negative values)
doPstreamCall allocatePstreamCommunicator

Definition at line 470 of file UPstream.H.

◆ ~communicator()

~communicator ( )
inline

Free allocated communicator and group.

Definition at line 487 of file UPstream.H.

References UPstream::freeCommunicator().

Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

void operator= ( const communicator )
delete

No copy assignment.

◆ good()

bool good ( ) const
inlinenoexcept

True if communicator is non-negative (ie, was allocated)

Definition at line 492 of file UPstream.H.

◆ comm()

label comm ( ) const
inlinenoexcept

The communicator label.

Definition at line 497 of file UPstream.H.

◆ reset() [1/3]

void reset ( )
inline

Free allocated communicator and group.

Definition at line 502 of file UPstream.H.

References UPstream::freeCommunicator().

Referenced by UPstream::communicator::operator=().

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

◆ reset() [2/3]

void reset ( label  parent,
const labelUList subRanks 
)
inline

Allocate with subRanks of parent communicator.

Definition at line 507 of file UPstream.H.

References UPstream::allocateCommunicator(), UPstream::freeCommunicator(), and UPstream::parent().

Here is the call graph for this function:

◆ reset() [3/3]

void reset ( communicator &&  c)
inline

Take ownership, free allocated communicator and group.

Definition at line 516 of file UPstream.H.

References Foam::constant::universal::c, and UPstream::freeCommunicator().

Here is the call graph for this function:

◆ operator=() [2/2]

void operator= ( communicator &&  c)
inline

Move assignment, takes ownership.

Definition at line 526 of file UPstream.H.

References Foam::constant::universal::c, and UPstream::communicator::reset().

Here is the call graph for this function:

◆ operator label()

operator label ( ) const
inlinenoexcept

Cast to label - the same as comm()

Definition at line 531 of file UPstream.H.


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