Logo AND Algorithmique Numérique Distribuée

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