The Set_value plugin allows setting values to data and metadata descriptors from the yaml file.
There are 3 main features:
At its root, the Set_value configuration is made of:
key | value |
---|---|
"on_init" (optional) | a list of value operation |
"on_event" (optional) | an on_event |
"on_data" (optional) | an on_data |
Specifies a list of operation to do in PDI_init function. on_init
is a list of value operation s.
Specifies a map of events that will trigger the values set. on_event
is a map with event name as a key and value operation list as map value.
key | value |
---|---|
".*" (optional) | a list of value operation |
Specifies a map of data that on share will trigger the values set. on_data
is a map with data/metadata name as a key and value operation as map value.
key | value |
---|---|
".*" (optional) | a list of value operation |
Defines what operation to do with given value list. The order of the operation is important and will be called in the same order as defined in yaml file.
key | value |
---|---|
"set" (optional) | a value list |
"share" (optional) | a value list |
"expose" (optional) | a value list |
Share warning
Share is always done with read and write rights. Plugin allocates memory by malloc
. If you reclaim the data, you should free it with free
instruction. If you don't reclaim or release data, plugin will try to release all descriptors that has shared before (failure is not an error, so user can reclaim the shared data).
Is a list of the
as elements. The order of the elements is important. The descriptors will be set in the same order as given in the yaml file.
Is a map of descriptor name as a key, and a value to set as a value:
key | value |
---|---|
".*" (optional) | a scalar value to set |
Is a map of descriptor name as a key, and a list of values to set as a value:
key | value |
---|---|
".*" (optional) | a list of value to set |
Is a map of descriptor name as a key, and a list of members to set as a value. Each member consist of an inner value_list
. The order of the members is unrestricted, but the plugin will set the values to the members in the same order.
key | value |
---|---|
".*" (optional) | a map with member name as key and a value to set as value |
The set_value plugin allows to use the old values to set new values, you can use even the same descriptor, for example to increment a scalar.
After calling init
and increment
event, value_int
will be equal 1, and int_array
to [2, 3, 4].
The new value is set at the end of processing the whole descriptors. This means, that if you want to update the array element depending on other element, the old value will be set:
After calling init
and increment
event, all values in int_array
will equal 1
. This is because the int_array[0]
was updated after setting all the elements.
After calling init
and increment
event, all values in int_array
will equal 1
. This is because the int_scalar
is set and then the int_array
is updated after the int_scalar
has a new value.