Flutter Engine
flutter::Pipeline< R >::ProducerContinuation Class Reference

#include <pipeline.h>

Public Member Functions

 ProducerContinuation ()
 
 ProducerContinuation (ProducerContinuation &&other)
 
ProducerContinuationoperator= (ProducerContinuation &&other)
 
 ~ProducerContinuation ()
 
bool Complete (ResourcePtr resource)
 
 operator bool () const
 

Friends

class Pipeline
 

Detailed Description

template<class R>
class flutter::Pipeline< R >::ProducerContinuation

Denotes a spot in the pipeline reserved for the producer to finish preparing a completed pipeline resource.

Definition at line 37 of file pipeline.h.

Constructor & Destructor Documentation

◆ ProducerContinuation() [1/2]

template<class R>
flutter::Pipeline< R >::ProducerContinuation::ProducerContinuation ( )
inline

Definition at line 39 of file pipeline.h.

39 : trace_id_(0) {}

◆ ProducerContinuation() [2/2]

template<class R>
flutter::Pipeline< R >::ProducerContinuation::ProducerContinuation ( ProducerContinuation &&  other)
inline

Definition at line 41 of file pipeline.h.

42  : continuation_(other.continuation_), trace_id_(other.trace_id_) {
43  other.continuation_ = nullptr;
44  other.trace_id_ = 0;
45  }

◆ ~ProducerContinuation()

template<class R>
flutter::Pipeline< R >::ProducerContinuation::~ProducerContinuation ( )
inline

Definition at line 53 of file pipeline.h.

References TRACE_EVENT_ASYNC_END0, and TRACE_FLOW_END.

53  {
54  if (continuation_) {
55  continuation_(nullptr, trace_id_);
56  TRACE_EVENT_ASYNC_END0("flutter", "PipelineProduce", trace_id_);
57  // The continuation is being dropped on the floor. End the flow.
58  TRACE_FLOW_END("flutter", "PipelineItem", trace_id_);
59  TRACE_EVENT_ASYNC_END0("flutter", "PipelineItem", trace_id_);
60  }
61  }
#define TRACE_FLOW_END(category, name, id)
Definition: trace_event.h:121
#define TRACE_EVENT_ASYNC_END0(category_group, name, id)
Definition: trace_event.h:92

Member Function Documentation

◆ Complete()

template<class R>
bool flutter::Pipeline< R >::ProducerContinuation::Complete ( ResourcePtr  resource)
inline

Definition at line 63 of file pipeline.h.

References TRACE_EVENT_ASYNC_END0, and TRACE_FLOW_STEP.

Referenced by flutter::Animator::Render(), and flutter::testing::TEST().

63  {
64  bool result = false;
65  if (continuation_) {
66  result = continuation_(std::move(resource), trace_id_);
67  continuation_ = nullptr;
68  TRACE_EVENT_ASYNC_END0("flutter", "PipelineProduce", trace_id_);
69  TRACE_FLOW_STEP("flutter", "PipelineItem", trace_id_);
70  }
71  return result;
72  }
#define TRACE_FLOW_STEP(category, name, id)
Definition: trace_event.h:118
#define TRACE_EVENT_ASYNC_END0(category_group, name, id)
Definition: trace_event.h:92

◆ operator bool()

template<class R>
flutter::Pipeline< R >::ProducerContinuation::operator bool ( ) const
inline

Definition at line 74 of file pipeline.h.

74 { return continuation_ != nullptr; }

◆ operator=()

template<class R>
ProducerContinuation& flutter::Pipeline< R >::ProducerContinuation::operator= ( ProducerContinuation &&  other)
inline

Definition at line 47 of file pipeline.h.

References fml::swap().

47  {
48  std::swap(continuation_, other.continuation_);
49  std::swap(trace_id_, other.trace_id_);
50  return *this;
51  }
void swap(scoped_nsprotocol< C > &p1, scoped_nsprotocol< C > &p2)

Friends And Related Function Documentation

◆ Pipeline

template<class R>
friend class Pipeline
friend

Definition at line 77 of file pipeline.h.


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