Persister class abstract

Children of Persister implement the actual reading and writing of particular types of GpsPointsView descendants. They must be stateless w.r.t. to the data they are persisting, the only data they are allowed to contain are generic information such as their own version number and signature.

Implementers

Constructors

Persister()
Creates the Persister and registers it to the specified Persistence manager class.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signature String
Returns the signature string for this Persister.
no setter
signatureAndVersion SignatureAndVersion
Override in children to indicate the signature of this class (used to recognize when reading a file which persister to initialize) and which version is written. The version should be increased if for example new fields get persisted. In that case, the reader must contain compatibility code for reading older versions.
no setter
supportedType Type
Indicates what object type this Persister can persist, to be overridden in child classes.
no setter
version int
Indicates the version of the persistence method.
no setter

Methods

getMetadata(GpsPointsView<GpsPoint> view) ByteData?
Allows writing up to Persistence.maxMetadataLength bytes of extra information in the file header. Override in children if needed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readViewFromStream(GpsPointsView<GpsPoint> view, StreamReaderState source, int version, ByteData metadata) Future<void>
Overwrites the contents of view (if it is not read-only) with the information fom the source. version and metadata indicate the additional information that was read from the block header in the file, and may be used to e.g. convert old formats to new.
signatureFromString(String sig) String
Makes sure that the specified sig, if too short, is extended to be of valid signature length.
signatureFromType(Type type) String
Creates a default signature from the type. This should be used carefully, since changing the name of the supportedType class in a refactoring can lead to stored files becoming incompatible.
toString() String
A string representation of this object.
inherited
writeViewToStream(GpsPointsView<GpsPoint> view) Stream<List<int>>
Converts view to a Stream of bytes. Override in children.

Operators

operator ==(Object other) bool
The equality operator.
inherited