4 * This file contains the declaration of the wrapper class of the native MSG task type.
\r
6 * Copyright 2006,2007 Martin Quinson, Malek Cherier
\r
7 * All right reserved.
\r
9 * This program is free software; you can redistribute
\r
10 * it and/or modify it under the terms of the license
\r
11 *(GNU LGPL) which comes with this package.
\r
15 #ifndef MSG_ENVIRONMENT_HPP
\r
16 #define MSG_ENVIRONMENT_HPP
\r
19 #error Environment.hpp requires C++ compilation (use a .cxx suffix)
\r
22 #include <NullPointerException.hpp>
\r
23 #include <FileNotFoundException.hpp>
\r
24 #include <LogicException.hpp>
\r
25 #include <MsgException.hpp>
\r
36 /*! \brief Default constructor.
\r
40 /*! \brief Copy constructor.
\r
42 Environment(const Environment& rEnvironment);
\r
44 /*! \brief Constructor.
\r
46 * \param file The xml file describing the environment of the simulation.
\r
48 * \exception If this constructor fails, it throws one of the exception
\r
51 * [NullPointerException] if the parameter file is NULL.
\r
53 * [FileNotFoundException] if the file is not found.
\r
55 Environment(const char* file)
\r
56 throw(NullPointerException, FileNotFoundException);
\r
58 /*! \brief Destructor.
\r
60 virtual ~Environment();
\r
64 /*! brief Environment::load() - Load the environment of a simulation.
\r
66 * \exception If this method fails, it throws the exception described below:
\r
68 * [LogicException] if the file of the environment is not yet specified or
\r
69 * if the environment is already loaded.
\r
72 throw(LogicException);
\r
74 /*! \brief Environment::load() - Load the environment of a simulation.
\r
76 * \param file The xml file describing the environment of the simulation.
\r
78 * \exception If this method fails, it throws one of the exceptions described below.
\r
80 * [NullPointerException] if the parameter file is NULL.
\r
82 * [FileNotFoundException] if the specified file is not found.
\r
84 * [LogicException] if the environment is already loaded.
\r
86 void load(const char* file)
\r
87 throw(NullPointerException, FileNotFoundException, LogicException);
\r
89 /*! \brief Environment::isLoaded() - Tests if an environment is loaded.
\r
91 * \return If the environment is loaded, the method returns true. Otherwise the method
\r
94 bool isLoaded(void) const;
\r
97 /*! \brief Environment::setFile() - Sets the xml file of the environment.
\r
99 * \param file The file describing the environment.
\r
101 * \exception If the method fails, it throws one of the exceptions described below:
\r
103 * [NullPointerException] if the parameter file is NULL.
\r
105 * [FileNotFoundException] if the file is not found.
\r
107 * [LogicException] if the environment is already loaded.
\r
109 void setFile(const char* file)
\r
110 throw(NullPointerException, FileNotFoundException, LogicException);
\r
112 /*! \brief Environment::getFile() - Gets the xml file environment description.
\r
114 * \return The xml file describing the environment.
\r
117 const char* getFile(void) const;
\r
121 /*! \brief Assignment operator.
\r
123 * \exception If this operator fails, it throws the exception described below:
\r
125 * [LogicException] if you try to assign a loaded environment.
\r
127 const Environment& operator = (const Environment& rEnvironment)
\r
128 throw(LogicException);
\r
134 // the xml file which describe the environment of the simulation.
\r
137 // flag : is true the environment of the simulation is loaded.
\r
142 } // namespace SimGrid
\r
145 #endif // !MSG_ENVIRONMENT_HPP