template <size_t inline_target_size>

class PostTaskState

Defined at line 116 of file ../../src/graphics/display/lib/driver-utils/post-task.h

All the context needed to run a callback as a task on an async dispatcher.

After a PostTaskState is allocated, no further memory allocation is needed to

post the task and run the callback.

`inline_target_size` is the capacity for storing the callback's captures. A

compilation error will occur when attempting to call `Post()` using a

callback whose captured state size exceeds this capacity.

This class is exposed to facilitate separating the memory allocation from the

callback capture computation. This supports the common pattern of dividing a

complex piece of work into a fallible resource acquisition stage, a "commit

point", and an infallible computation stage.

`PostTaskState::Post()` assumes that PostTaskState instances are owned using

std::unique_ptr.

Public Methods

void PostTaskState<inline_target_size> (const PostTaskState<inline_target_size> & )

PostTaskState instances are not movable or copyable. The underlying state's

address is passed to a C library, so the instance must be pinned in memory.

Defined at line 123 of file ../../src/graphics/display/lib/driver-utils/post-task.h

void PostTaskState<inline_target_size> (PostTaskState<inline_target_size> && )

Defined at line 124 of file ../../src/graphics/display/lib/driver-utils/post-task.h

PostTaskState<inline_target_size> & operator= (const PostTaskState<inline_target_size> & )

Defined at line 125 of file ../../src/graphics/display/lib/driver-utils/post-task.h

PostTaskState<inline_target_size> & operator= (PostTaskState<inline_target_size> && )

Defined at line 126 of file ../../src/graphics/display/lib/driver-utils/post-task.h

void ~PostTaskState<inline_target_size> ()

Defined at line 128 of file ../../src/graphics/display/lib/driver-utils/post-task.h

void PostTaskState<inline_target_size> ()

Creates an instance that can be used to execute one callback.

Defined at line 225 of file ../../src/graphics/display/lib/driver-utils/post-task.h

zx::result<> Post (std::unique_ptr<PostTaskState<inline_target_size>> post_task_state, async_dispatcher_t & dispatcher, fit::inline_callback<void (), inline_target_size> callback)

`PostTask()` implementation. The arguments have identical semantics.

Defined at line 233 of file ../../src/graphics/display/lib/driver-utils/post-task.h