composeHistory static method

DC composeHistory(
  1. KeyList<PropertyTemplate, List<PropertyValue>> history,
  2. DistributedConnection connection, [
  3. bool prependLength = false
])
Compose resource history History DistributedConnection is required to fetch resources.

Implementation

static DC composeHistory(
    KeyList<PropertyTemplate, List<PropertyValue>> history,
    DistributedConnection connection,
    [bool prependLength = false]) {
  var rt = new BinaryList();

  for (var i = 0; i < history.length; i++)
    rt
      ..addUint8(history.keys.elementAt(i).index)
      ..addDC(composePropertyValueArray(
          history.values.elementAt(i), connection, true));

  if (prependLength) rt.insertInt32(0, rt.length);

  return rt.toDC();
}