| 529 | }; |
| 530 | |
| 531 | struct Data |
| 532 | { |
| 533 | Data(); |
| 534 | ~Data() = default; |
| 535 | |
| 536 | void clearAllCallbacks(); |
| 537 | |
| 538 | std::atomic_flag lock = ATOMIC_FLAG_INIT; |
| 539 | State state; |
| 540 | bool discard; |
| 541 | bool associated; |
| 542 | bool abandoned; |
| 543 | |
| 544 | // One of: |
| 545 | // 1. None, the state is PENDING or DISCARDED. |
| 546 | // 2. Some, the state is READY. |
| 547 | // 3. Error, the state is FAILED; 'error()' stores the message. |
| 548 | Result<T> result; |
| 549 | |
| 550 | std::vector<AbandonedCallback> onAbandonedCallbacks; |
| 551 | std::vector<DiscardCallback> onDiscardCallbacks; |
| 552 | std::vector<ReadyCallback> onReadyCallbacks; |
| 553 | std::vector<FailedCallback> onFailedCallbacks; |
| 554 | std::vector<DiscardedCallback> onDiscardedCallbacks; |
| 555 | std::vector<AnyCallback> onAnyCallbacks; |
| 556 | }; |
| 557 | |
| 558 | // Abandons this future. Returns false if the future is already |
| 559 | // associated or no longer pending. Otherwise returns true and any |
nothing calls this directly
no outgoing calls
no test coverage detected