Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Task Class Template Reference

Primary interface for application message processing, as well as input and output message queueing. More...

#include <Task_T.h>

Inheritance diagram for ACE_Task

Inheritance graph
[legend]
Collaboration diagram for ACE_Task:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Task (ACE_Thread_Manager *thr_mgr = 0, ACE_Message_Queue<ACE_SYNCH_USE> *mq = 0)
virtual ~ACE_Task (void)
 Destructor.

ACE_Message_Queue<ACE_SYNCH_USE>* msg_queue (void)
 Gets the message queue associated with this task.

void msg_queue (ACE_Message_Queue<ACE_SYNCH_USE> *)
 Sets the message queue associated with this task.

int putq (ACE_Message_Block *, ACE_Time_Value *timeout = 0)
 Insert message into the message queue. Note that <timeout> uses <{absolute}> time rather than <{relative}> time.

int getq (ACE_Message_Block *&mb, ACE_Time_Value *timeout = 0)
 Extract the first message from the queue (blocking). Note that <timeout> uses <{absolute}> time rather than <{relative}> time.

int ungetq (ACE_Message_Block *, ACE_Time_Value *timeout = 0)
 Return a message to the queue. Note that <timeout> uses <{absolute}> time rather than <{relative}> time.

int reply (ACE_Message_Block *, ACE_Time_Value *timeout = 0)
int put_next (ACE_Message_Block *msg, ACE_Time_Value *timeout = 0)
int can_put (ACE_Message_Block *)
 Tests whether we can enqueue a message without blocking.

const ACE_TCHARname (void) const
 Return the name of the enclosing Module if there's one associated with the Task, else returns 0.

ACE_Task<ACE_SYNCH_USE>* next (void)
 Get next Task pointer. Set next Task pointer.

void next (ACE_Task<ACE_SYNCH_USE> *)
ACE_Task<ACE_SYNCH_USE>* sibling (void)
 Return the Task's sibling if there's one associated with the Task's Module, 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

module void const
 Return the Task's Module if there is one, else returns 0.

ACE_Message_Queue<ACE_SYNCH_USE>* 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 Methods

void operator= (const ACE_Task< _ACE_SYNCH_MUTEX_T, _ACE_SYNCH_CONDITION_T > &)
 ACE_Task (const ACE_Task< _ACE_SYNCH_MUTEX_T, _ACE_SYNCH_CONDITION_T > &)

Friends

class  ACE_Module< ACE_SYNCH_USE >
class  ACE_Module_Type

Detailed Description

template<ACE_SYNCH_DECL> template class ACE_Task

Primary interface for application message processing, as well as input and output message queueing.

This class serves as the basis for passive and active objects in ACE.


Constructor & Destructor Documentation

template<ACE_SYNCH_DECL>
ACE_Task<>::ACE_Task<> ( ACE_Thread_Manager * thr_mgr = 0,
ACE_Message_Queue< ACE_SYNCH_USE >* mq = 0 )
 

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.

template<ACE_SYNCH_DECL>
ACE_Task<>::~ACE_Task<> ( void ) [virtual]
 

Destructor.

template<ACE_SYNCH_DECL>
ACE_Task<>::ACE_Task<> ( const ACE_Task< _ACE_SYNCH_MUTEX_T,_ACE_SYNCH_CONDITION_T >& ) [private]
 


Member Function Documentation

template<ACE_SYNCH_DECL>
ACE_INLINE int ACE_Task< ACE_SYNCH_USE >::can_put ( ACE_Message_Block * )
 

Tests whether we can enqueue a message without blocking.

template<ACE_SYNCH_DECL>
void ACE_Task<>::dump ( void ) const [inline]
 

Dump the state of an object.

Reimplemented in ACE_Stream_Head, ACE_Stream_Tail, ACE_Thru_Task, ACE_Svc_Handler, and ACE_Buffered_Svc_Handler.

template<ACE_SYNCH_DECL>
ACE_INLINE int ACE_Task< ACE_SYNCH_USE >::flush ( u_long flag = ACE_Task_Flags::ACE_FLUSHALL )
 

Flush the queue. Note that if this conflicts with the C++ iostream <flush> function, just rewrite the iostream function as ::<flush>.

template<ACE_SYNCH_DECL>
ACE_INLINE int ACE_Task< ACE_SYNCH_USE >::getq ( ACE_Message_Block *& mb,
ACE_Time_Value * tv = 0 )
 

