ContextData.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*!
  2. * \file ContextData.h
  3. * \brief Stocke les données du fichier context.
  4. * \author The VLE Development Team
  5. * See the AUTHORS or Authors.txt file
  6. * \version 2.0
  7. */
  8. /*
  9. * Copyright (C) 2012-2013 ULCO http://www.univ-littoral.fr
  10. * Copyright (C) 2012-2013 INRA http://www.inra.fr
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation, either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. #ifndef CONTEXTDATA_H_
  26. #define CONTEXTDATA_H_
  27. #include <string>
  28. #include "Singleton.h"
  29. /*! \class ContextData
  30. *
  31. * \brief regroupe les données du fichier context.
  32. *
  33. */
  34. class ContextData : public Singleton<ContextData>
  35. {
  36. friend class Singleton<ContextData>;
  37. public :
  38. /**
  39. * \struct mesh_chrono_t
  40. * \brief structure pour gestion des sorties.
  41. */
  42. struct mesh_chrono_t
  43. {
  44. int line; /*!< numéro de ligne */
  45. int column; /*!< numéro de colonne */
  46. FILE * ptf; /*!< pointeur vers fichier sorties */
  47. mesh_chrono_t() : line(0), column(0), ptf(NULL) {}
  48. };
  49. typedef int day_t ;
  50. /**
  51. * \struct date_t
  52. * \brief structure pour représentation des dates.
  53. */
  54. struct date_t
  55. {
  56. unsigned day; /*!< numéro jour */
  57. unsigned month; /*!< numéro mois */
  58. unsigned year; /*!< numéro année */
  59. date_t():day(0), month(0),year(0) {}
  60. };
  61. std::string _pathToData; /*!< chemin vers le répertoire contenant les fichiers de données */
  62. int _soilNumber; /*!< numéro de la couche sur laquelle on travaille */
  63. char * _absolutePath; /*!< chemin absolu vers le répertoire principal d'un projet TNT */
  64. double _defaultNetworkSlope; /*!< pente par défaut du réseau */
  65. std::string _soilFileName; /*!< nom du fichier de couches */
  66. double _pptionAccess; /*!< prop_acces_eau */
  67. mesh_chrono_t _outletsCoordinates[15]; /*!< Coordonnées exutoire */
  68. day_t _numberDays; /*!< Durée en jours de la simulation */
  69. date_t _simulationStartDate; /*!< Date du premier jour */
  70. private :
  71. /*!
  72. * \brief Constructeur
  73. *
  74. * Constructeur de la classe ContextData.
  75. *
  76. * Initialise les attributs.
  77. *
  78. */
  79. ContextData()
  80. {
  81. _soilNumber = 0;
  82. _absolutePath = NULL;
  83. _defaultNetworkSlope = 0.;
  84. _pptionAccess = 0.;
  85. _numberDays = 0;
  86. }
  87. /*!
  88. * \brief Destructeur
  89. *
  90. * Destructeur de la classe ContextData
  91. */
  92. ~ContextData(){}
  93. };
  94. #endif /* CONTEXTDATA_H_ */