/src/tools/configuration/etc/liberty_etc_needs.e

http://github.com/tybor/Liberty · Specman e · 73 lines · 50 code · 9 blank · 14 comment · 2 complexity · eae372ec782e6248310f1fa5f68f67ee 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_NEEDS
  16. create {LIBERTY_ETC_VISITOR_IMPL}
  17. make
  18. feature {ANY}
  19. cluster: LIBERTY_ETC_CLUSTER
  20. feature {LIBERTY_ETC_CLUSTER}
  21. check_validity (all_clusters: MAP[LIBERTY_ETC_CLUSTER, FIXED_STRING]) is
  22. require
  23. all_clusters /= Void
  24. do
  25. if cluster = Void then
  26. cluster := all_clusters.fast_reference_at(cluster_name)
  27. if cluster = Void then
  28. std_error.put_line("Unknown cluster: " + cluster_name)
  29. die_with_code(1)
  30. end
  31. else
  32. check
  33. cluster = all_clusters.fast_at(cluster_name)
  34. end
  35. end
  36. constraints.do_all(agent {LIBERTY_ETC_CONSTRAINT}.check_validity(cluster))
  37. end
  38. in_cycle: BOOLEAN
  39. set_in_cycle is
  40. do
  41. in_cycle := True
  42. ensure
  43. in_cycle
  44. end
  45. feature {}
  46. make (a_cluster_name: like cluster_name; a_cluster: like cluster; a_constraints: like constraints) is
  47. require
  48. a_cluster_name /= Void
  49. a_constraints /= Void
  50. do
  51. cluster_name := a_cluster_name
  52. cluster := a_cluster
  53. constraints := a_constraints
  54. ensure
  55. cluster_name = a_cluster_name
  56. cluster = a_cluster
  57. constraints = a_constraints
  58. end
  59. cluster_name: FIXED_STRING
  60. constraints: TRAVERSABLE[LIBERTY_ETC_CONSTRAINT]
  61. invariant
  62. cluster_name /= Void
  63. constraints /= Void
  64. end -- class LIBERTY_ETC_NEEDS