Functions for All Pointcuts

Functions

const char * aop_get_function_name (void)
struct aop_dynvalaop_capture_in_param (struct aop_joinpoint *jp, int n)
void aop_filter_by_in_param (struct aop_pointcut *pc, int n, const struct aop_type *type)
struct aop_dynvalaop_capture_in_param_by_type (struct aop_joinpoint *jp, int n, const struct aop_type *type)
int aop_capture_lineno (struct aop_joinpoint *jp)
const char * aop_capture_file_name (struct aop_joinpoint *jp)

Function Documentation

const char* aop_capture_file_name ( struct aop_joinpoint jp  ) 

Get the name of the file this join point is in. This function will usually return the name of the file that is currently being compiled, but compiler macros make it possible for their to be join points from other files.

Parameters:
jp Any join point.
struct aop_dynval* aop_capture_in_param ( struct aop_joinpoint jp,
int  n 
) [read]

Get a dynval representing the nth parameter passed to the current fuction. Be careful not to capture the in_param of the current function when you actually intend to capture the call_param being passed to a function call join point. (For the latter, use aop_capture_call_param() instead).

Note that you must use aop_filter_by_in_param() to filter a pointcut by parameter type for any parameter you wish to capture with this function.

Parameters:
jp Any kind of join point. Join points are obtained by joining on a pointcut.
n The index of the parameter to capture. Parameters are indexed from zero.
Returns:
A dynval with its type determined by aop_filter_by_in_param().
Examples:
duplicate.c.
struct aop_dynval* aop_capture_in_param_by_type ( struct aop_joinpoint jp,
int  n,
const struct aop_type type 
) [read]

Get a dynval representing the nth parameter passed to the current function if there is a parameter n and it matches the specified type. This function makes it possible to capture a parameter even if you have not filtered on its type with aop_filter_call_pc_by_param(). However, it returns NULL if there is no parameter n or if parameter n does not match the specified type.

Parameters:
jp A function call join point. Function call join points are obtained by joining on an aop_match_function_call() pointcut.
n The index of the parameter to capture. Parameters are indexed from zero.
type This function verifies that the captured parameter matches the specified type.
Returns:
dynval with its type determined by the specified type or NULL if there is no matching parameter n.
int aop_capture_lineno ( struct aop_joinpoint jp  ) 

Get the line number of join point. You usually want to call this with aop_capture_file_name() to fully identify the line of code the join point is from.

Parameters:
jp Any join point.
void aop_filter_by_in_param ( struct aop_pointcut pc,
int  n,
const struct aop_type type 
)

Filter a pointcut (of any type) to only include join points within functions that take an nth parameter matching the specified type. Be careful not to use this function when you actually intend to filter a function call pointcut by the parameters that the function call takes. (For the latter, use aop_filter_call_pc_by_param()).

Because pointcuts are created per function, this kind of filtering is actually all-or-nothing. It will either empty the pointcut or leave it as is.

Filters on the same parameter do not stack on top of each other. If multiple parameter filters with the same n are applied a pointcut, only the last one will have any effect.

Note that you must filter a parameter by its type in order to capture it with aop_capture_in_param().

Parameters:
pc The pointcut to filter.
n The index of the parameter to filter on. Parameters are indexed from zero.
type The parameter type to filter by.
Examples:
duplicate.c.
const char* aop_get_function_name ( void   ) 

Get the name of the current function. You can call this directly from a pass function or from any join point iterator function.

Returns:
The name of the current function.
Examples:
duplicate.c, and hello.c.
Generated on Tue Jul 31 21:46:42 2012 for InterAspect by doxygen 1.6.1