#include <Task_Ex_T.h>
Inheritance diagram for ACE_Task_Ex<, ACE_MESSAGE_TYPE >:


Public Types | |
| typedef ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, ACE_SYNCH_USE > | MESSAGE_QUEUE_EX |
Public Member Functions | |
| ACE_Task_Ex (ACE_Thread_Manager *thr_mgr=0, MESSAGE_QUEUE_EX *mq=0) | |
| virtual | ~ACE_Task_Ex (void) |
| Destructor. | |
| MESSAGE_QUEUE_EX * | msg_queue (void) |
| Gets the message queue associated with this task. | |
| void | msg_queue (MESSAGE_QUEUE_EX *) |
| Sets the message queue associated with this task. | |
| int | putq (ACE_MESSAGE_TYPE *, ACE_Time_Value *timeout=0) |
| int | getq (ACE_MESSAGE_TYPE *&mb, ACE_Time_Value *timeout=0) |
| int | ungetq (ACE_MESSAGE_TYPE *, ACE_Time_Value *timeout=0) |
| int | reply (ACE_MESSAGE_TYPE *, ACE_Time_Value *timeout=0) |
| int | put_next (ACE_MESSAGE_TYPE *msg, ACE_Time_Value *timeout=0) |
| int | can_put (ACE_MESSAGE_TYPE *) |
| Tests whether we can enqueue a message without blocking. | |
| const ACE_TCHAR * | name (void) const |
| ACE_Task< ACE_SYNCH_USE > * | next (void) |
| Get next Task pointer. | |
| void | next (ACE_Task< ACE_SYNCH_USE > *) |
| Set next Task pointer. | |
| ACE_Task< ACE_SYNCH_USE > * | sibling (void) |
| Alwasy return 0. | |
| ACE_Module< ACE_SYNCH_USE > * | module (void) const |
| Return the Task's Module if there is one, else returns 0. | |
| int | flush (u_long flag=ACE_Task_Flags::ACE_FLUSHALL) |
| void | water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, size_t) |
| Manipulate watermarks. | |
| void | dump (void) const |
| Dump the state of an object. | |
Public Attributes | |
| MESSAGE_QUEUE_EX * | msg_queue_ |
| Queue of messages on the ACE_Task.. | |
| int | delete_msg_queue_ |
| 1 if should delete Message_Queue, 0 otherwise. | |
| ACE_Module< ACE_SYNCH_USE > * | mod_ |
| Back-pointer to the enclosing module. | |
| ACE_Task< ACE_SYNCH_USE > * | next_ |
| Pointer to adjacent ACE_Task. | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. | |
Private Member Functions | |
| void | operator= (const ACE_Task_Ex< _ACE_SYNCH, ACE_MESSAGE_TYPE > &) |
| ACE_Task_Ex (const ACE_Task_Ex< _ACE_SYNCH, ACE_MESSAGE_TYPE > &) | |
Friends | |
| class | ACE_Module< ACE_SYNCH_USE > |
| class | ACE_Module_Type |
Unlike ACE_Task, these class doesn't have the ability to be a part of a Stream chain. I.e. You cannot (yet) chain modules based on ACE_Task_Ex.
template class ACE_Task <ACE_SYNCH_USE, ACE_Message_Block> : public ACE_Task_Base { // put here the good old ACE_Task code };
When User (and legacy code) write ACE_Task<ACE_MT_SYNCH>, specialized ACE_Task code is in action.
Definition at line 61 of file Task_Ex_T.h.
|
|||||
|
Definition at line 66 of file Task_Ex_T.h. |
|
||||||||||||||||
|
Initialize a Task, supplying a thread manager and a message queue. If the user doesn't supply a ACE_Message_Queue pointer then we'll allocate one dynamically. Otherwise, we'll use the one passed as a parameter. |
|
||||||||||
|
Destructor.
Definition at line 69 of file Task_Ex_T.cpp. References ACE_TRACE, ACE_Task_Ex<, ACE_MESSAGE_TYPE >::delete_msg_queue_, and ACE_Task_Ex<, ACE_MESSAGE_TYPE >::msg_queue_.
00070 {
00071 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::~ACE_Task_Ex");
00072 if (this->delete_msg_queue_)
00073 delete this->msg_queue_;
00074
00075 // These assignments aren't strickly necessary but they help guard
00076 // against odd race conditions...
00077 this->delete_msg_queue_ = 0;
00078 }
|
|
||||||||||
|
|
|
||||||||||
|
Tests whether we can enqueue a message without blocking.
Definition at line 28 of file Task_Ex_T.inl. References ACE_TRACE.
00029 {
00030 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::can_put");
00031 assert (!"not implemented");
00032 return -1;
00033 }
|
|
||||||||||
|
Dump the state of an object.
Definition at line 23 of file Task_Ex_T.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, >::dump(), LM_DEBUG, and ACE_Task_Ex<, ACE_MESSAGE_TYPE >::msg_queue_.
00024 {
00025 #if defined (ACE_HAS_DUMP)
00026 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::dump");
00027 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00028 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nthr_mgr_ = %x"), this->thr_mgr_));
00029 this->msg_queue_->dump ();
00030 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("delete_msg_queue_ = %d\n"), this->delete_msg_queue_));
00031 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nflags = %x"), this->flags_));
00032 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nmod_ = %x"), this->mod_));
00033 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nnext_ = %x"), this->next_));
00034 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\ngrp_id_ = %d"), this->grp_id_));
00035 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nthr_count_ = %d"), this->thr_count_));
00036 #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
00037 this->lock_.dump ();
00038 #endif /* ACE_MT_SAFE */
00039
00040 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00041 #endif /* ACE_HAS_DUMP */
00042 }
|
|
||||||||||
|
Flush the task's queue, i.e., free all of the enqueued message blocks and releases any threads blocked on the queue. Note that if this conflicts with the C++ iostream function, just rewrite the iostream function as ::. Definition at line 50 of file Task_Ex_T.inl. References ACE_BIT_ENABLED, ACE_TRACE, ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, >::close(), and ACE_Task_Ex<, ACE_MESSAGE_TYPE >::msg_queue_.
00051 {
00052 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::flush");
00053 if (ACE_BIT_ENABLED (flag, ACE_Task_Flags::ACE_FLUSHALL))
00054 return this->msg_queue_ != 0 && this->msg_queue_->close ();
00055 else
00056 return -1; // Note, need to be more careful about what we free...
00057 }
|
|
||||||||||||||||
|
Extract the first message from the queue (blocking). Note that uses <{absolute}> time rather than <{relative}> time. Returns number of items in queue if the call succeeds or -1 otherwise. Definition at line 21 of file Task_Ex_T.inl. References ACE_TRACE, ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, >::dequeue_head(), and ACE_Task_Ex<, ACE_MESSAGE_TYPE >::msg_queue_.
00022 {
00023 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::getq");
00024 return this->msg_queue_->dequeue_head (mb, tv);
00025 }
|
|
||||||||||
|
Return the Task's Module if there is one, else returns 0.
Definition at line 106 of file Task_Ex_T.cpp. References ACE_TRACE, and ACE_Task_Ex<, ACE_MESSAGE_TYPE >::mod_.
|
|
||||||||||
|
Sets the message queue associated with this task.
|
|
||||||||||
|
Gets the message queue associated with this task.
Definition at line 72 of file Task_Ex_T.inl. References ACE_TRACE, and ACE_Task_Ex<, ACE_MESSAGE_TYPE >::msg_queue_.
00073 {
00074 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::msg_queue");
00075 return this->msg_queue_;
00076 }
|
|
||||||||||
|
Return the name of the enclosing Module if there's one associated with the Task, else returns 0. Definition at line 96 of file Task_Ex_T.cpp. References ACE_TRACE, ACE_Task_Ex<, ACE_MESSAGE_TYPE >::mod_, and ACE_Module< ACE_SYNCH_USE >::name().
|
|
||||||||||
|
Set next Task pointer.
Definition at line 95 of file Task_Ex_T.inl. References ACE_TRACE.
|
|
||||||||||
|
Get next Task pointer.
Definition at line 88 of file Task_Ex_T.inl. References ACE_TRACE.
|
|
||||||||||
|
|
|
||||||||||||||||
|
Transfer message to the adjacent ACE_Task_Ex in a ACE_Stream. Note that uses <{absolute}> time rather than <{relative}> time. Definition at line 104 of file Task_Ex_T.inl. References ACE_TRACE.
00107 {
00108 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::put_next");
00109 return -1; // this->next_ == 0 ? -1 : this->next_->put (msg, tv);
00110 }
|
|
||||||||||||||||
|
Insert message into the message queue. Note that uses <{absolute}> time rather than <{relative}> time. Definition at line 36 of file Task_Ex_T.inl. References ACE_TRACE, ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, >::enqueue_tail(), and ACE_Task_Ex<, ACE_MESSAGE_TYPE >::msg_queue_.
00037 {
00038 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::putq");
00039 return this->msg_queue_->enqueue_tail (mb, tv);
00040 }
|
|
||||||||||||||||
|
Turn the message around and send it back down the Stream. Note that uses <{absolute}> time rather than <{relative}> time. Definition at line 79 of file Task_Ex_T.inl. References ACE_TRACE.
00080 {
00081 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::reply");
00082 ACE_UNUSED_ARG (mb);
00083 ACE_UNUSED_ARG (tv);
00084 return -1 ; // this->sibling ()->put_next (mb, tv);
00085 }
|
|
||||||||||
|
Alwasy return 0.
Definition at line 81 of file Task_Ex_T.cpp. References ACE_TRACE.
00082 {
00083 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE, ACE_MESSAGE_TYPE>::sibling");
00084 /// @todo FIXME Need to impl ACE_Moudle to support ACE_Task as well.
00085 /// Now always return 0 for sibling
00086 return 0;
00087 /*
00088 if (this->mod_ == 0)
00089 return 0;
00090 else
00091 return this->mod_->sibling (this);
00092 */
00093 }
|
|
||||||||||||||||
|
Return a message to the queue. Note that uses <{absolute}> time rather than <{relative}> time. Definition at line 43 of file Task_Ex_T.inl. References ACE_TRACE, ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, >::enqueue_head(), and ACE_Task_Ex<, ACE_MESSAGE_TYPE >::msg_queue_.
00044 {
00045 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::ungetq");
00046 return this->msg_queue_->enqueue_head (mb, tv);
00047 }
|
|
||||||||||||||||
|
Manipulate watermarks.
Definition at line 10 of file Task_Ex_T.inl. References ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, ACE_TRACE, ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, >::high_water_mark(), ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, >::low_water_mark(), and ACE_Task_Ex<, ACE_MESSAGE_TYPE >::msg_queue_.
00012 {
00013 ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::water_marks");
00014 if (cmd == ACE_IO_Cntl_Msg::SET_LWM)
00015 this->msg_queue_->low_water_mark (wm_size);
00016 else /* cmd == ACE_IO_Cntl_Msg::SET_HWM */
00017 this->msg_queue_->high_water_mark (wm_size);
00018 }
|
|
|||||
|
Definition at line 64 of file Task_Ex_T.h. |
|
|||||
|
Definition at line 65 of file Task_Ex_T.h. |
|
|||||
|
Declare the dynamic allocation hooks.
Definition at line 184 of file Task_Ex_T.h. |
|
|||||
|
1 if should delete Message_Queue, 0 otherwise.
Definition at line 172 of file Task_Ex_T.h. Referenced by ACE_Task_Ex<, ACE_MESSAGE_TYPE >::~ACE_Task_Ex(). |
|
|||||
|
Back-pointer to the enclosing module.
Definition at line 175 of file Task_Ex_T.h. Referenced by ACE_Task_Ex<, ACE_MESSAGE_TYPE >::module(), and ACE_Task_Ex<, ACE_MESSAGE_TYPE >::name(). |
|
|||||
|
|||||
|
Pointer to adjacent ACE_Task.
Definition at line 178 of file Task_Ex_T.h. |
1.3.6