abstract class Bindgen::Call::HookableBody
- Bindgen::Call::HookableBody
- Bindgen::Call::Body
- Reference
- Object
Overview
A body allowing to add additional code before and after the actual code
body. This is useful to allow later processors to refine existing calls
with additional logic. An example of this is the VirtualOverride
processor, which uses this to augment #initialize
methods setting the
jump-table.
Note: The pre_hook and post_hook must be manually called in your
#to_code
implementation.
See CallBuilder::CrystalBinding::InvokeBody
for an example of this.
Direct Known Subclasses
Defined in:
bindgen/call.crInstance Method Summary
-
#post_hook : Body | Nil
Code snippet ran after the body code itself.
-
#post_hook=(post_hook : Body | Nil)
Code snippet ran after the body code itself.
-
#pre_hook : Body | Nil
Code snippet ran before the body code itself.
-
#pre_hook=(pre_hook : Body | Nil)
Code snippet ran before the body code itself.
Instance methods inherited from class Bindgen::Call::Body
to_code(call : Call, platform : Graph::Platform) : String
to_code
Instance Method Detail
Code snippet ran after the body code itself. The result value is stored
in a variable called result
.
Code snippet ran after the body code itself. The result value is stored
in a variable called result
.
Code snippet ran before the body code itself. Access to the arguments of the body can be accessed directly by their name.
Code snippet ran before the body code itself. Access to the arguments of the body can be accessed directly by their name.