CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
synchronization_context.h
1
2#pragma once
3#include <system/object.h>
4#include <system/threading/send_or_post_callback.h>
5
6namespace System { namespace Threading {
7
13class ASPOSECPP_SHARED_CLASS SynchronizationContext : public Object
14{
16 RTTI_INFO(System::Threading::SynchronizationContext, ::System::BaseTypesInfo<System::Object>);
17
18public:
22 ASPOSECPP_SHARED_API SynchronizationContext();
23
27 static ASPOSECPP_SHARED_API const SharedPtr<SynchronizationContext>& get_Current();
28
32 static ASPOSECPP_SHARED_API void SetSynchronizationContext(const SharedPtr<SynchronizationContext>& syncContext);
33
37 virtual ASPOSECPP_SHARED_API void Post(SendOrPostCallback d, SharedPtr<Object> state);
38
43 virtual ASPOSECPP_SHARED_API void Send(SendOrPostCallback d, SharedPtr<Object> state);
44
45private:
48 static thread_local SharedPtr<SynchronizationContext> m_current;
49};
50
51}} // System::Threading
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Provides the basic functionality for propagating a synchronization context across various synchroniza...
Definition: synchronization_context.h:14
virtual void Send(SendOrPostCallback d, SharedPtr< Object > state)
Runs callback synchronously.
static const SharedPtr< SynchronizationContext > & get_Current()
Gets the synchronization context for the current thread.
virtual void Post(SendOrPostCallback d, SharedPtr< Object > state)
Runs callback asynchronously.
SynchronizationContext()
Constructs a new instance of SynchronizationContext.
static void SetSynchronizationContext(const SharedPtr< SynchronizationContext > &syncContext)
Sets the synchronization context for the current thread.
System::MulticastDelegate< void(System::SharedPtr< Object >)> SendOrPostCallback
Definition: send_or_post_callback.h:12
Definition: db_command.h:9