Iros
 
Loading...
Searching...
No Matches
in_place_stop_callback_base.h
Go to the documentation of this file.
1#pragma once
2
4#include "di/sync/atomic.h"
6
7namespace di::sync::detail {
9private:
10 friend class ::di::sync::InPlaceStopSource;
11
12 using ErasedCallback = void (*)(void*);
13
14protected:
15 explicit InPlaceStopCallbackBase(InPlaceStopSource const* parent, ErasedCallback execute)
16 : m_parent(parent), m_execute(execute) {}
17
18 InPlaceStopSource const* m_parent { nullptr };
19 ErasedCallback m_execute { nullptr };
22
23private:
24 void execute() { m_execute(this); }
25};
26}
Definition list_node.h:9
Definition atomic.h:15
ErasedCallback m_execute
Definition in_place_stop_callback_base.h:19
InPlaceStopSource const * m_parent
Definition in_place_stop_callback_base.h:18
InPlaceStopCallbackBase(InPlaceStopSource const *parent, ErasedCallback execute)
Definition in_place_stop_callback_base.h:15
friend class ::di::sync::InPlaceStopSource
Definition in_place_stop_callback_base.h:10
Atomic< bool * > m_did_destruct_in_same_thread
Definition in_place_stop_callback_base.h:21
Atomic< bool > m_already_executed
Definition in_place_stop_callback_base.h:20
Definition forward_declaration.h:4