Table of Contents

Class Message

Namespace
NominalSystems
Assembly
NominalSystems.Core.dll

Represents the base class for all simulation messages.

public abstract class Message
Inheritance
Message
Derived

Constructors

Message()

protected Message()

Properties

ID

The message's unique identifier.

public Guid ID { get; }

Property Value

Guid

PayloadObject

The payload object of the message

public abstract object PayloadObject { get; set; }

Property Value

object

PayloadType

The payload type of the message

public abstract Type PayloadType { get; }

Property Value

Type

Methods

Clone(Message)

Clones a message from another message

public static Message Clone(Message other)

Parameters

other Message

The message to clone

Returns

Message

The cloned message

CreateInstance(Type)

Creates a new simulation message with the specified type.

public static Message CreateInstance(Type type)

Parameters

type Type

A 'NominalSystems.Message' type.

Returns

Message

Exceptions

NotSupportedException

GetMemoryUsed()

Returns the total amount of memory used by this particular message.

public int GetMemoryUsed()

Returns

int

[bytes] The total number of bytes used

GetPropertyNames(bool)

Gets all the properties from the string along with their units, formatted like 'Property [unit]'.

public List<string> GetPropertyNames(bool units = true)

Parameters

units bool

A flag whether to use units

Returns

List<string>

An array of all properties with the format

GetPropertyValues()

Gets all the property values from the message as a string.

public List<string> GetPropertyValues()

Returns

List<string>

An array of all properties with the format

IsTypeSupported(Type)

Returns true if the message type is supported by the simulation.

public static bool IsTypeSupported(Type type)

Parameters

type Type

A 'NominalSystems.Message' type.

Returns

bool

IsTypeSupported(Type, out string)

Returns true if the message type is supported by the simulation.

public static bool IsTypeSupported(Type type, out string reason)

Parameters

type Type

A 'NominalSystems.Message' type.

reason string

The reason if function returns false.

Returns

bool

ToJson()

Converts the current message to a JSON string complete with the data.

public string ToJson()

Returns

string

The JSON string