9 /************************************************************************
10 * do not add code to this header
11 ************************************************************************/
14 * - Local variables for each process can be defined in the structure
15 * LocalState. For each process, a new instance of LocalState is
17 * - The ProcessInit function pointer points to the function which is
18 * called to initialize a process.
19 * - The ProcessFire function pointer points to the function which is
20 * called repeatedly by the scheduler.
21 * - The wptr is a placeholder for callback. A pointer to the wrapper
22 * class instance of the process can be assigned. This is done in the
23 * code generated by the code generation, so one can just leave it
27 //structure for local memory of process
28 typedef struct _local_states *LocalState;
30 //additional behavioral functions could be declared here
31 typedef void (*ProcessInit)(struct _process*);
32 typedef int (*ProcessFire)(struct _process*);
38 typedef struct _process {
42 WPTR wptr; //placeholder for wrapper instance
46 //macros to deal with iterated ports
49 * macro to create a variable to store a port name
51 * @param name name of the variable
53 #define MAX_PORT_NAME_LENGTH 255
54 #define CREATEPORTVAR(name) char name[MAX_PORT_NAME_LENGTH]
58 * Create the port name of an iterated port based on its basename and the
61 * @param port buffer where the result is stored (created using
63 * @param base basename of the port
64 * @param number_of_indices number of dimensions of the port
65 * @param index_range_pairs index and range values for each dimension
67 #define CREATEPORT(port, base, number_of_indices, indices...) \
68 createPort(port, base, number_of_indices, indices)
70 char* createPort(char* port,
72 int number_of_indices,
75 int getIndex(const char* string, char* tokens, int indexNumber);