Class AbstractTypeMapper
Provides a base implementation of the type proxy contract in IGeneratedTypeLogger
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Mars.Core.Data.Compiler
Assembly: Mars.Core.dll
Syntax
public abstract class AbstractTypeMapper : AbstractJitMapper, IGeneratedTypeLogger, IOutputLogger
Properties
| Improve this Doc View SourceEntities
Gets all registered entities of this type manager.
Declaration
public IEnumerable<IEntity> Entities { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IEntity> |
EntityProxies
Gets all registered entity proxies which are responsible for each de/serialization process
Declaration
public IEnumerable<IGeneratedEntityLogger> EntityProxies { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IGeneratedEntityLogger> |
KeyContainer
Gets or sets the index container used to assign unique keys to all new proxies,
constructed by CreateIndividualLogger(IEntity).
Declaration
public KeyContainer KeyContainer { get; set; }
Property Value
Type | Description |
---|---|
KeyContainer |
TypeLogger
Gets or sets the type logger responsible for this proxy
Declaration
public override IGeneratedTypeLogger TypeLogger { get; set; }
Property Value
Type | Description |
---|---|
IGeneratedTypeLogger |
Overrides
Methods
| Improve this Doc View SourceCreateIndividualLogger(IEntity)
Creates an individual proxy by this type without any reflection.
Declaration
public abstract IGeneratedEntityLogger CreateIndividualLogger(IEntity entity)
Parameters
Type | Name | Description |
---|---|---|
IEntity | entity | The entity to register |
Returns
Type | Description |
---|---|
IGeneratedEntityLogger | Returns a new instanceof of the IGeneratedEntityLogger serializer with type-specific serialization functions. |
CreateInstance()
Creates a concrete instance from the managed type in this proxy without
using any reflection call.
Declaration
public abstract IEntity CreateInstance()
Returns
Type | Description |
---|---|
IEntity | Returns an instance of the entity when created, or null if creation was not possible, since missing dependencies |
DeregisterIndividual(IEntity)
DeRegisters the specified
entity
from this type manager
proxy so that no in/output is created more.
Declaration
public void DeregisterIndividual(IEntity entity)
Parameters
Type | Name | Description |
---|---|---|
IEntity | entity | The IEntity to deregister from the in/output pipeline. |
Initialize()
Performs a deferred initialization of this entity(-type) specific mapper.
This makes it possible to assign properties from outside an not during the
construction type of this JIT object (e.g., the concrete entity Type).
Declaration
public override void Initialize()
Overrides
Remarks
This method should always be used when something have to be implemented within the constructor scope.
|
Improve this Doc
View Source
IsTypeOf(IEntity)
Provides an instance of mechanism which can be used without any reflection.
Declaration
public virtual bool IsTypeOf(IEntity entity)
Parameters
Type | Name | Description |
---|---|---|
IEntity | entity | The entity to check whether the associated type is the class for this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
Returns true when the specified entity is an instance of this associated type.
|
Remarks
This method is similar to the usage of CreateIndividualLogger(IEntity)
which corresponds to the constructor call.
|
Improve this Doc
View Source
RegisterIndividual(IGeneratedEntityLogger, TypeMapping)
Registers the specified
individual
at this type manager proxy with the passed outputGroup
with the associated type of this mapper.
Declaration
public virtual void RegisterIndividual(IGeneratedEntityLogger individual, TypeMapping mapping)
Parameters
Type | Name | Description |
---|---|---|
IGeneratedEntityLogger | individual | The IGeneratedEntityLogger proxy wrapping an entity. |
TypeMapping | mapping | The type-specific configurations for this instance.. |
SerializeToFrames()
Serialize all registered entities
lazy
and converts them into a managed DataFrame.
Optional selection or transformations can be appended and will evaluated lazy.
Declaration
public IEnumerable<DataFrame> SerializeToFrames()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DataFrame> | Returns an System.Collections.Generic.IEnumerable<T> collection of managed agent frame. |
ToPropertyFrame(IEntity)
Serialize the entity to an DataFrame with the
type-specific implementation into a dictionary-based format
Declaration
public virtual DataFrame ToPropertyFrame(IEntity entity)
Parameters
Type | Name | Description |
---|---|---|
IEntity | entity | The entity |
Returns
Type | Description |
---|---|
DataFrame | Returns a new created frame object containing the snapshot of this entity. |
Remarks
The sense is to create the basic frame with all information available here in this scope
and the assign this blank-frame with the custom snapshot.
|
Improve this Doc
View Source
ToValueArray(IEntity)
Serialize this entity instance into a fix-sized array containing the snapshot of the current simulation step.
Declaration
public abstract object[] ToValueArray(IEntity agent)
Parameters
Type | Name | Description |
---|---|---|
IEntity | agent | The entity to serialize into a fix-sized array. |
Returns
Type | Description |
---|---|
System.Object[] | Returns a the array snapshot of this instance never null. |
ToValueFrame(IEntity)
Serialize the entity to an DataFrame with the
type-specific implementation into a fix array format.
Declaration
public virtual DataFrame ToValueFrame(IEntity entity)
Parameters
Type | Name | Description |
---|---|---|
IEntity | entity |
Returns
Type | Description |
---|---|
DataFrame |
Remarks
The sense is to create the basic frame with all information available here in this scope
and the assign this blank-frame with the custom snapshot.