flibrary StringListMods <build_dir="iac_proj/strlist", out_hdr_file="gen.h"> { group+OPort StringListParams{ int+Port2 index; int+Port2 append; int+Port2 insert; int+Port2 delete; }; module StringListCore<src_file="strlist.c"> { string+Port2 list[]; string+IPort2 item; StringListParams+IPort2 ¶ms; int+IPort2 index => params.index; int+IPort2 append => params.append; int+IPort2 insert => params.insert; int+IPort2 delete => params.delete; omethod+notify_inst+req Update( .list+read+write, .item+read, .index+read, .append+read+write+notify, .insert+read+write+notify, .append+read+write+notify, .delete+read+write+notify ) = "StringListUpdate"; }; };
The StringListCore low level modules provides the functionality to append or insert a string into a list of strings. The append put the new string at the end of the list. The insert can either be an insert at a defined position if the index is in the range of the string-array indexes or an attempt to generate a sorted list if the index parameter is outside the string array indexes (e.g. negative). The sorting is in ascending order from the top of the list. This sorting only works properly if the list was sorted before. Additionally the StringListCore provides the functionality to delete an entry from the list.
list[]
Takes the array of strings on which the action should be performed.
item
string to be inserted into the list
index
index which is used for the action.
Action | value of index | Description |
append | ignored | The data element is appended as last element of the list. |
insert | < 0 or ≥ sizeof list[] | The list is assumed to be sorted in ascending order and the data element is inserted in the position to fit the order of the list. |
≥ 0 and < sizeof list[] | The data element is inserted in the position given by index. | |
append | used | The data element at the indexed position is deleted from the list. |
append
Triggers the module to append the string in item to the list. The trigger is reset by the module.
insert
Triggers the module to insert the string in item into the list. The trigger is reset by the module.
delete
Triggers the module to delete the string in the position of the index value from the list. The trigger is reset by the module.
The low-level module StringListCore is used in the Functional Macro StringListFunc.
Tobias Schiebeck, International AVS Centre
International AVS Centre Manchester Visualization Centre Kilburn Building University of Manchester Oxford Road Manchester United Kingdom M13 9PL