Flutter Impeller
impeller::ImpellerContextFuture Class Reference

#include <context.h>

Public Member Functions

 ImpellerContextFuture (std::future< std::shared_ptr< impeller::Context >> context)
 
std::shared_ptr< impeller::ContextGetContext ()
 

Detailed Description

A wrapper for provided a deferred initialization of impeller to various engine subsystems.

Definition at line 29 of file context.h.

Constructor & Destructor Documentation

◆ ImpellerContextFuture()

impeller::ImpellerContextFuture::ImpellerContextFuture ( std::future< std::shared_ptr< impeller::Context >>  context)
explicit

Definition at line 12 of file context.cc.

14  : future_(std::move(context)) {}

Member Function Documentation

◆ GetContext()

std::shared_ptr< impeller::Context > impeller::ImpellerContextFuture::GetContext ( )

Definition at line 16 of file context.cc.

16  {
17  std::scoped_lock<std::mutex> lock(mutex_);
18  if (!did_wait_ && future_.valid()) {
19  context_ = future_.get();
20  did_wait_ = true;
21  }
22  return context_;
23 }

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