Generic objects
Generic objects hold key-value pairs like records, but unlike records, generic objects use string keys, not numeric keys and a field definitions file. This freedom from the necessity for fields to be defined in advance in a field definitions file makes generic objects ideal for unstructured data and flexible message specifications.
Liberator throttles generic objects from version 7.1.24. Depending on your configuration, you may need to explicitly disable throttling for generic objects for which throttling is inappropriate. For information on disabling throttling, see Disabling throttling. |
Internal structure
This section compares the internal structure of DataSource records and DataSource generic objects.
DataSource records
In records, values are stored against a numeric key that is mapped to a field name in a field definitions file:
Key | Value |
---|---|
11001 |
1.2950 |
11002 |
1.2990 |
11003 |
1.2805 |
11004 |
1.3010 |
… |
… |
add-field Bid 11001 0 add-field Ask 11002 0 add-field Min_Value 11003 0 add-field Max_Value 11004 0 ...
DataSource generic objects
In generic objects, field names and values are both stored as numerically-keyed values, following a convention whereby field names and their values alternate in the data structure. This approach, handled invisibly by Caplin’s DataSource APIs, allows field names to be stored as strings within the data structure and does not require fields to be defined in advance in a field definitions file:
Key | Value |
---|---|
0 |
Bid |
1 |
1.2950 |
0 |
Ask |
1 |
1.2990 |
0 |
Min_Value |
1 |
1.2805 |
0 |
Max_Value |
1 |
1.3010 |
… |
… |
See also: