Archived

This forum has been archived. Please start a new discussion on GitHub.

Does exists in slice language the UUID type?

1) As for int, long or string, slice language have a UUID type?
2) Can I define a const type for an UUID?
3) Exists a 128 bit primitive type?

Comments

  • benoit
    benoit Rennes, France
    Hi,

    There's no UUID type in Slice. However, you can easily pass a UUID with a string, a sequence of bytes or a struct depending on your needs. See here in the manual for more information on the basic types supported by Slice.

    Cheers,
    Benoit.
  • But
    1) sequence of bytes cannot be defined ad a const in slice file
    and
    2) a string is too large agaist a long pair and noisy to convert every time from client to server

    Do you have intention to introduce the UUID type?
  • bernard
    bernard Jupiter, FL
    Hi Maurizio,

    No, there is no plan to add a UUID type to Slice, or any new integer type.

    I don't understand your concern with respect to constants. What are you trying to do that can only be achieved with a Slice UUID constant? Why not use a plain C++/Java/(...) constant?

    Cheers,
    Bernard
  • Is not an important problem. I know that can be solved in other ways. It's only a style question.

    I'm using UUID as object identifiers but I don't want to serialize them as string when an UUID is simply a "long long" data.
    So I'm using a struct similar to this:

    struct OID { long msb; long lsb; };

    Now I have some special OID for some well knowed objects. I would like to add these ids in slice definition file. Becaose would be the better solution.
    But i cannot define const of my OID type in slice file.

    I know there are many way to solve that but they are not so elegant.