Interface IGeneratedLogger<TModel>
Inherited Members
Namespace: Mars.Core.Data
Assembly: Mars.Core.dll
Syntax
public interface IGeneratedLogger<TModel> : IOutputLogger
Type Parameters
Name | Description |
---|---|
TModel |
Properties
Entity
The associated entity model object (either an agent or a layer)
Is refined implemented in IGeneratedEntityLogger.
Declaration
TModel Entity { get; set; }
Property Value
Type | Description |
---|---|
TModel |
Id
Gets the Id of the entity which is cared by this mapping proxy
Declaration
Guid Id { get; set; }
Property Value
Type | Description |
---|---|
Guid |
IdString
Gets the serialized Id of the entity prepared for the output
Declaration
string IdString { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Use this when the entity id is used within the output
Methods
IsSerializable()
Checks for the current instance, based on precondition whether this instance shall be persisted or not.
Declaration
bool IsSerializable()
Returns
Type | Description |
---|---|
System.Boolean | Returns true when the instance can be serialized otherwise false |
Serialize()
Serialize the snapshot of an agent with output properties as a
formatted byte field, encoded in hex. Instead of creating a new DataFrame struct
the primitive output properties will be serialized directly. This format
is much more smaller and faster than just to use the Serialize()
method, but for the client within the database or in the client programme (with another language)
there an explicit deserialization step necessary.
MessagePack specification
https://msgpack.org
.Net binding of MessagePack with all options described
https://github.com/neuecc/MessagePack-CSharp#performance
Declaration
byte[] Serialize()
Returns
Type | Description |
---|---|
System.Byte[] | A |
SerializeCompressed()
Serialize the snapshot of an agent with output properties as a
formatted byte field, encoded in hex and compressed by the LZ4 compression algorithm.
Instead of creating a new DataFrame struct
the primitive output properties will be serialized directly. This format
is much more smaller and faster than just to use the Serialize()
method, but for the client within the database or in the client programme (with another language)
there an explicit deserialization step necessary.
MessagePack specification
https://msgpack.org
LZ4 compression algorithm
https://en.wikipedia.org/wiki/LZ4_(compression_algorithm)
.Net binding of MessagePack with all options described
https://github.com/neuecc/MessagePack-CSharp#performance
Declaration
byte[] SerializeCompressed()
Returns
Type | Description |
---|---|
System.Byte[] | A |
SerializeProperties()
Serialize the values of all output properties by returning the actual values with the underlying property structure
as an iterator.
Declaration
IEnumerable<> SerializeProperties()
Returns
Type | Description |
---|---|
IEnumerable<System.> | Returns an iterator containing each output property value with the associated name, and the corresponding data type of this property. When no output properties are registered, then the iterator returns nothing. |
Remarks
This method can be used to get the concrete values of an entity or layer or to generate the schema by using
the returned property names.
SerializePropertyValues()
Serialize the values of all output properties by returning the actual value as an iterator.
Declaration
IEnumerable<object> SerializePropertyValues()
Returns
Type | Description |
---|---|
IEnumerable<System.Object> | Returns an iterator containing each output property value. |
SerializeToDocument()
Serialize the output properties directly into a structure
in which the document is always be reused for each tick.
This document the whole output tree of the associated Entity.
Declaration
BsonDocument SerializeToDocument()
Returns
Type | Description |
---|---|
BsonDocument |
Returns an updated |
SerializeToJson()
Serialize the output properties directly as a JSON suited document.
Based on the output configuration , in default case,
this DOES NOT include the property names as keys.
Declaration
string SerializeToJson()
Returns
Type | Description |
---|---|
System.String | A JSON formatted string of all output properties for the associated agent. |