Re: your mail

Jayakumar Muthukumarasamy ([email protected])
Wed, 12 Apr 1995 19:00:28 -0400 (EDT)

>
> >
> > Are all standard types in IDL, standard types in MRL too? If not,
> > they will have to be, since the application mrl will have to use it. Thanks.
> >
>
> This is the MM_Any like it appears in IDL now:
> typedef struct mmany {
> MM_Type_Code type;
> double d_value;
> MM_Object o_value;
> MM_Collection c_value;
> MM_Expression e_value;
> } MM_Any;
>
> The MM_Any (and the MRL) now cover
> - the most important primitive IDL types
> - the type MM_Object
> - the type MM_Collection
> - the type MM_Expression (which for now is a CORBA::String)
>
> ------------------------------------------------------------
>
> (i) It would be easy to integrate all primitive types:
> - all numerical types and char-types are mapped to d_value
> - string is already there - it is e_value
> (ii) I see also no difficulty for enums - their values map to d_value
> (iii) I'm not sure about the strategy for complex types
> (structure, union, array, sequence). As I see it there is no way
> to bring a structure into MM_Any (equivalent to void* in C++).
>
> Would you realize a structure in the Application Model as a
> MM_Object with MM_Attributes representing the members of the
> structure? And accordingly the other complex types? So, this
> would not go into MM_Any and the MRL.
>
>

Ewald,

I noticed something in the IDL code above that is irrelevant to my
previous question. In any case, the way I am interpreting statement (i)
is that since sizeof(double) > sizeof(any primitive type), we are using
a double to store all primitive types. My guess is that things will
just get casted when they are used.

The casting will work fine, as long as we don't use CORBA. When we
are talking about distributed objects, the way an integer is encoded is
different from the way a double is encoded. So, if we store an int in
a double, and pass it around to objects in other address spaces, we probably
will not get the same value at the other end. I have a feeling this will
be a problem with the current structure. But, I may be wrong. Please, let me
know what you think about this. Thanks.

-jk