4 * This file contains the declaration of the wrapper class of the native MSG task type.
6 * Copyright 2006,2007 Martin Quinson, Malek Cherier
9 * This program is free software; you can redistribute
10 * it and/or modify it under the terms of the license
11 *(GNU LGPL) which comes with this package.
15 #ifndef MSG_APPLICATION_HPP
16 #define MSG_APPLICATION_HPP
19 #error Application.hpp requires C++ compilation (use a .cxx suffix)
22 #include <NullPointerException.hpp>
23 #include <FileNotFoundException.hpp>
24 #include <LogicException.hpp>
25 #include <MsgException.hpp>
31 // Application wrapper class declaration.
32 class SIMGRIDX_EXPORT Application
36 /*! \brief Default constructor.
40 /*! \brief Copy constructor.
42 Application(const Application& rApplication);
44 /* \brief A constructor which takes as parameter the xml file of the application.
46 * \exception If this constructor fails, it throws on of the exceptions described
49 * [NullPointerException] if the parameter file is NULL.
51 * [FileNotFoundException] if the file is not found.
53 Application(const char* file)
54 throw(NullPointerException, FileNotFoundException);
56 /*! \brief Destructor.
58 virtual ~Application();
62 /*! \brief Application::deploy() - deploy the appliction.
64 * \exception If this method fails, it throws an exception listed below:
66 * \exception [LogicException] if the xml file which describes the application
67 * is not yet specified or if the application is already
69 * [MsgException] if a internal exception occurs.
71 * \remark Before use this method, you must specify the xml file of the application to
74 * \see Application::setFile()
78 throw(LogicException, MsgException);
80 /*! \brief Application::deploy() - Deploy the appliction.
82 * \return If successfuly the application is deployed. Otherwise
83 * the method throws an exception listed below.
85 * \exception [NullPointerException] if the parameter file is NULL.
87 * [FileNotFoundException] if the file is not found.
89 * [MsgException] if a internal exception occurs.
91 * [LogicException] if the application is already deployed.
95 void deploy(const char* file)
96 throw(NullPointerException, FileNotFoundException, LogicException, MsgException);
98 /*! \brief Application::isDeployed() - Tests if the application is deployed.
100 * \return This method returns true is the application is deployed.
101 * Otherwise the method returns false.
103 bool isDeployed(void) const;
108 /*! \brief Application::setFile() - this setter sets the value of the file of the application.
110 * \exception If this method fails, it throws on of the exceptions listed below:
112 * [NullPointerException] if the parameter file is NULL.
114 * [FileNotFoundException] if the file is not found.
116 * [LogicException] if you try to set the value of the file of an
117 * application which is already deployed.
119 void setFile(const char* file)
120 throw (NullPointerException, FileNotFoundException, LogicException);
122 /*! \brief Application::getFile() - This getter returns the name of the xml file which describes the
123 * application of the simulation.
125 const char* getFile(void) const;
129 /*! \brief Assignement operator.
131 * \exception [LogicException] if you try to assign an application already deployed.
133 const Application& operator = (const Application& rApplication)
134 throw(LogicException);
139 // flag : if true the application was deployed.
142 // the xml file which describes the application of the simulation.
148 } // namespace SimGrid
150 #endif // !MSG_APPLICATION_HPP