• Documentation
  • Core API
  • SmartOpenHamburg API
  • Model Components API
  • Common API

    Show / Hide Table of Contents
    • Mars.Core
      • DependencyRegistrationCore
    • Mars.Core.Data
      • AbstractConfigLoader
      • AbstractEntityManager
      • AgentManagerImpl
      • DomainDataMediatorImpl
      • EntityManagerImpl
      • IAgentManager
      • IEntityManager
      • IEntityMapping
      • IGeneratedEntityLogger
      • IGeneratedLayerLogger
      • IGeneratedLogger<TModel>
      • IGeneratedTypeLogger
      • IModelCompiler
      • IOutputLogger
      • IPlatformSelector
      • ISchemaMigrationProvider
      • ISerializerManager
      • PlatformSelectorImpl
    • Mars.Core.Data.Compiler
      • AbstractEntityMapper
      • AbstractJitMapper
      • AbstractLayerMapper
      • AbstractMapper<TModel>
      • AbstractTypeMapper
      • RoslynCompilerUtils
    • Mars.Core.Data.Entities
      • CircleFilter
      • Condition
      • ConjunctiveWhere
      • DataFrame
      • DisjunctiveWhere
      • EqualityCondition
      • IntersectionFilter
      • ISelection
      • NearestFilter
      • Query
      • WindowFilter
      • WithinFilter
    • Mars.Core.Data.Exceptions
      • AgentInitializationException
    • Mars.Core.Data.Mapping
      • DefaultSourceProvider
      • ReflectiveMapping
    • Mars.Core.Data.Wrapper
      • AbstractOperationWrapper
      • AbstractWrapper
      • AbstractWrapper<TOptions>
      • GlobalRestrictions
      • ICircleQueryOperation
      • IIntersectionOperation
      • ILookupOperation
      • INearestOperation
      • IOperation
      • IPlatform
      • IQueryOperation
      • ISnapshot
      • IWindowQueryOperation
      • IWithinOperation
      • IWrapper
      • KnnGraphWrapper
      • PostGisWrapper
    • Mars.Core.Data.Wrapper.Document
      • IMongoConnection
      • IMongoWrapper
      • MongoDbIteratorHelper
      • MongoDbWrapper
    • Mars.Core.Data.Wrapper.File
      • AbstractFileWrapper<TOptions>
      • AscWrapper
      • GeoJsonWrapper
    • Mars.Core.Data.Wrapper.Memory
      • DataTableWrapper
      • GeoHashTrieWrapper
      • KdTreeWrapper
      • TripPosition
      • TripPositionCoordinateConverter
      • TripsCollection
      • TripsLineConverter
      • TripsTrajectoryWrapper
    • Mars.Core.Data.Wrapper.Relational
      • AbstractRelationalConnection
      • PostgresSqlDbConnection
      • PostgresSqlWrapper
      • RelationalMapperException
      • RelationalSqlWrapper<TOptions>
      • SqliteDbConnection
      • SqliteWrapper
    • Mars.Core.Data.Wrapper.Stream
      • MqttWrapper
      • SimulationTypeInfo
    • Mars.Core.Executor
      • IRuntimeModel
      • ISimulationProgress
      • IStepExecutor
    • Mars.Core.Executor.Entities
      • Parametrization
      • StepParam
    • Mars.Core.Executor.Implementation
      • RuntimeModelImpl
      • SimulationProgressImpl
      • StepExecutionUseCase
    • Mars.Core.Model
      • IConfigLoader
      • IModelContainer
      • IModelResolver
    • Mars.Core.Model.Entities
      • LayerInstanceContainer
    • Mars.Core.Model.Exceptions
      • InvalidMappingException
      • MissingConstructorException
      • ModelResolutionException
      • ValidationException
    • Mars.Core.Model.Implementation
      • DependencyBuilder
      • MappingHelper
      • ModelContainer
      • ValidationIssueLevel
      • ValidationResult
      • Validator
    • Mars.Core.Simulation
      • ISimulation
      • ISimulationControl
    • Mars.Core.Simulation.Entities
      • SimulationRestartArgs
      • SimulationWorkflowState

    Class AbstractMapper<TModel>

    Provides all abstract implementation shared by all just-in-time compiled individual mapper for the IGeneratedEntityLogger mapper interface.
    Inheritance
    System.Object
    AbstractJitMapper
    AbstractMapper<TModel>
    AbstractEntityMapper
    AbstractLayerMapper
    Implements
    IGeneratedLogger<TModel>
    IOutputLogger
    Inherited Members
    AbstractJitMapper.TypeName
    AbstractJitMapper.ProxyKey
    AbstractJitMapper.ConfigLoader
    AbstractJitMapper.Culture
    AbstractJitMapper.Type
    AbstractJitMapper.TypeLogger
    AbstractJitMapper.Mapping
    AbstractJitMapper.OutputFrequency
    AbstractJitMapper.OutputTicks
    AbstractJitMapper.HasOutputProperties
    AbstractJitMapper.Context
    AbstractJitMapper.ToString()
    AbstractJitMapper.GetHashCode()
    Namespace: Mars.Core.Data.Compiler
    Assembly: Mars.Core.dll
    Syntax
    public abstract class AbstractMapper<TModel> : AbstractJitMapper, IGeneratedLogger<TModel>, IOutputLogger
    Type Parameters
    Name Description
    TModel
    Remarks
    Beside preventing duplicate code, the idea is to reduce to overhead coming from the JIT compilation step by reducing the amount of generated (potential duplicate) code.

    Fields

    BsonDocument

    Declaration
    protected BsonDocument BsonDocument
    Field Value
    Type Description
    BsonDocument

    CompressionOptions

    The compression options when the SerializeCompressed() or SerializeToJsonCompressed() is used.
    Declaration
    protected static readonly MessagePackSerializerOptions CompressionOptions
    Field Value
    Type Description
    MessagePackSerializerOptions
    Remarks
    Do not make this option object private, since it is used by the JIT generated sub types.

    Frame

    Declaration
    protected DataFrame Frame
    Field Value
    Type Description
    DataFrame

    Properties

    DateTime

    Specifies the current realtime reference
    Declaration
    public virtual DateTime? DateTime { get; set; }
    Property Value
    Type Description
    System.Nullable<DateTime>

    Entity

    The associated entity model object (either an agent or a layer) Is refined implemented in IGeneratedEntityLogger.
    Declaration
    public virtual TModel Entity { get; set; }
    Property Value
    Type Description
    TModel

    Id

    Gets the Id of the entity which is cared by this mapping proxy
    Declaration
    public Guid Id { get; set; }
    Property Value
    Type Description
    Guid

    IdString

    Gets the id as a string of this entity
    Declaration
    public virtual string IdString { get; set; }
    Property Value
    Type Description
    System.String

    RId

    Represents the identity column for relational mapping
    Declaration
    public virtual long RId { get; set; }
    Property Value
    Type Description
    System.Int64
    Remarks
    This property is not intended to be used from outside.

    Step

    Specifies the current step of this mapper
    Declaration
    public virtual long Step { get; set; }
    Property Value
    Type Description
    System.Int64

    Tick

    Specifies the current tick of this mapper
    Declaration
    public virtual long Tick { get; set; }
    Property Value
    Type Description
    System.Int64

    Methods

    Initialize()

    Performs a deferred initialization of this entity-specific mapper. This makes it possible to assign properties with values before (e.g., the concrete entity ).
    Declaration
    public override void Initialize()
    Overrides
    AbstractJitMapper.Initialize()
    Remarks
    This method should always be used when something have to be implemented within the constructor scope.

    IsSerializable()

    Checks for the current instance, based on precondition whether this instance shall be persisted or not.
    Declaration
    public virtual 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 SerializeToFrame() 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
    public abstract byte[] Serialize()
    Returns
    Type Description
    System.Byte[] A array in format

    Serialize(Stream)

    Serialize the output properties of the associated entity instance into format similar to and pass it directly into a stream (e.g. Kafka, or WebSocket) with no intermediate overhead. Consumer of this stream the shall be aware that they need to deserialize it explicitly according to the specification.
    Declaration
    public abstract void Serialize(Stream stream)
    Parameters
    Type Name Description
    Stream stream The stream to pass the packed frame of the output properties.

    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 SerializeToFrame() 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
    public abstract byte[] SerializeCompressed()
    Returns
    Type Description
    System.Byte[] A array in format compressed by the LZ4 algorithm.

    SerializeCompressed(Stream)

    Serialize the output properties of the associated entity instance into a LZ4 compression similar to and pass it directly into a stream (e.g. Kafka, or WebSocket) with no intermediate overhead. Consumer of this stream the shall be aware that they need to deserialize it explicitly according to the specification.
    Declaration
    public abstract void SerializeCompressed(Stream stream)
    Parameters
    Type Name Description
    Stream stream The stream to pass the compressed frame of the output properties.
    Remarks
    When the JSON output shall used, an extra LZ4 decompression step have first to be applied.

    SerializeProperties()

    Serialize the values of all output properties by returning the actual value as an iterator.
    Declaration
    public abstract 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
    public abstract IEnumerable<object> SerializePropertyValues()
    Returns
    Type Description
    IEnumerable<System.Object> Returns an iterator containing each output property value.

    SerializeToDocument()

    Serialize this instance of the proxy with the corresponding output properties described in into a MongoDb conforming which is reused for each tick.
    Declaration
    public virtual BsonDocument SerializeToDocument()
    Returns
    Type Description
    BsonDocument

    SerializeToFrame()

    Generates a full-state message of this simulation object in form of new created DataFrame object. This contains the spatial and temporal reference as well as all active output properties of this agent type.
    Declaration
    public virtual DataFrame SerializeToFrame()
    Returns
    Type Description
    DataFrame A JSON-compliant output for all agent states.

    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
    public abstract string SerializeToJson()
    Returns
    Type Description
    System.String A JSON formatted string of all output properties for the associated agent.

    SerializeToJsonCompressed()

    Serialize the output properties to L4Z compressed JSON document. Based on the output configuration , in default case, this DOES NOT include the property names as keys.
    Declaration
    public abstract string SerializeToJsonCompressed()
    Returns
    Type Description
    System.String A JSON formatted string of all output properties for the associated agent.
    Remarks
    When the JSON output shall used, an extra LZ4 decompression step have first to be applied.

    SerializeValueFor(String)

    Serializes the value for the given propertyName or returns null otherwise.
    Declaration
    public abstract object SerializeValueFor(string propertyName)
    Parameters
    Type Name Description
    System.String propertyName The property to access.
    Returns
    Type Description
    System.Object Returns the value or null when the property is not available.

    Implements

    IGeneratedLogger<TModel>
    IOutputLogger
    Back to top Copyright © MARS GROUP.
    HAW Hamburg