|
Y-lib
Loadrunner libraries
|
Business logic / clickflow support. More...
#include "y_core.c"Go to the source code of this file.
Data Structures | |
| struct | y_flow |
| Descriptor for one single flow in a flow list. More... | |
Typedefs | |
| typedef int( | y_flow_func) () |
| Type definition of a function pointer to the flow to execute. More... | |
Functions | |
| int | y_calc_flow_weight_total (y_flow flow_list[], int flow_count) |
| Calculate the total of the weights in a given flow list. More... | |
| y_flow * | y_choose_flow (y_flow flow_list[], int flow_count) |
| Choose a flow from a list of flows. More... | |
| int | y_exec_flow (y_flow *chosen_flow) |
| Execute a flow from a flow list. More... | |
| y_flow * | y_get_flow_by_name (char *flow_name, y_flow flow_list[], int flow_count) |
| Fetch a specific item from a flow list, by name. More... | |
Business logic / clickflow support.
This file implements flow lists. A flow list is is a lists of actions (clickflow) that the script will choose from at random, using a set of predetermined weights. An 'action' is defined as a function that takes no arguments and returns an int - such as an action block, or a function without a specifically defined return type.
Example:
Definition in file y_flow_list.c.
| typedef int( y_flow_func) () |
Type definition of a function pointer to the flow to execute.
This matches the prototype for Action() blocks, so you can assign a action blocks to variables of this type.
Definition at line 83 of file y_flow_list.c.
| int y_calc_flow_weight_total | ( | y_flow | flow_list[], |
| int | flow_count | ||
| ) |
Calculate the total of the weights in a given flow list.
Given a flowlist of a specified length, calculate the total weight of all flows in a flow list. This is used by other ylib functions. Calling it directly from a script should normally not be needed.
| [in] | flow_list | An array of y_flow structs, each describing a specific choice in a clickpath. |
| [in] | flow_count | The number of flows in the list. |
Definition at line 125 of file y_flow_list.c.
| y_flow* y_choose_flow | ( | y_flow | flow_list[], |
| int | flow_count | ||
| ) |
Choose a flow from a list of flows.
| [in] | flow_list | An array of y_flow structs, each describing a specific choice in a clickpath. |
| [in] | flow_count | The number of flows in the list. |
Definition at line 147 of file y_flow_list.c.
| int y_exec_flow | ( | y_flow * | chosen_flow | ) |
Execute a flow from a flow list.
Usually this is a flow as determined by y_choose_flow().
| [in] | chosen_flow | The flow to execute. |
Definition at line 178 of file y_flow_list.c.
| y_flow* y_get_flow_by_name | ( | char * | flow_name, |
| y_flow | flow_list[], | ||
| int | flow_count | ||
| ) |
Fetch a specific item from a flow list, by name.
| [in] | flow_name | The name of the flow to fetch. |
| [in] | flow_list | The flow list in question. |
| [in] | flow_count | The number of flows in the list. |
Definition at line 207 of file y_flow_list.c.
1.8.11