asio-grpc v3.4.3
Asynchronous gRPC with Asio/unified executors
Loading...
Searching...
No Matches
agrpc::ReactorPtr< Reactor > Class Template Reference

Shared pointer-like object for reactors. More...

#include <agrpc/reactor_ptr.hpp>

Public Member Functions

 ReactorPtr ()=default
 Default constructor.
 
Reactor & operator* () const noexcept
 Get reference to underlying reactor.
 
Reactor * operator-> () const noexcept
 Access underlying reactor.
 
 operator bool () const noexcept
 Check whether this pointer owns a reactor.
 

Friends

bool operator== (const ReactorPtr &lhs, const ReactorPtr &rhs) noexcept
 Check whether two pointers refer to the same reactor.
 
bool operator!= (const ReactorPtr &lhs, const ReactorPtr &rhs) noexcept
 Check whether two pointers do not refer to the same reactor.
 
void swap (ReactorPtr &lhs, ReactorPtr &rhs) noexcept
 Swap the contents of two ReactorPtr.
 

Detailed Description

template<class Reactor>
class agrpc::ReactorPtr< Reactor >

Shared pointer-like object for reactors.

This smart pointer guarantees that the reactor remains alive until OnDone is called and all user-held objects of this pointer are destroyed.

Template Parameters
ReactorThe reactor type like agrpc::ServerUnaryReactor, agrpc::ClientUnaryReactor or a class derived from their base equivalents.
Since
3.5.0