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
32 // Environment class wrapper declaration
\r
37 /*! \brief Default constructor.
\r
41 /*! \brief Copy constructor.
\r
43 Environment(const Environment& rEnvironment);
\r
45 /*! \brief Constructor.
\r
47 * \param file The xml file describing the environment of the simulation.
\r
49 * \exception If this constructor fails, it throws one of the exception
\r
52 * [NullPointerException] if the parameter file is NULL.
\r
54 * [FileNotFoundException] if the file is not found.
\r
56 Environment(const char* file)
\r
57 throw(NullPointerException, FileNotFoundException);
\r
59 /*! \brief Destructor.
\r
61 virtual ~Environment();
\r
65 /*! brief Environment::load() - Load the environment of a simulation.
\r
67 * \exception If this method fails, it throws the exception described below:
\r
69 * [LogicException] if the file of the environment is not yet specified or
\r
70 * if the environment is already loaded.
\r
73 throw(LogicException);
\r
75 /*! \brief Environment::load() - Load the environment of a simulation.
\r
77 * \param file The xml file describing the environment of the simulation.
\r
79 * \exception If this method fails, it throws one of the exceptions described below.
\r
81 * [NullPointerException] if the parameter file is NULL.
\r
83 * [FileNotFoundException] if the specified file is not found.
\r
85 * [LogicException] if the environment is already loaded.
\r
87 void load(const char* file)
\r
88 throw(NullPointerException, FileNotFoundException, LogicException);
\r
90 /*! \brief Environment::isLoaded() - Tests if an environment is loaded.
\r
92 * \return If the environment is loaded, the method returns true. Otherwise the method
\r
95 bool isLoaded(void) const;
\r
98 /*! \brief Environment::setFile() - Sets the xml file of the environment.
\r
100 * \param file The file describing the environment.
\r
102 * \exception If the method fails, it throws one of the exceptions described below:
\r
104 * [NullPointerException] if the parameter file is NULL.
\r
106 * [FileNotFoundException] if the file is not found.
\r
108 * [LogicException] if the environment is already loaded.
\r
110 void setFile(const char* file)
\r
111 throw(NullPointerException, FileNotFoundException, LogicException);
\r
113 /*! \brief Environment::getFile() - Gets the xml file environment description.
\r
115 * \return The xml file describing the environment.
\r
118 const char* getFile(void) const;
\r
122 /*! \brief Assignment operator.
\r
124 * \exception If this operator fails, it throws the exception described below:
\r
126 * [LogicException] if you try to assign a loaded environment.
\r
128 const Environment& operator = (const Environment& rEnvironment)
\r
129 throw(LogicException);
\r
135 // the xml file which describe the environment of the simulation.
\r
138 // flag : is true the environment of the simulation is loaded.
\r
143 } // namespace SimGrid
\r
146 #endif // !MSG_ENVIRONMENT_HPP