open-ead / sead

Decompilation of sead: the standard C++ library for first-party Nintendo games
190 stars 26 forks source link

prim/Delegate #37

Closed leoetlino closed 4 years ago

leoetlino commented 4 years ago

DelegateBase and derived classes


IDelegates

R variants (e.g. IDelegate2R) take an extra template argument (at the end) for the return type.

DelegateBase

Delegates

Delegate1R?

AnyDelegates

AnyDelegate1(Const) is constructible from Delegate1. And possibly more? LambdaDelegate1?


The design for this system is kind of bonkers.

digraph {
IDelegate -> DelegateBase
DelegateBase -> Delegate
DelegateBase -> Delegate1
DelegateBase -> Delegate2RFunc
IDelegate1 -> Delegate1 
IDelegate1 -> DelegateBase
IDelegate2 -> Delegate2
IDelegate2 -> DelegateBase
IDelegate1R
IDelegate2R -> DelegateBase

IFunction -> LambdaFunction
AnyFunction

IDelegate -> AnyDelegate
IDelegate1 -> "AnyDelegate1?"
IDelegate2 -> AnyDelegate2
IDelegate1R -> "AnyDelegate1R?"
IDelegate2R -> "AnyDelegate2R?"

IDelegate2R -> LambdaDelegate2R

"IDelegateR<bool>" -> "AnyDelegateR<bool>::UnbindDummy"
"IDelegateR<bool>" -> "LambdaDelegateR<bool>"
}
leoetlino commented 4 years ago

Implemented DelegateFunc.