\r
#include <msg/datatypes.h>\r
\r
-#include <Config.hpp>\r
+#include <MsgException.hpp>\r
+#include <InvalidArgumentException.hpp>\r
+#include <NullPointerException.hpp>\r
+#include <MsgException.hpp>\r
+#include <BadAllocException.hpp>\r
\r
#include <Object.hpp>\r
\r
{\r
namespace Msg\r
{\r
- class MsgException;\r
- class InvalidArgumentException;\r
- class NullPointerException;\r
- class MsgException;\r
- class BadAllocException;\r
-\r
class Process;\r
class Host;\r
\r
{\r
MSG_DECLARE_DYNAMIC(Task);\r
\r
- friend Process;\r
- friend Host;\r
+ friend class Process;\r
+ friend class Host;\r
\r
protected:\r
// Default constructor.\r
Task();\r
-\r
- class Ref\r
- {\r
- public:\r
- Ref(Task* task)\r
- {\r
- count = 1;\r
- this->task = task;\r
- }\r
-\r
- virtual ~Ref(){}\r
-\r
- void operator++(void){\r
- count++;\r
- \r
- }\r
-\r
- void operator--(void){\r
- if(--count <= 0)\r
- delete p;\r
- }\r
-\r
- private:\r
- int count;\r
- Task* task;\r
-\r
- };\r
\r
public:\r
/*! \brief Copy constructor.\r
* \r
* [MsgException] if an internal excpetion occurs.\r
*/\r
- /*static Task& get(int channel) \r
- throw(InvalidArgumentException, MsgException);*/\r
-\r
static Task* get(int channel) \r
throw(InvalidArgumentException, MsgException);\r
\r
*\r
* [MsgException] if an internal exception occurs.\r
*/\r
- static Task& get(int channel, const Host& rHost) \r
+ static Task* get(int channel, const Host& rHost) \r
throw(InvalidArgumentException, MsgException);\r
\r
/*! \brief Task::get() - Gets a task from the specified channel of the specified host\r
* different than -1.0.\r
* [MsgException] if an internal exception occurs.\r
*/\r
- static Task& get(int channel, double timeout, const Host& rHost) \r
+ static Task* get(int channel, double timeout, const Host& rHost) \r
throw(InvalidArgumentException, MsgException); \r
\r
/*! \brief Task::probe() - Probes whether there is a waiting task on the given channel of local host.\r
*\r
* [MsgException] if an internal exception occurs.\r
*/\r
- static Task& receive(const char* alias, double timeout) \r
+ static Task* receive(const char* alias, double timeout) \r
throw(NullPointerException, InvalidArgumentException, MsgException);\r
\r
/*! \brief Task::receive() - Receives a task from the mailbox identified by a given alias located\r
*\r
* [MsgException] if an internal exception occurs.\r
*/\r
- static Task& receive(const char* alias, const Host& rHost) \r
+ static Task* receive(const char* alias, const Host& rHost) \r
throw(NullPointerException, MsgException);\r
\r
/*! \brief Task::receive() - Receives a task from the mailbox identified by a given alias located\r
*\r
* [MsgException] if an internal exception occurs.\r
*/\r
- static Task& receive(const char* alias, double timeout, const Host& rHost) \r
+ static Task* receive(const char* alias, double timeout, const Host& rHost) \r
throw(NullPointerException, InvalidArgumentException, MsgException);\r
\r
/*! \brief Task::listen() - Listen whether there is a waiting task on the mailbox \r
* alias.\r
*/\r
static int listenFromHost(const char* alias, const Host& rHost) \r
- throw(NullPointerException, MsgException);\r
+ throw(NullPointerException);\r
\r
virtual const Task& operator= (const Task& rTask);\r
\r
// Attributes.\r
\r
m_task_t nativeTask; // the native MSG task.\r
-\r
- Ref* ref;\r
};\r
\r
} // namespace Msg \r
\r
typedef Task* TaskPtr;\r
\r
-#endif // §MSG_TASK_HPP
\ No newline at end of file
+#endif // §MSG_TASK_HPP\r
+\r