Beispiel #1
0
 public void GenerateCSharpAgrgumentById(LrpStream stream)
 {
     if (this.Direction == ParameterDirection.InOut)
     {
         stream.Write("ref ");
     }
     else if (this.Direction == ParameterDirection.Out)
     {
         stream.Write("out ");
     }
     stream.Write("arg{0}", this.Id);
 }
Beispiel #2
0
 public void GenerateCSharpSignature(DataTypes types, LrpStream stream)
 {
     if (this.Direction == ParameterDirection.InOut)
     {
         stream.Write("ref ");
     }
     else if (this.Direction == ParameterDirection.Out)
     {
         stream.Write("out ");
     }
     stream.Write("{0} {1}", types.ToCSharpFullName(this.Type), this.Name);
 }
Beispiel #3
0
 public void GenerateCppSignature(DataTypes types, LrpStream stream)
 {
     if (this.Direction == ParameterDirection.InOut || this.Direction == ParameterDirection.Out)
     {
         stream.Write("{0}& {1}", types.ToCppFullName(this.Type), this.Name);
     }
     else if (this.Type == EmbeddedDataTypes.LocalPointer || this.Type == EmbeddedDataTypes.RemotePointer)
     {
         stream.Write("{0} {1}", types.ToCppFullName(this.Type), this.Name);
     }
     else
     {
         stream.Write("const {0}& {1}", types.ToCppFullName(this.Type), this.Name);
     }
     
 }
Beispiel #4
0
 public void GenerateCppHeaderWriter(DataTypes types, LrpStream stream)
 {
     var cppType = types.ToCppFullName(this.Type);
     stream.Write("const {0}& {1}", cppType, this.Name);
 }
Beispiel #5
0
 public void GenerateCppServerRequest(DataTypes types, LrpStream stream)
 {
     var type = this.Type;
     stream.BeginLine();
     if (type == EmbeddedDataTypes.Raw)
         stream.Write("auto& arg{0} = ", this.Id);
     else
         stream.Write("auto arg{0} = ", this.Id);
     
     if (this.Direction == ParameterDirection.In || this.Direction == ParameterDirection.InOut)
     {
         stream.Write("Read{0}(buffer);", this.Type.Suffix);
     }
     else if (this.Direction == ParameterDirection.Out)
     {
         if (type != EmbeddedDataTypes.LocalPointer && type != EmbeddedDataTypes.RemotePointer)
         {
             stream.Write("{0}();", types.ToCppFullName(this.Type));
         }
         else
         {
             stream.Write("(void*)nullptr;");
         }
     }
     stream.EndLine();
 }
Beispiel #6
0
 public void GenerateCSharpSignatureReader(LrpStream stream, DataTypes types)
 {
     var typeFullname = types.ToCSharpFullName(this.Type);
     stream.Write("{0} {1}", typeFullname, this.Name);
 }
Beispiel #7
0
 public void GenerateCSharpServerRequest(DataTypes types, LrpStream stream)
 {
     var type = this.Type;
     stream.BeginLine();
     stream.Write("var arg{0} = ", this.Id);
     if (this.Direction == ParameterDirection.In || this.Direction == ParameterDirection.InOut)
     {
         stream.Write("buffer.Read{0}();", this.Type.Suffix);
     }
     else if (this.Direction == ParameterDirection.Out)
     {
         if (type == EmbeddedDataTypes.LocalPointer)
         {
             stream.Write("Lptr.Zero;");
         }
         else if (type == EmbeddedDataTypes.RemotePointer)
         {
             stream.Write("Rptr.Zero;");
         }
         else
         {
             stream.Write("default({0});", types.ToCSharpFullName(this.Type));
         }
     }
     stream.EndLine();
 }