As discussed in Subsection 7.3.7, when hooks execution
is enabled, implementation-specific instrumentation is executed. Using
the --generate-hooks option on the Babel
command line when generating implementation-side bindings results
in the automatic generation of a _pre and _post
method for every static and non-static method associated with each class
in the specification. For the aStaticMethod specified in
Subsection 7.3.7, the generated _pre method
implementation is
void
hooks::Basics_impl::aStaticMeth_pre_impl(int32_t i, int32_t io )
{
// DO-NOT-DELETE splicer.begin(hooks.Basics.aStaticMeth_pre)
/*
* Add instrumentation here to be executed immediately prior
* to dispatch to aStaticMeth().
*/
// DO-NOT-DELETE splicer.end(hooks.Basics.aStaticMeth_pre)
}
while that of the _post method is
void
hooks::Basics_impl::aStaticMeth_post_impl(int32_t i, int32_t o, int32_t io,
int32_t _retval)
{
// DO-NOT-DELETE splicer.begin(hooks.Basics.aStaticMeth_post)
/*
* Add instrumentation here to be executed immediately after
* return from dispatch to aStaticMeth().
*/
// DO-NOT-DELETE splicer.end(hooks.Basics.aStaticMeth_post)
}
Per the normal implementation process, the desired instrumentation should be added within the splicer blocks of aStaticMethod_pre and aStaticMethod_post. As stated in the comments within those blocks, aStaticMethod_pre will be executed immediately prior to dispatch to aStaticMethod when the latter is invoked by a client. Assuming no exceptions are encountered, aStaticMethod_post is executed immediately upon return from aStaticMethod.