Imports Microsoft.VisualBasic.ComponentModel.Collection.Generic
Imports Microsoft.VisualBasic.Scripting.MetaData
Imports Microsoft.VisualBasic.Serialization
Namespace SharedMemory
'''
''' The shared variable on the remote machine.
'''
Public Class HashValue : Implements sIdEnumerable
'''
''' The variable name
'''
'''
Public Property Identifier As String Implements sIdEnumerable.Identifier
'''
''' variable value
'''
'''
Public Property value As Object
'''
''' Simple type information
'''
'''
Public Property Type As TypeInfo
Sub New(name As String, x As Object)
Identifier = name
value = x
Type = New TypeInfo(x.GetType)
End Sub
'''
''' Json serialization for the network transfer.
'''
'''
Public Function GetValueJson() As String
Return JsonContract.GetJson(value, Type.GetType(True))
End Function
Public Overrides Function ToString() As String
Return $"Dim {Identifier} As {Type.ToString} = {JsonContract.GetJson(value, Type.GetType(True))}"
End Function
End Class
'''
''' Variable value for the network transfer
'''
Public Structure Argv : Implements sIdEnumerable
'''
''' The variable name
'''
'''
Public Property Identifier As String Implements sIdEnumerable.Identifier
'''
''' Json value, and the type information is also included in this property.
'''
'''
Public Property value As TaskHost.Argv
Sub New(name As String, x As Object)
Identifier = name
value = New TaskHost.Argv(x)
End Sub
Public Overrides Function ToString() As String
Return Me.GetJson
End Function
End Structure
End Namespace