XVIZ Providers encapsulate the details of reading a particular XVIZ source and returns an object that allows you to access metadata and iterate over the XVIZ messages.
Clients should not construct XVIZProviders directly, but instead use the XVIZProviderFactory to find create a Provider.
If a client has a custom XVIZ data source they can create their own Provider and register it with the factory.
import {XVIZProviderFactory} from '@xviz/io';
import {FileSource} from '@xviz/io/node';
const root = '.';
const source = new FileSource(root);
const provider = await XVIZProviderFactory.open({
source,
root
});
if (provider) {
// ...
}
Attempts to verify if the source represents a valid XVIZ data source and sets the result from
valid()
appropriately.
This method must be called after construction before any other method.
Returns: (Boolean) - True if the source is a valid for this Provider
Returns: the XVIZ Metadata if present
Parameters:
range.startTime
(Number, optional) - The start time to being interation. If absent, set to the start of the log.range.endTime
(Number, optional) - The end time to stop iteration. If absent, set to the end of the log.options
(Object) - Implementation defined.
Returns: (iterator) - iterator object for messages
Parameters:
iterator
(Object) - An iterator obtained from the method getMessageIterator()
Returns: (XVIZData) - object or null if the iterator is invalid