2using System.Collections;
3using System.Collections.Generic;
6using System.Threading.Tasks;
23 private Entry currentEntry =
null;
24 private T currentObject =
default;
26 private bool endOfBlock;
37 this.endOfBlock =
true;
38 this.provider = Provider;
64 object IEnumerator.Current => this.currentObject;
78 if (this.currentDecodedEntry is
null)
79 this.currentDecodedEntry =
new LedgerEntry<T>(this.currentEntry, this.currentObject);
81 return this.currentDecodedEntry;
93 this.blockEnumerator?.Dispose();
94 this.blockEnumerator =
null;
113 this.blockEnumerator.Reset();
114 this.endOfBlock =
true;
131 while (this.endOfBlock)
137 string FileName = this.provider.GetFullFileName(BlockRef.
FileName);
141 if (File.Exists(FileName))
147 this.endOfBlock = this.reader.
EOF;
157 this.endOfBlock =
true;
161 this.currentDecodedEntry =
null;
163 this.endOfBlock = this.reader.
EOF;
171 this.currentObject = Typed;
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.
Reads objects in a block.
static async Task< BlockReader > CreateAsync(string FileName, NeuroLedgerProvider Provider)
Creates a block reader.
string CollectionName
Collection name.
async Task< Entry > ReadEntryAsync()
Reads an entry from the block.
bool EOF
If the current position is at the end of the file.
void Dispose()
IDisposable.Dispose
Represents an entry in a block or bucket file.
Represents a decoded ledger entry.
Task< ObjectSerializer > GetObjectSerializerEx(object Object)
Gets the object serializer corresponding to a specific object.
Enumeratres through objects available in a series of blocks.
T Current
Gets the element in the collection at the current position of the enumerator.
async Task< bool > MoveNextAsync()
Advances the enumerator to the next element of the collection.
Entry CurrentEntry
Current encoded entry.
bool MoveNext()
Advances the enumerator to the next element of the collection.
void Dispose()
IDisposable.Dispose
void Reset()
Sets the enumerator to its initial position, which is before the first element in the collection.
static async Task< ObjectEnumerator< T > > Create(IAsyncEnumerator< BlockReference > BlockEnumerator, NeuroLedgerProvider Provider)
Creates an object enumerator from a block enumerator.
Contains a reference to a block in the ledger.
string FileName
Local filename of block
Manages binary deserialization of data.
Serializes a class, taking into account attributes defined in Attributes.
virtual async Task< object > Deserialize(IDeserializer Reader, uint? DataType, bool Embedded)
Deserializes a value.
const uint TYPE_OBJECT
Represents an object.
Interface for asynchronous enumerators.
Task< bool > MoveNextAsync()
Advances the enumerator to the next element of the collection.
Interface for ledger entries.
Enumerator of ledger entries