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
PayloadObject
The payload object of the message
public abstract object PayloadObject { get; set; }
Property Value
PayloadType
The payload type of the message
public abstract Type PayloadType { get; }
Property Value
Methods
Clone(Message)
Clones a message from another message
public static Message Clone(Message other)
Parameters
other
MessageThe 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
TypeA 'NominalSystems.Message' type.
Returns
Exceptions
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
boolA flag whether to use units
Returns
GetPropertyValues()
Gets all the property values from the message as a string.
public List<string> GetPropertyValues()
Returns
IsTypeSupported(Type)
Returns true if the message type is supported by the simulation.
public static bool IsTypeSupported(Type type)
Parameters
type
TypeA 'NominalSystems.Message' type.
Returns
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
Returns
ToJson()
Converts the current message to a JSON string complete with the data.
public string ToJson()
Returns
- string
The JSON string