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 <NullPointerException.hpp>
\r
23 #include <FileNotFoundException.hpp>
\r
24 #include <LogicException.hpp>
\r
25 #include <MsgException.hpp>
\r
31 // Application wrapper class declaration.
\r
32 class SIMGRIDX_EXPORT Application
\r
36 /*! \brief Default constructor.
\r
40 /*! \brief Copy constructor.
\r
42 Application(const Application& rApplication);
\r
44 /* \brief A constructor which takes as parameter the xml file of the application.
\r
46 * \exception If this constructor fails, it throws on of the exceptions described
\r
49 * [NullPointerException] if the parameter file is NULL.
\r
51 * [FileNotFoundException] if the file is not found.
\r
53 Application(const char* file)
\r
54 throw(NullPointerException, FileNotFoundException);
\r
56 /*! \brief Destructor.
\r
58 virtual ~Application();
\r
62 /*! \brief Application::deploy() - deploy the appliction.
\r
64 * \exception If this method fails, it throws an exception listed below:
\r
66 * \exception [LogicException] if the xml file which describes the application
\r
67 * is not yet specified or if the application is already
\r
69 * [MsgException] if a internal exception occurs.
\r
71 * \remark Before use this method, you must specify the xml file of the application to
\r
74 * \see Application::setFile()
\r
78 throw(LogicException, MsgException);
\r
80 /*! \brief Application::deploy() - Deploy the appliction.
\r
82 * \return If successfuly the application is deployed. Otherwise
\r
83 * the method throws an exception listed below.
\r
85 * \exception [NullPointerException] if the parameter file is NULL.
\r
87 * [FileNotFoundException] if the file is not found.
\r
89 * [MsgException] if a internal exception occurs.
\r
91 * [LogicException] if the application is already deployed.
\r
95 void deploy(const char* file)
\r
96 throw(NullPointerException, FileNotFoundException, LogicException, MsgException);
\r
98 /*! \brief Application::isDeployed() - Tests if the application is deployed.
\r
100 * \return This method returns true is the application is deployed.
\r
101 * Otherwise the method returns false.
\r
103 bool isDeployed(void) const;
\r
108 /*! \brief Application::setFile() - this setter sets the value of the file of the application.
\r
110 * \exception If this method fails, it throws on of the exceptions listed below:
\r
112 * [NullPointerException] if the parameter file is NULL.
\r
114 * [FileNotFoundException] if the file is not found.
\r
116 * [LogicException] if you try to set the value of the file of an
\r
117 * application which is already deployed.
\r
119 void setFile(const char* file)
\r
120 throw (NullPointerException, FileNotFoundException, LogicException);
\r
122 /*! \brief Application::getFile() - This getter returns the name of the xml file which describes the
\r
123 * application of the simulation.
\r
125 const char* getFile(void) const;
\r
129 /*! \brief Assignement operator.
\r
131 * \exception [LogicException] if you try to assign an application already deployed.
\r
133 const Application& operator = (const Application& rApplication)
\r
134 throw(LogicException);
\r
139 // flag : if true the application was deployed.
\r
142 // the xml file which describes the application of the simulation.
\r
148 } // namespace SimGrid
\r
150 #endif // !MSG_APPLICATION_HPP
\r