/tutorial/plugin/external_type/unsigned_int_wrapper.e

http://github.com/tybor/Liberty · Specman e · 47 lines · 37 code · 7 blank · 3 comment · 0 complexity · c28bc144e8d65d6f992624bf71a962d0 MD5 · raw file

  1. expanded class UNSIGNED_INT_WRAPPER
  2. external "plug_in"
  3. alias "{
  4. location: "."
  5. module_name: "plugin"
  6. type_name: "unsigned_int"
  7. default_value: "unsigned_int_default"
  8. }"
  9. creation {ANY}
  10. default_create, from_integer_64
  11. feature {ANY}
  12. as_integer_64: INTEGER_64 is
  13. do
  14. Result := to_integer_64(Current)
  15. end
  16. feature {}
  17. from_integer_64 (value: INTEGER_64) is
  18. do
  19. set_from_integer_64(Current, value)
  20. end
  21. to_integer_64 (c: like Current): INTEGER_64 is
  22. external "plug_in"
  23. alias "{
  24. location: "."
  25. module_name: "plugin"
  26. feature_name: "unsigned_int_cast"
  27. }"
  28. end
  29. set_from_integer_64 (c: like Current; value: INTEGER_64) is
  30. -- This uses a macro to walk around expanded types'
  31. -- paas-by-value convention. It only works if c actually
  32. -- /is/ Current.
  33. external "plug_in"
  34. alias "{
  35. location: "."
  36. module_name: "plugin"
  37. feature_name: "unsigned_int_set"
  38. }"
  39. end
  40. end