Пример #1
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();
 }
Пример #2
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();
 }