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_APPLICATION_HPP
\r
16 #define MSG_APPLICATION_HPP
\r
19 #error Application.hpp requires C++ compilation (use a .cxx suffix)
\r
22 #include <Config.hpp>
\r
28 class NullPointerException;
\r
29 class FileNotFoundException;
\r
30 class LogicException;
\r
33 // Application wrapper class declaration.
\r
34 class SIMGRIDX_EXPORT Application
\r
38 /*! \brief Default constructor.
\r
42 /*! \brief Copy constructor.
\r
44 Application(const Application& rApplication);
\r
46 /* \brief A constructor which takes as parameter the xml file of the application.
\r
48 * \exception If this constructor fails, it throws on of the exceptions described
\r
51 * [NullPointerException] if the parameter file is NULL.
\r
53 * [FileNotFoundException] if the file is not found.
\r
55 Application(const char* file)
\r
56 throw(NullPointerException, FileNotFoundException);
\r
58 /*! \brief Destructor.
\r
60 virtual ~Application();
\r
64 /*! \brief Application::deploy() - deploy the appliction.
\r
66 * \exception If this method fails, it throws an exception listed below:
\r
68 * \exception [LogicException] if the xml file which describes the application
\r
69 * is not yet specified or if the application is already
\r
71 * [MsgException] if a internal exception occurs.
\r
73 * \remark Before use this method, you must specify the xml file of the application to
\r
76 * \see Application::setFile()
\r
80 throw(LogicException, MsgException);
\r
82 /*! \brief Application::deploy() - Deploy the appliction.
\r
84 * \return If successfuly the application is deployed. Otherwise
\r
85 * the method throws an exception listed below.
\r
87 * \exception [NullPointerException] if the parameter file is NULL.
\r
89 * [FileNotFoundException] if the file is not found.
\r
91 * [MsgException] if a internal exception occurs.
\r
93 * [LogicException] if the application is already deployed.
\r
97 void deploy(const char* file)
\r
98 throw(NullPointerException, FileNotFoundException, LogicException, MsgException);
\r
100 /*! \brief Application::isDeployed() - Tests if the application is deployed.
\r
102 * \return This method returns true is the application is deployed.
\r
103 * Otherwise the method returns false.
\r
105 bool isDeployed(void) const;
\r
110 /*! \brief Application::setFile() - this setter sets the value of the file of the application.
\r
112 * \exception If this method fails, it throws on of the exceptions listed below:
\r
114 * [NullPointerException] if the parameter file is NULL.
\r
116 * [FileNotFoundException] if the file is not found.
\r
118 * [LogicException] if you try to set the value of the file of an
\r
119 * application which is already deployed.
\r
121 void setFile(const char* file)
\r
122 throw (NullPointerException, FileNotFoundException, LogicException);
\r
124 /*! \brief Application::getFile() - This getter returns the name of the xml file which describes the
\r
125 * application of the simulation.
\r
127 const char* getFile(void) const;
\r
131 /*! \brief Assignement operator.
\r
133 * \exception [LogicException] if you try to assign an application already deployed.
\r
135 const Application& operator = (const Application& rApplication)
\r
136 throw(LogicException);
\r
141 // flag : if true the application was deployed.
\r
144 // the xml file which describes the application of the simulation.
\r
150 } // namespace SimGrid
\r
152 #endif // !MSG_APPLICATION_HPP