Flutter Engine
 
Loading...
Searching...
No Matches
task_queue_id.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_FML_TASK_QUEUE_ID_H_
6#define FLUTTER_FML_TASK_QUEUE_ID_H_
7
9
10namespace fml {
11
12/**
13 * `MessageLoopTaskQueues` task dispatcher's internal task queue identifier.
14 */
16 public:
17 /// This constant indicates whether a task queue has been subsumed by a task
18 /// runner.
19 static const size_t kUnmerged;
20
21 /// This constant indicates an invalid task queue. Used in embedder
22 /// supplied task runners not associated with a task queue.
23 static const size_t kInvalid;
24
25 /// Intializes a task queue with the given value as it's ID.
26 explicit TaskQueueId(size_t value) : value_(value) {}
27
29
30 operator size_t() const { // NOLINT(google-explicit-constructor)
31 return value_;
32 }
33
34 bool is_valid() const { return value_ != kInvalid; }
35
36 private:
37 size_t value_ = kUnmerged;
38};
39
40} // namespace fml
41
42#endif // FLUTTER_FML_TASK_QUEUE_ID_H_
static const size_t kUnmerged
static TaskQueueId Invalid()
static const size_t kInvalid
bool is_valid() const
TaskQueueId(size_t value)
Intializes a task queue with the given value as it's ID.
int32_t value