/src/tools/semantics/tags/liberty_typed_tag.e

http://github.com/tybor/Liberty · Specman e · 56 lines · 33 code · 9 blank · 14 comment · 0 complexity · 9b2d6b16836fec07138c9babff3a279e MD5 · raw file

  1. -- This file is part of Liberty Eiffel.
  2. --
  3. -- Liberty Eiffel is free software: you can redistribute it and/or modify
  4. -- it under the terms of the GNU General Public License as published by
  5. -- the Free Software Foundation, version 3 of the License.
  6. --
  7. -- Liberty Eiffel is distributed in the hope that it will be useful,
  8. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. -- GNU General Public License for more details.
  11. --
  12. -- You should have received a copy of the GNU General Public License
  13. -- along with Liberty Eiffel. If not, see <http://www.gnu.org/licenses/>.
  14. --
  15. class LIBERTY_TYPED_TAG[T_]
  16. inherit
  17. LIBERTY_TAG
  18. create {LIBERTY_TAG_REF}
  19. make
  20. feature {ANY}
  21. id: FIXED_STRING is
  22. do
  23. Result := ref.id
  24. end
  25. value: T_
  26. feature {LIBERTY_TAG_REF}
  27. set (a_value: like value) is
  28. do
  29. value := a_value
  30. ensure
  31. value = a_value
  32. end
  33. feature {}
  34. make (a_ref: like ref; a_value: like value) is
  35. require
  36. a_ref /= Void
  37. do
  38. ref := a_ref
  39. value := a_value
  40. ensure
  41. ref = a_ref
  42. value = a_value
  43. end
  44. ref: LIBERTY_TAG_REF[T_]
  45. invariant
  46. ref /= Void
  47. end