MulticastDelegate< ReturnType(ArgumentTypes...)>

MulticastDelegate< ReturnType(ArgumentTypes…)> class

Represents a collection of delegates. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

template<class ReturnType,class...>class MulticastDelegate< ReturnType(ArgumentTypes...)> : public System::Details::DelegateHoldingVariables

Template parameters

ParameterDescription
ReturnTypeReturn type of the invokable entities pointed to by each delegate in the collection
ArgumentTypesArgument list of the invokable entities pointed to by each delegate in the collection

Methods

MethodDescription
SharedPtr<IAsyncResult> BeginInvoke(ArgumentTypes…, const AsyncCallback&, const CallbackArgumentType&)NOT IMPLEMENTED.
MulticastDelegate& connect(Callback)Adds the specified delegate to the collection.
MulticastDelegate& connect(std::function<R(Args…)>)Adds the specified function object to the delegate collection. The function object is converted to the Callback delegate type before being added to the collection.
MulticastDelegate& connect(MulticastDelegate&)Adds the specified MulticastDelegate object to the delegate collection.
MulticastDelegate& connect(MemberType ClassType::*, ClassType *)Adds the specified non-static method of the specified object to the delegate collection.
MulticastDelegate& connect(MemberType ClassType::*, const SharedPtr<ClassType>&)Adds the specified non-static method of the specified object to the delegate collection.
MulticastDelegate& disconnect(Callback)Removes the specified delegate from the delegate collection.
MulticastDelegate& disconnect(MemberType ClassType::*, ClassType *)Removes the specified non-static method of the specified object from the delegate collection.
MulticastDelegate& disconnect(MemberType ClassType::*, const SharedPtr<ClassType>&)Removes the specified non-static method of the specified object from the delegate collection.
MulticastDelegate& disconnect(MulticastDelegate&)Removes the specified MulticastDelegate object from the delegate collection.
MulticastDelegate& disconnect_all_slots()Removes all delegates from the delegate collection.
bool empty() constDetermines whether the delegate collection is empty.
ReturnType EndInvoke(const SharedPtr<IAsyncResult>&)NOT IMPLEMENTED.
int GetHashCode() const
const TypeInfo& GetType() const
ReturnType invoke(ArgumentTypes…) constInvokes all delegates currently present in the delegates collection. Delegates are invoked in the same order as they were added to the collection. The method blocks while the delegates are executed.
bool IsNull() constDetermines whether the delegate collection is empty.
MulticastDelegate()Constructs an empty collection.
MulticastDelegate(std::nullptr_t)Equivalent to defalt constructor.
MulticastDelegate(const MulticastDelegate&)Performs a shallow copy of the delegate collection.
MulticastDelegate(MulticastDelegate&&)Moving constructor.
MulticastDelegate(Callback&&)Constructs an instance and puts the specified delegate to the delegates collection.
MulticastDelegate(T)Constructs an instance and puts the specified value to the delegates collection.
MulticastDelegate(std::function<ReturnType(ArgumentTypes…)>)Constructs an instance and puts the specified value to the delegates collection.
bool operator!=(const std::nullptr_t&) constDetermines whether the delegate collection is not empty.
bool operator!=(const MulticastDelegate&) constDetermines whether two instances of MulticastDelegate - the current object and the specified object - are inequal.
ReturnType operator()(ArgumentTypes…) constInvokes all delegates currently present in the delegates collection. Delegates are invoked in the same order as they were added to the collection. The operator blocks while the delegates are executed.
MulticastDelegate& operator+=(Callback)Adds the specified delegate to the collection.
MulticastDelegate& operator-=(Callback)Removes the specified delegate from the delegate collection.
MulticastDelegate& operator=(const MulticastDelegate&)Assigns the collection of delegates represented by the specified object to the current object. As a result both objects point to the same collection of delegates.
MulticastDelegate& operator=(MulticastDelegate&&)Moving assignment operator.
bool operator==(const std::nullptr_t&) constDetermines whether the delegate collection is empty.
bool operator==(const MulticastDelegate&) constDetermines whether two instances of MulticastDelegate - the current object and the specified object - are equal.
void remove_empty_callbacks() constCleans out contained callbacks that are empty (not actually calling anything).
String ToString() const
static const TypeInfo& Type()Returns a reference to the TypeInfo object representing the MulticastDelegate class type information.
~MulticastDelegate()Destructor.

Typedefs

TypedefDescription
CallbackThe type of the delegates represented by the MulticastDelegate class.

See Also