Home Help Center

Does exists in slice language the UUID type?

dashiedashie Member Maurizio MerliOrganization: Università degli Studi di MilanoProject: N/A
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

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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.
  • dashiedashie Member Maurizio MerliOrganization: Università degli Studi di MilanoProject: N/A
    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?
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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
  • dashiedashie Member Maurizio MerliOrganization: Università degli Studi di MilanoProject: N/A
    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.
Sign In or Register to comment.