Class: LocationFilter
The range of Locations a subscription or fetch selects. The Location Filter Type decides which fields are set, and the value is not length-prefixed.
Every Group here is absolute, except startGroup of a LocationFilterType.RelativeStart, which counts back from the Next Group: 0 is the Next Group, 1 the current one. The wire carries the End Group as a delta from the Start Group; that is undone on the way in and redone on the way out.
If omitted from SUBSCRIBE or FETCH, the subscription or fetch is unfiltered. If omitted from REQUEST_UPDATE, the value is unchanged.
Implements
Constructors
Constructor
new LocationFilter(
filterType,startGroup?,startObject?,endGroup?,endObject?):LocationFilter
Parameters
filterType
startGroup?
bigint
startObject?
bigint
endGroup?
bigint
endObject?
bigint
Returns
LocationFilter
Throws
:ProtocolViolationError When a field the type calls for is missing, or the End Group is before the Start Group.
Properties
endGroup?
readonlyoptionalendGroup?:bigint
endObject?
readonlyoptionalendObject?:bigint
filterType
readonlyfilterType:LocationFilterType
startGroup?
readonlyoptionalstartGroup?:bigint
startObject?
readonlyoptionalstartObject?:bigint
TYPE
readonlystaticTYPE:LocationFilter=MessageParameterType.LocationFilter
Accessors
absoluteStart
Get Signature
get absoluteStart():
Location|undefined
The Start Location an absolute filter carries; undefined for the others.
Returns
Location | undefined
Methods
endLocation()
endLocation():
Location|undefined
The last Location the filter passes, inclusive, or undefined when it is open-ended. A Group End is the whole of that group, so its Object is 2^64-1.
Returns
Location | undefined
fetchRange()
fetchRange(
largest?): {end:Location;start:Location; } |undefined
The inclusive range the filter selects under the rules for a Fetch, which never reach past the Largest Object: an open end is the Largest Object, and no filter at all is the whole track up to it.
undefined when that range is empty, which includes a track with nothing published yet and a Next Object filter, whose start is always past the Largest Object.
Parameters
largest?
Returns
{ end: Location; start: Location; } | undefined
serializeValue()
serializeValue():
Uint8Array
The Location Filter Type and its fields, without the Parameter Type.
Returns
Uint8Array
startLocation()
startLocation(
largest?):Location|undefined
The first Location the filter passes, given the track's Largest Object, or undefined when there is no filter. A relative start that would fall before group 0 is group 0; a track with nothing published yet starts a relative filter at {0,0}.
Parameters
largest?
Returns
Location | undefined
toKeyValuePair()
toKeyValuePair():
KeyValuePair
Returns
Implementation of
deserializeValue()
staticdeserializeValue(buf):LocationFilter
Reads a Location Filter Type and exactly the fields it calls for.
Parameters
buf
Returns
LocationFilter
Throws
:ProtocolViolationError For an unknown Location Filter Type, or an End Group past 2^64-1.
fromKeyValuePair()
staticfromKeyValuePair(pair):LocationFilter|undefined
Parameters
pair
Returns
LocationFilter | undefined