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 <InvalidArgumentException.hpp>
\r
25 #include <LogicException.hpp>
\r
26 #include <MsgException.hpp>
\r
32 class NullPointerException;
\r
33 class FileNotFoundException;
\r
34 class InvalidArgumentException;
\r
35 class LogicException;
\r
38 // Environment class wrapper declaration
\r
39 class SIMGRIDX_EXPORT Environment
\r
43 /*! \brief Default constructor.
\r
47 /*! \brief Copy constructor.
\r
49 Environment(const Environment& rEnvironment);
\r
51 /*! \brief Constructor.
\r
53 * \param file The xml file describing the environment of the simulation.
\r
55 * \exception If this constructor fails, it throws one of the exception
\r
58 * [NullPointerException] if the parameter file is NULL.
\r
60 * [FileNotFoundException] if the file is not found.
\r
62 Environment(const char* file)
\r
63 throw(NullPointerException, FileNotFoundException);
\r
65 /*! \brief Destructor.
\r
67 virtual ~Environment();
\r
71 /*! brief Environment::load() - Load the environment of a simulation.
\r
73 * \exception If this method fails, it throws the exception described below:
\r
75 * [LogicException] if the file of the environment is not yet specified or
\r
76 * if the environment is already loaded.
\r
79 throw(LogicException);
\r
81 /*! \brief Environment::load() - Load the environment of a simulation.
\r
83 * \param file The xml file describing the environment of the simulation.
\r
85 * \exception If this method fails, it throws one of the exceptions described below.
\r
87 * [NullPointerException] if the parameter file is NULL.
\r
89 * [FileNotFoundException] if the specified file is not found.
\r
91 * [LogicException] if the environment is already loaded.
\r
93 void load(const char* file)
\r
94 throw(NullPointerException, FileNotFoundException, LogicException);
\r
96 /*! \brief Environment::isLoaded() - Tests if an environment is loaded.
\r
98 * \return If the environment is loaded, the method returns true. Otherwise the method
\r
101 bool isLoaded(void) const;
\r
104 /*! \brief Environment::setFile() - Sets the xml file of the environment.
\r
106 * \param file The file describing the environment.
\r
108 * \exception If the method fails, it throws one of the exceptions described below:
\r
110 * [NullPointerException] if the parameter file is NULL.
\r
112 * [FileNotFoundException] if the file is not found.
\r
114 * [LogicException] if the environment is already loaded.
\r
116 void setFile(const char* file)
\r
117 throw(NullPointerException, FileNotFoundException, LogicException);
\r
119 /*! \brief Environment::getFile() - Gets the xml file environment description.
\r
121 * \return The xml file describing the environment.
\r
124 const char* getFile(void) const;
\r
128 /*! \brief Assignment operator.
\r
130 * \exception If this operator fails, it throws the exception described below:
\r
132 * [LogicException] if you try to assign a loaded environment.
\r
134 const Environment& operator = (const Environment& rEnvironment)
\r
135 throw(LogicException);
\r
141 // the xml file which describe the environment of the simulation.
\r
144 // flag : is true the environment of the simulation is loaded.
\r
149 } // namespace SimGrid
\r
152 #endif // !MSG_ENVIRONMENT_HPP
\r