Delegate()

Delegate< ReturnType(ArgumentTypes…)>::Delegate() method

Default constructor. Constructs the delegate object that does not point to anything.

System::Delegate<ReturnType(ArgumentTypes...)>::Delegate()=default

Delegate< ReturnType(ArgumentTypes…)>::Delegate(const Delegate&) method

System::Delegate<ReturnType(ArgumentTypes...)>::Delegate(const Delegate &)=default

Delegate< ReturnType(ArgumentTypes…)>::Delegate(Delegate&&) method

Moving copy constructor. Takes the ownership of an entity pointed to by the specified delegate.

System::Delegate<ReturnType(ArgumentTypes...)>::Delegate(Delegate &&o) noexcept

Arguments

ParameterTypeDescription
oDelegate&&The Delegate object to move the pointed to entity from

Delegate< ReturnType(ArgumentTypes…)>::Delegate(T, typename std::enable_if<!std::is_bind_expression<T>::value&&std::is_pointer<T>::value&&std::is_function<typename std::remove_pointer<T>::type>::value>::type *) method

Constructor. Constructs a delegate object from the specified pointer to free function or static method.

template<class T> System::Delegate<ReturnType(ArgumentTypes...)>::Delegate(T function, typename std::enable_if<!std::is_bind_expression<T>::value &&std::is_pointer<T>::value &&std::is_function<typename std::remove_pointer<T>::type>::value>::type *=0)

Template parameters

ParameterDescription
Thetype of the function or static method pointer accepted by the constructor as an argument

Arguments

ParameterTypeDescription
functionTPointer to a function or a static method that will be pointed to by the newly created Delegate instance

Delegate< ReturnType(ArgumentTypes…)>::Delegate(T, typename std::enable_if<std::is_bind_expression<T>::value>::type *) method

Constructor. Constructs a delegate from the specified pointer to the function object generated by std::bind().

template<class T> System::Delegate<ReturnType(ArgumentTypes...)>::Delegate(T function, typename std::enable_if<std::is_bind_expression<T>::value>::type *=0)

Template parameters

ParameterDescription
Thetype of the function object generated by std::bind() accepted by the constructor as an argument

Arguments

ParameterTypeDescription
functionTPointer to a "bind expression" - a function pointer generated by std::bind() - that will be pointed to by the newly created Delegate instance

Delegate< ReturnType(ArgumentTypes…)>::Delegate(int, T&) method

Constructor. Constructs a delegate from the specified function object.

template<class T> System::Delegate<ReturnType(ArgumentTypes...)>::Delegate(int functor_tag, T &functor)

Template parameters

ParameterDescription
TThe type of the function object accepted by the constructor as an argument

Arguments

ParameterTypeDescription
functor_tagintA dummy integer value; this argument is used to resolve ambiguity
functorT&A function object that the newly constructed delegate will point to

Delegate< ReturnType(ArgumentTypes…)>::Delegate(long, T&&) method

Moving constructor. Constructs a delegate from the specified function object.

template<class T> System::Delegate<ReturnType(ArgumentTypes...)>::Delegate(long functor_tag, T &&functor)

Template parameters

ParameterDescription
TThe type of the function object accepted by the constructor as an argument

Arguments

ParameterTypeDescription
functor_taglongA dummy integer value; this argument is used to resolve ambiguity
functorT&&A function object that the newly constructed delegate will point to

Delegate< ReturnType(ArgumentTypes…)>::Delegate(MemberType ClassType::*, ClassType *) method

Constructor. Constructs a delegate that points to the specified non-static method of the specified object.

template<class MemberType,class ClassType> System::Delegate<ReturnType(ArgumentTypes...)>::Delegate(MemberType ClassType::*member, ClassType *obj)

Template parameters

ParameterDescription
MemberTypeThe type of the non-static method that the constructor accepts as an argument
ClassTypeThe type of the object accepted by the constructor as an argument

Arguments

ParameterTypeDescription
memberMemberType ClassType::*A pointer to the non-static method that the newly created delegate will point to
objClassType *A pointer to an object member method of which will be pointed to by the newly created delegate

Delegate< ReturnType(ArgumentTypes…)>::Delegate(MemberType MemberClass::*, const SharedPtr<ClassType>&) method

Constructor. Constructs a delegate that points to the specified non-static method of the specified object.

template<class MemberType,class MemberClass,class ClassType> System::Delegate<ReturnType(ArgumentTypes...)>::Delegate(MemberType MemberClass::*member, const SharedPtr<ClassType> &obj)

Template parameters

ParameterDescription
MemberTypeThe type of the non-static method that the constructor accepts as an argument
ClassTypeThe type of the object accepted by the constructor as an argument

Arguments

ParameterTypeDescription
memberMemberType MemberClass::*A pointer to the non-static method that the newly created delegate will point to
objconst SharedPtr<ClassType>&A shard pointer to an object member method of which will be pointed to by the newly created delegate

Delegate< ReturnType(ArgumentTypes…)>::Delegate(std::function<R(Args…)>) method

Constructs a delegate object that points to an std::function function object.

template<class R,class...> System::Delegate<ReturnType(ArgumentTypes...)>::Delegate(std::function<R(Args...)> f)

Template parameters

ParameterDescription
RThe return type of the function object accepted by the constructor as an argument
ArgsThe argument list of the function object accepted by the constructor as an argument

Arguments

ParameterTypeDescription
fstd::function<R(Args…)>A function object to be pointed to by the newly created delegate object

See Also