/src/tools/configuration/etc/liberty_etc_version_constraint.e

http://github.com/tybor/Liberty · Specman e · 53 lines · 32 code · 7 blank · 14 comment · 1 complexity · e58bf44b083493e719096bfb0b313e82 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_ETC_VERSION_CONSTRAINT
  16. inherit
  17. LIBERTY_ETC_CONSTRAINT
  18. create {LIBERTY_ETC_VISITOR_IMPL}
  19. make
  20. feature {ANY}
  21. check_validity (a_cluster: LIBERTY_ETC_CLUSTER) is
  22. do
  23. if not operator.item([a_cluster.version, version]) then
  24. std_error.put_line("*** Version mismatch: " + a_cluster.name
  25. + " version " + a_cluster.version + " not compatible")
  26. die_with_code(1)
  27. end
  28. end
  29. feature {}
  30. make (a_operator: like operator; a_version: like version) is
  31. require
  32. a_operator /= Void
  33. a_version /= Void
  34. do
  35. operator := a_operator
  36. version := a_version
  37. ensure
  38. operator = a_operator
  39. version = a_version
  40. end
  41. operator: PREDICATE[TUPLE[FIXED_STRING, FIXED_STRING]]
  42. version: FIXED_STRING
  43. invariant
  44. operator /= Void
  45. version /= Void
  46. end