ModelStateWriter Class

Class for writing to state stream.

It supports optional objects and optional values. Whenever a non-optional object or value is included, all earlier optional object and values at that level and lower will be added to the stream. Objects with purely optional sub-objects and parameters will not be added to the stream.

The optional object can be used if an ancestor does not know whether a child actually contains state, so the ancestor can add itself and its parameters as optional, and only if a child has state, the ancestor values will be included.

Definition

Namespace: DHI.Mike1D.ModelState
Assembly: DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public class ModelStateWriter
Inheritance
Object    ModelStateWriter

Constructors

ModelStateWriter Constructor

Properties

Options Option objects for writer
StateTime Timestamp of state

Methods

Close Close state, and also underlying state stream.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
HandleOptionalParameter Helper method for handling optional parameters: If the parameter is optional, and the current object is optional (there is something in the list of optional objects), this parameter value is added to the list of parameters in the optional object.

If the parameter is not optional, but the current object is optional, all optional objects and parameters are added to the state.

MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Open(Stream) Create writer that writes to a stream
Open(String) Create writer that writes to a file
ToStringReturns a string that represents the current object.
(Inherited from Object)
WriteDataValue Write parameter array values to current object
WriteEndObject Closes current object
WriteOptionalObjects Write all optional objects to state stream.
WriteRelativeTime Write time for an item relative to the StateTime s.t. it can be applied to a simulation using an arbitrary start time.
WriteRelativeTimes Write time buffers for an item relative to the StateTime s.t. it can be applied to a simulation using an arbitrary start time.
WriteStartObject(String) Writes a start object tag with the specified name
WriteStartObject(String, Boolean) Adds an optional start object tag with the specified name to the list of optional objects
WriteValue(String, Boolean, Boolean) Write parameter value to current object
WriteValue(String, IEnumerableDateTime, Boolean) Write parameter array values to current object
WriteValue(String, IEnumerableDouble, Boolean) Write parameter array values to current object
WriteValue(String, IEnumerableInt32, Boolean) Write parameter array values to current object
WriteValue(String, IEnumerableString, Boolean) Write parameter array values to current object
WriteValue(String, IEnumerableTimeSpan, Boolean) Write parameter array values to current object
WriteValue(String, DateTime, Boolean) Write parameter value to current object
WriteValue(String, Double, Boolean) Write parameter value to current object
WriteValue(String, Int32, Boolean) Write parameter value to current object
WriteValue(String, Object, Boolean) Write parameter value to object
WriteValue(String, String, Boolean) Write parameter value to current object
WriteValue(String, TimeSpan, Boolean) Write parameter value to current object

Extension Methods

See Also