Discussion:
[eiffel_software] Re: Comparing REFLECTED_OBJECTs
boxer41a@yahoo.com [eiffel_software]
2015-09-18 17:11:09 UTC
Permalink
I just realized that I cannot say: create {REFLECTED_COPY_SEMANTICS_OBJECT} r1.make (x, 1)
because `make' is only visible to {REFLECTED_OBJECT}, so I can only get a {REFLECTED_COPY_SEMANTICS_OBJECT from a previously created {REFLECTED_REFERENCE_OBJECT}, right?


I think there are two ways to get copy semantics:
1) declare a class as expanded with "expanded class MY_CLASS...", or
2) declare an entry as expanded, as in "my_attribute: expanded NORMAL_CLASS"
Is that right?


Given an object from either of the above senarios, how do I get a REFLECTED_COPY_SEMANTICS_OBJECT? Do I use `copy_semantics_field (i)'?
If so, how do I determine if a particular field (i.e. index) meets the preconditions?
I have tried looping on `i' through the enclosing reflected object `r' with:
1) if r.is_field_statically_expanded (i) then ...
2) if r.field_type (i) = {REFLECTOR_CONSTANTS}.reference_type and then
r.is_copy_semantics_field (i) then ...

Both fail to find the expanded case #1 above. I'm not sure about case #2.


Thanks,
jjj






[Non-text portions of this message have been removed]
'Emmanuel Stapf' manus@eiffel.com [eiffel_software]
2015-09-22 05:47:44 UTC
Permalink
Hi,

It should be sufficient to do `r.field_type (i) = {REFLECTOR_CONSTANTS}.expanded_type' to
find out if a field is declared statically with an expanded type.

However r.is_field_statically_expanded (i)' should work equally well.

Regards,
Manu
-----Original Message-----
Sent: Saturday, September 19, 2015 02:11
Subject: [eiffel_software] Re: Comparing REFLECTED_OBJECTs
I just realized that I cannot say: create {REFLECTED_COPY_SEMANTICS_OBJECT}
r1.make (x, 1)
because `make' is only visible to {REFLECTED_OBJECT}, so I can only get a
{REFLECTED_COPY_SEMANTICS_OBJECT from a previously created
{REFLECTED_REFERENCE_OBJECT}, right?
1) declare a class as expanded with "expanded class MY_CLASS...", or
2) declare an entry as expanded, as in "my_attribute: expanded NORMAL_CLASS"
Is that right?
Given an object from either of the above senarios, how do I get a
REFLECTED_COPY_SEMANTICS_OBJECT? Do I use `copy_semantics_field (i)'?
If so, how do I determine if a particular field (i.e. index) meets the preconditions?
1) if r.is_field_statically_expanded (i) then ...
2) if r.field_type (i) = {REFLECTOR_CONSTANTS}.reference_type and then
r.is_copy_semantics_field (i) then ...
Both fail to find the expanded case #1 above. I'm not sure about case #2.
Thanks,
jjj
[Non-text portions of this message have been removed]
------------------------------------
------------------------------------
------------------------------------------------------------------------
Eiffel Software
http://www.eiffel.com
Customer support: http://support.eiffel.com
User group: http://groups.eiffel.com/join
------------------------------------------------------------------------
------------------------------------
Yahoo Groups Links
Loading...