From: <dav...@di...> - 2012-05-17 15:23:14
|
As discussed yesterday, here's a fuller version of what I was proposing . The proposals at SLAC for normative type identification were 1) Encode the normative type in the value data. E.g. an extra string field in the structure called _NTYPE . The type is encoded by the value of the string in the data. Or instead a numeric code. 2) Encode the type in the introspection data. E.g. type is encoded in the name of field in some fashion. We didn't pin down how. 3) Pass the normative type info in the connection (but there was a question as to whether this was possible). I really didn't like option 1 because the normative type should I think be encoded in introspection data rather than value data because it's fundamentally a question of identifying its type and not its value. What I suggested yesterday is that we reserve a fieldname, e.g. _TYPE (possibly we reserve all names prefixed _). Normative types then has a structure containing one field, the name of the field is a string encoding the type. A recipient of a structure of unknown type can get the structure with fieldname _TYPE and get the fieldname of its one field. I suggested that the type of the field in structure should be something small to stop the size of the value data increasing, e.g. a byte or boolean. (It occurs to me it could instead be a struct with no fields at no overhead to the value data, but with a slightly higher overhead in the introspection data and objects created.) I would reserve field names in the _TYPE struct prefixed with, say, NT_. This gives us a namespace in which to come up with what we think are a good and full set of types, but allows any institution to implement their own types (as long as they stay out of our namespace) and to use the same mechanism if they want. For that reason I prefer _TYPE to _NTYPE, although that's not, I guess, a big deal. So it would look like this: structure NTScalar structure _TYPE structure/boolean/byte* NT_SCALAR scalar_t value * = we chose which we prefer. Dave. Dr David Hickin Software Systems Engineer (EPICS) Diamond Light Source Ltd Diamond House Harwell Science & Innovation Campus Didcot, Oxfordshire, OX11 0DE -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom |