ae.utils.meta.binding_v1

Method binding - before alias inference

Members

Functions

boundDgPointer
auto boundDgPointer(Dg dg)

Bound delegate pointer. Just a regular D delegate, basically. Return value contains a D delegate. Example construction: boundDgPointer(&method)

boundObj
auto boundObj(S s)

Create a bound "object" with the given context. Example construction: boundObj(context)

boundObjScope
auto boundObjScope(S s)

Create a bound "object" with the given sub-aggregate and context. Example construction: boundObjScope!aggregate(context)

Properties

unboundDgAlias
auto unboundDgAlias [@property getter]

This function group manufactures delegate-like objects which selectively contain a context or function pointer. This allows avoiding the overhead of an indirect call (which prevents inlining), or passing around a context when that context is already available on the caller's side, all while having the same syntax for invocation. The invocation syntax is as follows: If fun is the return value of these functions, and Fun is its type, Fun.call(fun, args...) will invoke the respective function. Unbound variants provide a callWith method, which additionally take a context to rebind with. Unbound delegate alias. Return value contains nothing (empty struct). Example construction: unboundDgAlias!method

unboundObj
auto unboundObj [@property getter]

Equilavents to the above functions, but for entire objects. Caller syntax: Obj.method(obj, args...) Create an unbound "object" which forwards calls to the given alias. Context is inferred from caller site. Example construction: unboundObj!aggregate

Structs

BoundDgAlias
struct BoundDgAlias(alias fun)
Undocumented in source.
BoundDgPointer
struct BoundDgPointer(Dg)
Undocumented in source.
DispatchToFirstArg
struct DispatchToFirstArg(T)
Undocumented in source.
UnboundDgAlias
struct UnboundDgAlias(alias fun)
Undocumented in source.
UnboundDgPointer
struct UnboundDgPointer(C, Dg)
Undocumented in source.
UnboundObj
struct UnboundObj(alias target)
Undocumented in source.
X
struct X
Undocumented in source.
Y
struct Y
Undocumented in source.

Templates

boundDgAlias
template boundDgAlias(alias fun)

Bound delegate alias. Return value contains context. Example construction: boundDgAlias!method(context)

disconnect
template disconnect(alias f)

Disconnect function (or function template) f from its "this" pointer, creating a template that can be passed as an alias parameter to a template which already has a context (such as a non-static templated method). To connect the alias back to a "this" pointer, use .connect(p). Use .call(args) on the result to call the resulting function. Requires __traits(child) support.

unboundDgPointer
template unboundDgPointer(alias fun)

Unbound delegate pointer. Return value contains function pointer without context. Example construction: unboundDgPointer!method(&method) Currently only implements callWith.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <vladimir@thecybershadow.net>