Hooks implementation

As discussed in Subsection 11.3.8, 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 11.3.8, the generated _pre method implementation is$:$


def aStaticMeth_pre(i, io):
  #
  # sidl EXPECTED INCOMING TYPES
  # ============================
  # int i
  # int io
  #

  #
  # sidl EXPECTED RETURN VALUE(s)
  # =============================
  # # None
  #

  """\
Basic illustration of hooks for static methods.
"""
  # DO-NOT-DELETE splicer.begin(aStaticMeth_pre)
  # 
  # Add instrumentation here to be executed immediately prior
  # to dispatch to aStaticMeth().
  # 
  return
  # DO-NOT-DELETE splicer.end(aStaticMeth_pre)

while that of the _post method is$:$


def aStaticMeth_post(i, o, io, _retval):
  #
  # sidl EXPECTED INCOMING TYPES
  # ============================
  # int i
  # int o
  # int io
  # int _retval
  #

  #
  # sidl EXPECTED RETURN VALUE(s)
  # =============================
  # # None
  #

  """\
Basic illustration of hooks for static methods.
"""
  # DO-NOT-DELETE splicer.begin(aStaticMeth_post)
  #
  # Add instrumentation here to be executed immediately after
  # return from dispatch to aStaticMeth().
  # 
  return
  # DO-NOT-DELETE splicer.end(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.





babel-1.4.0
users_guide Last Modified 2008-10-16

http://www.llnl.gov/CASC/components
components@llnl.gov