namespace LowLevelTasks { enum ETaskState { ReadyState = 0, CanceledFlag = 1 << 0, ScheduledFlag = 1 << 1, RunningFlag = 1 << 2, ExpeditingFlag = 1 << 3, ExpeditedFlag = 1 << 4, CompletedFlag = 1 << 5, Count = (1 << 6) - 1, Ready = ReadyState, CanceledAndReady = Ready | CanceledFlag, Scheduled = Ready | ScheduledFlag, Canceled = CanceledAndReady | ScheduledFlag, Running = Scheduled | RunningFlag, CanceledAndRunning = Canceled | RunningFlag, Expediting = Running | ExpeditingFlag, Expedited = Expediting | ExpeditedFlag, Completed = Running | CompletedFlag, ExpeditedAndCompleted = Expedited | CompletedFlag, CanceledAndCompleted = CanceledAndRunning | CompletedFlag, } }