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 <Config.hpp>
\r
28 class NullPointerException;
\r
29 class FileNotFoundException;
\r
30 class InvalidArgumentException;
\r
31 class LogicException;
\r
34 // Environment class wrapper declaration
\r
35 class SIMGRIDX_EXPORT Environment
\r
39 /*! \brief Default constructor.
\r
43 /*! \brief Copy constructor.
\r
45 Environment(const Environment& rEnvironment);
\r
47 /*! \brief Constructor.
\r
49 * \param file The xml file describing the environment of the simulation.
\r
51 * \exception If this constructor fails, it throws one of the exception
\r
54 * [NullPointerException] if the parameter file is NULL.
\r
56 * [FileNotFoundException] if the file is not found.
\r
58 Environment(const char* file)
\r
59 throw(NullPointerException, FileNotFoundException);
\r
61 /*! \brief Destructor.
\r
63 virtual ~Environment();
\r
67 /*! brief Environment::load() - Load the environment of a simulation.
\r
69 * \exception If this method fails, it throws the exception described below:
\r
71 * [LogicException] if the file of the environment is not yet specified or
\r
72 * if the environment is already loaded.
\r
75 throw(LogicException);
\r
77 /*! \brief Environment::load() - Load the environment of a simulation.
\r
79 * \param file The xml file describing the environment of the simulation.
\r
81 * \exception If this method fails, it throws one of the exceptions described below.
\r
83 * [NullPointerException] if the parameter file is NULL.
\r
85 * [FileNotFoundException] if the specified file is not found.
\r
87 * [LogicException] if the environment is already loaded.
\r
89 void load(const char* file)
\r
90 throw(NullPointerException, FileNotFoundException, LogicException);
\r
92 /*! \brief Environment::isLoaded() - Tests if an environment is loaded.
\r
94 * \return If the environment is loaded, the method returns true. Otherwise the method
\r
97 bool isLoaded(void) const;
\r
100 /*! \brief Environment::setFile() - Sets the xml file of the environment.
\r
102 * \param file The file describing the environment.
\r
104 * \exception If the method fails, it throws one of the exceptions described below:
\r
106 * [NullPointerException] if the parameter file is NULL.
\r
108 * [FileNotFoundException] if the file is not found.
\r
110 * [LogicException] if the environment is already loaded.
\r
112 void setFile(const char* file)
\r
113 throw(NullPointerException, FileNotFoundException, LogicException);
\r
115 /*! \brief Environment::getFile() - Gets the xml file environment description.
\r
117 * \return The xml file describing the environment.
\r
120 const char* getFile(void) const;
\r
124 /*! \brief Assignment operator.
\r
126 * \exception If this operator fails, it throws the exception described below:
\r
128 * [LogicException] if you try to assign a loaded environment.
\r
130 const Environment& operator = (const Environment& rEnvironment)
\r
131 throw(LogicException);
\r
137 // the xml file which describe the environment of the simulation.
\r
140 // flag : is true the environment of the simulation is loaded.
\r
145 } // namespace SimGrid
\r
148 #endif // !MSG_ENVIRONMENT_HPP