xtd 1.0.0
Loading...
Searching...
No Matches
isynchronize_invoke.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "any_object.hpp"
6#include "array.hpp"
7#include "delegate.hpp"
8#include "async_result.hpp"
9#include "interface.hpp"
10#include "object_ref.hpp"
11#include "optional.hpp"
12#include <memory>
13#include <vector>
14
16namespace xtd {
28 public:
30
35 virtual auto invoke_required() const noexcept -> bool = 0;
37
39
46 virtual auto begin_invoke(delegate<void()> method) -> xtd::async_result = 0;
53 virtual auto begin_invoke(delegate<void(xtd::array<xtd::any_object>)> value, const xtd::array<xtd::any_object>& args) -> xtd::async_result = 0;
54
59 virtual auto end_invoke(xtd::async_result async) -> std::optional<object_ref> = 0;
60
66 virtual auto invoke(delegate<void()> value) -> std::optional<object_ref> = 0;
73 virtual auto invoke(delegate<void(xtd::array<xtd::any_object>)> method, const xtd::array<xtd::any_object>& args) -> std::optional<object_ref> = 0;
80 virtual auto invoke(delegate<void(xtd::array<xtd::any_object>)> method, const xtd::any_object& arg) -> std::optional<object_ref> = 0;
82
84 template<typename delegate_t>
85 auto begin_invoke(delegate_t value, const xtd::array<xtd::any_object>& args) -> xtd::async_result {return begin_invoke(delegate<void(xtd::array<xtd::any_object>)>(value), args);}
86
87 template<typename delegate_t>
88 auto begin_invoke(delegate_t value) -> xtd::async_result {return begin_invoke(delegate<void(xtd::array<xtd::any_object>)>(value), {});}
89
90 template<typename delegate_t>
91 auto invoke(delegate_t value, const xtd::array<xtd::any_object>& args) -> std::optional<object_ref> {return invoke(delegate<void(xtd::array<xtd::any_object>)>(value), args);}
92
93 template<typename delegate_t, typename args_t>
94 auto invoke(delegate_t value, args_t args) -> std::optional<object_ref> {return invoke(delegate<void(xtd::array<xtd::any_object>)>(value), xtd::any_object(args));}
95
96 template<typename delegate_t>
97 auto invoke(delegate_t value) -> std::optional<object_ref> {return invoke(delegate<void(xtd::array<xtd::any_object>)>(value), xtd::array<xtd::any_object> {});}
99 };
100}
Contains xtd::any_object class.
Contains xtd::array class.
Contains xtd::async_result alias.
Represent a polymorphic wrapper capable of holding any type.
Definition any_object.hpp:29
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Provides a way to synchronously or asynchronously execute a delegate.
Definition isynchronize_invoke.hpp:27
virtual auto invoke_required() const noexcept -> bool=0
Gets a value indicating whether the caller must call Invoke(Delegate, Object[]) when calling an objec...
virtual auto begin_invoke(delegate< void()> method) -> xtd::async_result=0
Asynchronously executes the delegate on the thread that created this object.
virtual auto end_invoke(xtd::async_result async) -> std::optional< object_ref >=0
Waits until the process started by calling xtd::isynchronize_invoke::begin_invoke completes,...
virtual auto invoke(delegate< void()> value) -> std::optional< object_ref >=0
Synchronously executes the delegate on the thread that created this object and marshals the call to t...
Contains xtd::delegate <result_t(arguments_t...)> delegate.
#define interface_
This keyword is use to represent an interface.
Definition interface.hpp:58
std::optional< type_t > optional
Represents the optional alias on std::optional.
Definition optional.hpp:26
xtd::sptr< xtd::iasync_result > async_result
Represents the status of an asynchronous operation.
Definition async_result.hpp:19
xtd::ref< xtd::object > object_ref
Represents an object reference.
Definition object_ref.hpp:20
Contains xtd::interface interface.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::object_ref alias.
Contains xtd::optional type.