omega_h
Reliable mesh adaptation
Public Types | Public Member Functions | List of all members
Omega_h::Future< T > Class Template Reference

Abstraction for asynchronous communication. More...

#include <Omega_h_future.hpp>

Public Types

using sendbuf_type = Read< T >
 
using recvbuf_type = Write< T >
 
using callback_type = std::function< Read< T >(recvbuf_type)>
 post-processing callback for asynchronous communication
 
using additional_callback_type = std::function< Read< T >(Read< T >)>
 optional additional processing callbacks (see add_callback method)
 
using requests_type = std::vector< int >
 

Public Member Functions

 Future (Read< T > sendbuf, Write< T > recvbuf, const requests_type &&requests={}, const callback_type callback=[](recvbuf_type buf) -> Read< T > { return buf;})
 
 Future (Write< T > recvbuf)
 no-op: no comm, no callback
 
 Future (Read< T > buf)
 no-op: no comm, no callback
 
void add_callback (const additional_callback_type &callback)
 register a additional post-communication callback
 
bool completed ()
 
Read< T > get ()
 

Detailed Description

template<typename T>
class Omega_h::Future< T >

Abstraction for asynchronous communication.

Hold both receive/send buffers and post-communication callbacks

Member Function Documentation

◆ completed()

template<typename T >
bool Omega_h::Future< T >::completed
Returns
true if asynchronous operation completed, false otherwise

◆ get()

template<typename T >
Read< T > Omega_h::Future< T >::get

wait for asynchronous operation completion, and return the result. This method can only be called once.


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