value Layer
Last updated
Was this helpful?
Last updated
Was this helpful?
The <value> layer represents extra values (such as protocol version and/or extra flags), that are applicable to all the messages, but delivered as part of transport instead of message payload.
The <value> layer has all the properties as well as extra properties and elements described below.
In most cases the received value must be reassigned to appropriate field of the . To specify the supported interfaces use interfaces . The value of the property is comma separated list of names of the supported interfaces.
NOTE, that all the interfaces listed in the interfaces property value must have a field with the name specified as the interfaceFieldName value. Also the specified field's index (among other available fields of the <interface>) must be the same for all the listed interfaces.
The location of the pseudo <value> layer within the <frame> is not important. It is recommended to define it right before the <payload> layer.
As part of processing Connect message in the example above, the client code is expected to retrieve the value of the ProtocolVersion field and report it to the pseudo <value> layer within the processing frame. For all the subsequent messaged, the pseudo <value> layer is responsible to assign appropriate value (version in the example above) to the newly created message object before message payload gets read. This is because such values may have an influence on how the read operation is executed (existence of some fields may depend on the assigned value).
In addition to specifying the interfaces themselves, there is a need to specify the field name in the interface(s), that will hold the processed value, using interfaceFieldName .
There are protocols that don't report protocol version in their transport framing. Instead, they use some special "connection" message that report protocol version. As the result, all subsequent messages must adhere to the reported version. The CommsDSL resolves this problem by defining pseudo <value> layer using pseudo with value. The field of the pseudo <value> layer does not get serialized. However, the code generator must allow external assignment of the required value to the private data members of the <value> layer's class.
Use for future references.