ACE 6.0.5
Public Member Functions | Public Attributes | Private Member Functions | Friends
ACE_Task< ACE_SYNCH_DECL > 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< ACE_SYNCH_DECL >:
Inheritance graph
[legend]
Collaboration diagram for ACE_Task< ACE_SYNCH_DECL >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 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)
int getq (ACE_Message_Block *&mb, ACE_Time_Value *timeout=0)
int ungetq (ACE_Message_Block *, ACE_Time_Value *timeout=0)
int reply (ACE_Message_Block *mb, ACE_Time_Value *tv=0)
int put_next (ACE_Message_Block *msg, ACE_Time_Value *timeout=0)
const ACE_TCHARname (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)
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

ACE_Message_Queue
< ACE_SYNCH_USE > * 
msg_queue_
 Queue of messages on the ACE_Task..
bool delete_msg_queue_
 true if should delete Message_Queue, false 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< _ACE_SYNCH > &)
 ACE_Task (const ACE_Task< _ACE_SYNCH > &)

Friends

class ACE_Module< ACE_SYNCH_USE >
class ACE_Module_Type

Detailed Description

template<ACE_SYNCH_DECL>
class ACE_Task< ACE_SYNCH_DECL >

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_SYNCH_DECL >::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 >
virtual ACE_Task< ACE_SYNCH_DECL >::~ACE_Task ( void  ) [virtual]

Destructor.

template<ACE_SYNCH_DECL >
ACE_Task< ACE_SYNCH_DECL >::ACE_Task ( const ACE_Task< _ACE_SYNCH > &  ) [private]

Member Function Documentation

template<ACE_SYNCH_DECL >
void ACE_Task< ACE_SYNCH_DECL >::dump ( void  ) const
template<ACE_SYNCH_DECL >
int ACE_Task< ACE_SYNCH_DECL >::flush ( u_long  flag = ACE_Task_Flags::ACE_FLUSHALL)

Flush the task's queue, i.e., free all of the enqueued message blocks and unblocks any threads waiting on the queue. Note that if this conflicts with the C++ iostream <flush> function, just rewrite the iostream function as ::<flush>.

template<ACE_SYNCH_DECL >
int ACE_Task< ACE_SYNCH_DECL >::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. Returns number of items in queue if the call succeeds or -1 otherwise.

template<ACE_SYNCH_DECL >
ACE_Module<ACE_SYNCH_USE>* ACE_Task< ACE_SYNCH_DECL >::module ( void  ) const

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

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

Gets the message queue associated with this task.

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

Sets the message queue associated with this task.

template<ACE_SYNCH_DECL >
const ACE_TCHAR* ACE_Task< ACE_SYNCH_DECL >::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_Task<ACE_SYNCH_USE>* ACE_Task< ACE_SYNCH_DECL >::next ( void  )

Get next Task pointer.

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

Set next Task pointer.

template<ACE_SYNCH_DECL >
void ACE_Task< ACE_SYNCH_DECL >::operator= ( const ACE_Task< _ACE_SYNCH > &  ) [private]
template<ACE_SYNCH_DECL >
int ACE_Task< ACE_SYNCH_DECL >::put_next ( ACE_Message_Block msg,
ACE_Time_Value timeout = 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 >
int ACE_Task< ACE_SYNCH_DECL >::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.

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

Turn the message around, sending it in the opposite direction in the stream. To do this, the message is put onto the task next in the stream after this task's sibling.

Parameters:
mbPointer to the block that is used in the reply.
tvThe absolute time at which the put operation used to send the message block to the next module in the stream will time out. If 0, this call blocks until it can be completed.
template<ACE_SYNCH_DECL >
ACE_Task<ACE_SYNCH_USE>* ACE_Task< ACE_SYNCH_DECL >::sibling ( void  )

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

template<ACE_SYNCH_DECL >
int ACE_Task< ACE_SYNCH_DECL >::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.

template<ACE_SYNCH_DECL >
void ACE_Task< ACE_SYNCH_DECL >::water_marks ( ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds  ,
size_t   
)

Manipulate watermarks.


Friends And Related Function Documentation

template<ACE_SYNCH_DECL >
friend class ACE_Module< ACE_SYNCH_USE > [friend]
template<ACE_SYNCH_DECL >
friend class ACE_Module_Type [friend]

Member Data Documentation

template<ACE_SYNCH_DECL >
ACE_Task< ACE_SYNCH_DECL >::ACE_ALLOC_HOOK_DECLARE
template<ACE_SYNCH_DECL >
bool ACE_Task< ACE_SYNCH_DECL >::delete_msg_queue_

true if should delete Message_Queue, false otherwise.

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

Back-pointer to the enclosing module.

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

Queue of messages on the ACE_Task..

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

Pointer to adjacent ACE_Task.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines