Results 1 to 2 of 2

Thread: C# byte sequence mapping

  1. #1
    kwaclaw is offline Registered User
    Name: Karl Waclawek
    Organization: Personal
    Project: Whiteboard application
    Join Date
    Sep 2004
    Location
    Oshawa, Canada
    Posts
    159

    C# byte sequence mapping

    It would be nice if the C# mapping for byte sequences could be optionally specified to map to a range within an array (similar to the C++ mapping options). That way one could avoid extra copying.

    .NET even defines the ArraySegment type, but this is not strictly required here.

    Karl
    Karl Waclawek

  2. #2
    kwaclaw is offline Registered User
    Name: Karl Waclawek
    Organization: Personal
    Project: Whiteboard application
    Join Date
    Sep 2004
    Location
    Oshawa, Canada
    Posts
    159
    Quote Originally Posted by kwaclaw View Post
    It would be nice if the C# mapping for byte sequences could be optionally specified to map to a range within an array (similar to the C++ mapping options). That way one could avoid extra copying.

    .NET even defines the ArraySegment type, but this is not strictly required here.

    Karl
    Maybe I should explain a little. The following Slice

    Code:
    interface Receiver {
      void Receive(long offset, ByteSeq data);
    };
    generates C# code like this:

    Code:
    [_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.4.1")]
    public interface ReceiverPrx : Ice.ObjectPrx
    {
        void Receive(long offset, byte[] data);
        void Receive(long offset, byte[] data, _System.Collections.Generic.Dictionary<string, string> context__);
    
        Ice.AsyncResult<KdSoftIce.Stream.Callback_Receiver_Receive> begin_Receive(long offset, byte[] data);
        Ice.AsyncResult<KdSoftIce.Stream.Callback_Receiver_Receive> begin_Receive(long offset, byte[] data, _System.Collections.Generic.Dictionary<string, string> ctx__);
    
        Ice.AsyncResult begin_Receive(long offset, byte[] data, Ice.AsyncCallback cb__, object cookie__);
        Ice.AsyncResult begin_Receive(long offset, byte[] data, _System.Collections.Generic.Dictionary<string, string> ctx__, Ice.AsyncCallback cb__, object cookie__);
    
        void end_Receive(Ice.AsyncResult r__);
    }
    It would be helpful if it would also (optionally) generate this:

    Code:
            
    public interface ReceiverPrx : Ice.ObjectPrx
    {
        ...
        void Receive(long offset, byte[] data, int start, int count);
           // or maybe
        void Receive(long offset, ArraySegment<byte> data);
        ...
    }
    Karl
    Karl Waclawek

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. sequence to set mapping
    By peter in forum Help Center
    Replies: 6
    Last Post: 10-25-2011, 03:51 PM
  2. Replies: 1
    Last Post: 01-20-2011, 09:08 AM
  3. Byte sequence zero copy with AMD in Ice 3.4x
    By lafayej in forum Help Center
    Replies: 1
    Last Post: 08-02-2010, 02:40 PM
  4. java 5 custom sequence mapping warnings
    By xdm in forum Help Center
    Replies: 1
    Last Post: 06-07-2007, 01:42 PM
  5. Questions about sequence<byte> in C++?
    By rodrigc in forum Help Center
    Replies: 3
    Last Post: 02-24-2003, 10:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •