vson.meta.funcattr

Helpers for working with user-defined attributes that can be attached to function or method to modify its behavior. In some sense those are similar to Python decorator. D does not support this feature natively but it can be emulated within certain code generation framework.

Members

Functions

after
auto after()

Marks function/method for usage with AttributedFunction.

before
auto before(string parameter_name)

Marks function/method for usage with AttributedFunction.

computeAttributedParameter
auto computeAttributedParameter(ARGS args)

Computes the given attributed parameter using the corresponding @before modifier.

computeAttributedParameterCtx
auto computeAttributedParameterCtx(T ctx, ARGS args)

Computes the given attributed parameter using the corresponding @before modifier.

createAttributedFunction
auto createAttributedFunction(T args)

Syntax sugar in top of AttributedFunction

evaluateOutputModifiers
ReturnType!FUNCTION evaluateOutputModifiers(ReturnType!FUNCTION result)

Processes the function return value using all @after modifiers.

Mixin templates

PrivateAccessProxy
mixintemplate PrivateAccessProxy()

Helper mixin to support private member functions for @before attributes.

Structs

AttributedFunction
struct AttributedFunction(alias Function, alias StoredArgTypes)

Entry point for funcattr API.

Templates

IsAttributedParameter
template IsAttributedParameter(alias Function, string name)

Checks if parameter is calculated by one of attached functions.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Михаил Страшун