DOFValuemarshal Method OpenDOF Object Access Library
Write a value to a DOFPacket .

This is an advanced routine and requires knowledge of the DOF Protocol Specification in order to ensure that the value written to the buffer follows the specification requirements for the value's type. Note that even "custom" types are built using DOF core types, and so the buffered format for all values is determined by the specification.

NOTE: Values are written from back to front. In other words, the first item written to the packet will be the last item in the packet.

Finally, implements must ensure that the value (data) cannot change during this call. This means that unless the implementation is immutable it should lock itself for the duration of this call. Once this call is complete then the value may be changed without affecting the value written to the packet.

Note that the library has likely already done a compatibility check between the value and the type, and so the check should not be made again (for performance reasons). However, in the case that the check has not been done, it is possible that this method will encounter various failures due to type casting. These should be caught and returned as a DOFErrorException .

Namespace: org.opendof.core.oal
Assembly: dof-oal (in dof-oal.dll) Version: 7.0.1.2
Syntax

C#
void marshal(
	DOFType type,
	DOFPacket packet
)

Parameters

type
Type: org.opendof.core.oalDOFType
The type that must be written. This type determines the wire formatting of the value.
packet
Type: org.opendof.core.oalDOFPacket
The destination packet.
Exceptions

ExceptionCondition
DOFMarshalExceptionThe value cannot be written.
DOFErrorExceptionThere were problems between the type and the value.
DOFMarshalException
DOFErrorException
See Also

Reference