Extract the first message from the queue (blocking). Note that <timeout> uses <{absolute}> time rather than <{relative}> time.

template<ACE_SYNCH_DECL>
ACE_INLINE void ACE_Task< ACE_SYNCH_USE >::msg_queue ( ACE_Message_Queue< ACE_SYNCH_USE >* mq )
 

Sets the message queue associated with this task.

template<ACE_SYNCH_DECL>
ACE_Message_Queue< ACE_SYNCH_USE >* ACE_Task< ACE_SYNCH_USE >::msg_queue ( void )
 

Gets the message queue associated with this task.

template<ACE_SYNCH_DECL>
const ACE_TCHAR * ACE_Task<>::name ( void ) const
 

Return the name of the enclosing Module if there's one associated with the Task, else returns 0.

Reimplemented in ACE_NT_Service.

template<ACE_SYNCH_DECL>
ACE_INLINE void ACE_Task< ACE_SYNCH_USE >::next ( ACE_Task< ACE_SYNCH_USE >* q )
 

template<ACE_SYNCH_DECL>
ACE_INLINE ACE_Task< ACE_SYNCH_USE >* ACE_Task< ACE_SYNCH_USE >::next ( void )
 

Get next Task pointer. Set next Task pointer.

template<ACE_SYNCH_DECL>
void ACE_Task<>::operator= ( const ACE_Task< _ACE_SYNCH_MUTEX_T,_ACE_SYNCH_CONDITION_T >& ) [private]
 

template<ACE_SYNCH_DECL>
ACE_INLINE int ACE_Task< ACE_SYNCH_USE >::put_next ( ACE_Message_Block * msg,
ACE_Time_Value * tv = 0 )
 

Transfer message to the adjacent ACE_Task in a ACE_Stream. Note that <timeout> uses <{absolute}> time rather than <{relative}> time.

template<ACE_SYNCH_DECL>
ACE_INLINE int ACE_Task< ACE_SYNCH_USE >::putq ( ACE_Message_Block * mb,
ACE_Time_Value * tv = 0 )
 

Insert message into the message queue. Note that <timeout> uses <{absolute}> time rather than <{relative}> time.

template<ACE_SYNCH_DECL>
ACE_INLINE int ACE_Task< ACE_SYNCH_USE >::reply ( ACE_Message_Block * mb,
ACE_Time_Value * tv = 0 )
 

Turn the message around and send it back down the Stream. Note that <timeout> uses <{absolute}> time rather than <{relative}> time.

template<ACE_SYNCH_DECL>
ACE_Task< ACE_SYNCH_USE >* ACE_Task<>::sibling ( void )
 

Return the Task's sibling if there's one associated with the Task's Module, else returns 0.

template<ACE_SYNCH_DECL>
ACE_INLINE int ACE_Task< ACE_SYNCH_USE >::ungetq ( ACE_Message_Block * mb,
ACE_Time_Value * tv = 0 )
 

Return a message to the queue. Note that <timeout> uses <{absolute}> time rather than <{relative}> time.

template<ACE_SYNCH_DECL>
ACE_INLINE void ACE_Task< ACE_SYNCH_USE >::water_marks ( ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd,
size_t wm_size )
 

Manipulate watermarks.


Friends And Related Function Documentation

template<ACE_SYNCH_DECL>
class ACE_Module [friend]
 

template<ACE_SYNCH_DECL>
class ACE_Module_Type [friend]
 


Member Data Documentation

template<ACE_SYNCH_DECL>
ACE_Task<>::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented in ACE_NT_Service, ACE_Stream_Head, ACE_Stream_Tail, and ACE_Thru_Task.

template<ACE_SYNCH_DECL>
module void ACE_Task<>::const
 

Return the Task's Module if there is one, else returns 0.

template<ACE_SYNCH_DECL>
int ACE_Task<>::delete_msg_queue_
 

1 if should delete Message_Queue, 0 otherwise.

template<ACE_SYNCH_DECL>
ACE_Module< ACE_SYNCH_USE >* ACE_Task<>::mod_
 

Back-pointer to the enclosing module.

template<ACE_SYNCH_DECL>
ACE_Message_Queue< ACE_SYNCH_USE >* ACE_Task<>::msg_queue_
 

Queue of messages on the ACE_Task..

template<ACE_SYNCH_DECL>
ACE_Task< ACE_SYNCH_USE >* ACE_Task<>::next_
 

Pointer to adjacent ACE_Task.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 10:34:02 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000