|
// VB
Namespace demo.arrays.MyServerPackage
'
' Helper class for : servers
'
' @author TomORB VB Native Compiler 1.0rc1
'
Public Class serversHelper
'
' Insert servers into an any
' param name="a" an any
' param name="t" servers value
'
Public Shared Sub Insert(a As Org.Omg.CORBA.Any, t As demo.arrays.MyServer())
a.Type(Type())
Write(a.Create_Output_Stream(),t)
End Sub
'
' Extract servers from an any
' @param a an any
' @return the extracted servers value
'
Public Shared Function Extract(a As Org.Omg.CORBA.Any) As demo.arrays.MyServer()
If Not(a.Type().Equal(Type())) Then
Throw New Org.Omg.CORBA.MARSHAL()
End If
Return Read(a.Create_Input_Stream())
End Function
'
' Internal TypeCode value
'
Private Shared _tc As Org.Omg.CORBA.TypeCode = Nothing
'
' Return the servers TypeCode
' @return a TypeCode
'
Public Shared Function Type() As Org.Omg.CORBA.TypeCode
If _tc Is Nothing Then
Dim orb As Org.Omg.CORBA.ORB = Org.Omg.CORBA.ORB.Init()
_tc = orb.Create_Alias_TC(Id(),"servers",orb.Create_Array_TC(
Convert.ToUInt32(2), demo.arrays.MyServerHelper.Type()))
End If
Return _tc
End Function
'
' Return the servers IDL ID
' @return an ID
'
Public Shared Function Id() As String
Return _id
End Function
Private Shared _id As String = "IDL:demo/arrays/MyServer/servers:1.0"
'
' Read servers from a marshalled stream
' @param istream the input stream
' @return the readed servers value
'
Public Shared Function Read(istream As Org.Omg.CORBA.Portable.InputStream)
As demo.arrays.MyServer()
Dim new_one As demo.arrays.MyServer()
Dim size2 As Integer = 1
new_one = New demo.arrays.MyServer(size2){}
Dim i2 As Integer
For i2=0 To new_one.Length-1
new_one(i2) = demo.arrays.MyServerHelper.Read(istream)
Next
Return new_one
End Function
'
' Write servers into a marshalled stream
' @param ostream the output stream
' @param value servers value
'
Public Shared Sub Write(ostream As Org.Omg.CORBA.Portable.OutputStream,
value As demo.arrays.MyServer())
If value.Length <> 2 Then
Throw New Org.Omg.CORBA.MARSHAL()
End If
Dim i2 As Integer
For i2= 0 To value.Length-1
demo.arrays.MyServerHelper.Write(ostream,value(i2))
Next
End Sub
End Class
End Namespace
|