Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
last changes of cpp wrappers examples
[simgrid.git] / examples / cxx / ping_pong / PingPongTask.hpp
1 #ifndef PINGPONG_TASK_HPP
2 #define PINGPONG_TASK_HPP
3
4 #include <Task.hpp>
5 using namespace SimGrid::Msg;
6
7 class PingPongTask : public Task
8 {
9         MSG_DECLARE_DYNAMIC(PingPongTask);
10
11 public:
12
13         PingPongTask()
14         :Task(NULL, 0.0, 0.0){}
15         
16         // Default constructor.
17         PingPongTask(const char* name, double computeDuration, double messageSize)
18         throw (InvalidArgumentException, NullPointerException)
19         :Task(name, computeDuration, messageSize){}
20         
21         // Destructor
22         virtual ~PingPongTask() 
23         throw(MsgException){}
24         
25         void setTime(double timeVal)
26         {
27                 this->timeVal = timeVal;
28         }
29         
30         double getTime() 
31         {
32                 return timeVal;
33         }
34         
35 private :
36         
37         double timeVal;
38 };
39
40
41 #endif // !PINGPONG_TASK_HPP