BehaviorTree
Core Library to create and execute Behavior Trees
Loading...
Searching...
No Matches
BT::details::CallbackGate Class Reference

Synchronization gate used to coordinate callbacks with object teardown. More...

#include <callback_gate.h>

Classes

class  Guard
 RAII helper that signals the completion of a callback entered with tryStart() More...
 

Public Types

using Ptr = std::shared_ptr< CallbackGate >
 

Public Member Functions

bool tryStart ()
 Returns false if the gate has been closed and the callback must not run.
 
void close ()
 Reject new callbacks, without waiting for the running ones.
 
void closeAndDrain ()
 Reject new callbacks and wait until callbacks already running have completed.
 

Detailed Description

Synchronization gate used to coordinate callbacks with object teardown.

Callbacks enter the gate with tryStart() and must signal completion when done (use Guard for RAII). During teardown, call close() to reject new callbacks and closeAndDrain() to block until the callbacks still running have completed.


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