This module loads (prefix, value) records from database and indexes them in a named memory tree. Name of the tree is specified for each record or as module parameter. It exports to configuration file functions to match against in-memory trees and return the values (raw or precompiled) associated with matched prefixes. The maximum size of the prefix is limited internally to 63, database table definition may enforce lower maximum size.
| Parámetro | Tipo | Descripción |
|---|---|---|
| db_url | string | 3.2. db_table (string) 3.3. mtree (string) 3.4. tname_column (string) 3.5. tprefix_column (string) 3.6. tvalue_column (string) 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. item (string) 3.10 |
| db_table | string | 3.3. mtree (string) 3.4. tname_column (string) 3.5. tprefix_column (string) 3.6. tvalue_column (string) 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. item (string) 3.10. pv_value (string) 3.1 |
| mtree | string | 3.4. tname_column (string) 3.5. tprefix_column (string) 3.6. tvalue_column (string) 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. item (string) 3.10. pv_value (string) 3.11. pv_values (string |
| tname_column | string | 3.5. tprefix_column (string) 3.6. tvalue_column (string) 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. item (string) 3.10. pv_value (string) 3.11. pv_values (string) 3.12. pv_dstid (string) 3 |
| tprefix_column | string | 3.6. tvalue_column (string) 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. item (string) 3.10. pv_value (string) 3.11. pv_values (string) 3.12. pv_dstid (string) 3.13. pv_weight (string) 3.14. |
| tvalue_column | string | 3.7. fetch_rows (integer) 3.8. char_list (string) 3.9. item (string) 3.10. pv_value (string) 3.11. pv_values (string) 3.12. pv_dstid (string) 3.13. pv_weight (string) 3.14. pv_count (string) 3.15. mt_ |
| fetch_rows | integer | 3.8. char_list (string) 3.9. item (string) 3.10. pv_value (string) 3.11. pv_values (string) 3.12. pv_dstid (string) 3.13. pv_weight (string) 3.14. pv_count (string) 3.15. mt_tree_type (integer) 3.16. |
| char_list | string | 3.9. item (string) 3.10. pv_value (string) 3.11. pv_values (string) 3.12. pv_dstid (string) 3.13. pv_weight (string) 3.14. pv_count (string) 3.15. mt_tree_type (integer) 3.16. mt_ignore_duplicates (in |
| item | string | 3.10. pv_value (string) 3.11. pv_values (string) 3.12. pv_dstid (string) 3.13. pv_weight (string) 3.14. pv_count (string) 3.15. mt_tree_type (integer) 3.16. mt_ignore_duplicates (integer) 3.17. mt_all |
| pv_value | string | 3.11. pv_values (string) 3.12. pv_dstid (string) 3.13. pv_weight (string) 3.14. pv_count (string) 3.15. mt_tree_type (integer) 3.16. mt_ignore_duplicates (integer) 3.17. mt_allow_duplicates (integer) |
| pv_values | string | 3.12. pv_dstid (string) 3.13. pv_weight (string) 3.14. pv_count (string) 3.15. mt_tree_type (integer) 3.16. mt_ignore_duplicates (integer) 3.17. mt_allow_duplicates (integer) |
| pv_dstid | string | 3.13. pv_weight (string) 3.14. pv_count (string) 3.15. mt_tree_type (integer) 3.16. mt_ignore_duplicates (integer) 3.17. mt_allow_duplicates (integer) |
| pv_weight | string | 3.14. pv_count (string) 3.15. mt_tree_type (integer) 3.16. mt_ignore_duplicates (integer) 3.17. mt_allow_duplicates (integer) |
| pv_count | string | 3.15. mt_tree_type (integer) 3.16. mt_ignore_duplicates (integer) 3.17. mt_allow_duplicates (integer) |
| mt_tree_type | integer | 3.16. mt_ignore_duplicates (integer) 3.17. mt_allow_duplicates (integer) |
| mt_ignore_duplicates | integer | 3.17. mt_allow_duplicates (integer) |
| mt_allow_duplicates | integer | 3.1. db_url (string) |
| db_url | string | URL of the database server to be used. |
| db_table | string | Name of database table where data for many trees is stored. It is ignored if a 'mtree' parameter is defined. The SQL scripts creates a table named 'mtrees' that can be used for this parameter. |
| mtree | string | Definition of memory tree with using a parameters format string. The parameter names can be: * name - the name of the tree to be used for referencing inside configuration file. * mode - the mode of it |
| tname_column | string | Name of 'tname' column. |
| tprefix_column | string | Name of 'tprefix' column. |
| tvalue_column | string | Name of 'tvalue' column. |
| fetch_rows | integer | Number of rows to be loaded in one step from database. |
| char_list | string | The list with characters allowed in prefix. |
| item | string | Add items to a mtree. The value has to contain the tree name, prefix and value, separated by the first character of the value. For example, if the wanted separator is ':', then the value format is ':t |
| pv_value | string | The PV spec where to store the matched value. It can be any writable PV. |
| pv_values | string | The AVP where to store the matched values when mtree is of type 0 or 2 and mode of mt_match() call has value 2. |
| pv_dstid | string | The AVP name where to store the first integer value when tree type is 1. |
| pv_weight | string | The AVP name where to store the second integer value when tree type is 1. |
4.1. mt_match(mtree, pv, mode)
Match 'pv' value against 'mtree'. If 'mtree' type is 0 or 2 and value of 'mode' is NOT 2, sets associated value of the longest matching prefix to pseudo variable specified by pv_value parameter. If 'mtree' type is 0 or 2 and value of 'mode' is 2, set
Copyright © 2010 Daniel-Constantin Mierla (asipto.com)
Copyright © 2011 Juha Heinanen