Flutter Engine
fml::SyncSwitch::Handlers Struct Reference

Represents the 2 code paths available when calling |SyncSwitch::Execute|. More...

#include <sync_switch.h>

Public Member Functions

HandlersSetIfTrue (const std::function< void()> &handler)
 Sets the handler that will be executed if the |SyncSwitch| is true. More...
 
HandlersSetIfFalse (const std::function< void()> &handler)
 Sets the handler that will be executed if the |SyncSwitch| is false. More...
 

Public Attributes

std::function< void()> true_handler = [] {}
 
std::function< void()> false_handler = [] {}
 

Detailed Description

Represents the 2 code paths available when calling |SyncSwitch::Execute|.

Definition at line 24 of file sync_switch.h.

Member Function Documentation

◆ SetIfFalse()

SyncSwitch::Handlers & fml::SyncSwitch::Handlers::SetIfFalse ( const std::function< void()> &  handler)

Sets the handler that will be executed if the |SyncSwitch| is false.

Definition at line 15 of file sync_switch.cc.

References false_handler.

16  {
17  false_handler = std::move(handler);
18  return *this;
19 }
std::function< void()> false_handler
Definition: sync_switch.h:32

◆ SetIfTrue()

SyncSwitch::Handlers & fml::SyncSwitch::Handlers::SetIfTrue ( const std::function< void()> &  handler)

Sets the handler that will be executed if the |SyncSwitch| is true.

Definition at line 9 of file sync_switch.cc.

References true_handler.

10  {
11  true_handler = std::move(handler);
12  return *this;
13 }
std::function< void()> true_handler
Definition: sync_switch.h:31

Member Data Documentation

◆ false_handler

std::function<void()> fml::SyncSwitch::Handlers::false_handler = [] {}

Definition at line 32 of file sync_switch.h.

Referenced by fml::SyncSwitch::Execute(), and SetIfFalse().

◆ true_handler

std::function<void()> fml::SyncSwitch::Handlers::true_handler = [] {}

Definition at line 31 of file sync_switch.h.

Referenced by fml::SyncSwitch::Execute(), and SetIfTrue().


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