ACE  6.0.6
Public Types | Public Member Functions | Public Attributes | Friends
ACE_Task_Ex Class Reference

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

#include <Task_Ex_T.h>

Inheritance diagram for ACE_Task_Ex:
Inheritance graph
[legend]
Collaboration diagram for ACE_Task_Ex:
Collaboration graph
[legend]

List of all members.

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_EXmsg_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)
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)
 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_EXmsg_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.

Friends

class ACE_Module< ACE_SYNCH_USE >
class ACE_Module_Type

Detailed Description

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

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.

Todo:
: We can merge ACE_Task and ACE_Task_Ex to be one class. something like that: template <ACE_SYNCH_DECL, ACE_MESSAGE_TYPE = ACE_Message_Block> class ACE_Task : public ACE_Task_Base { // use here the code from ACE_Task_Ex using ACE_Message_Queue_Ex };

Now specialized version of ACE_Task with ACE_Message_Block as its ACE_MESSAGE_TYPE...

template <ACE_SYNCH_DECL> 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.


Member Typedef Documentation

typedef ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE> ACE_Task_Ex::MESSAGE_QUEUE_EX

Constructor & Destructor Documentation

ACE_Task_Ex::ACE_Task_Ex ( ACE_Thread_Manager thr_mgr = 0,
MESSAGE_QUEUE_EX 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.

ACE_Task_Ex::~ACE_Task_Ex ( void  ) [virtual]

Destructor.


Member Function Documentation

void ACE_Task_Ex::dump ( void  ) const

Dump the state of an object.

int ACE_Task_Ex::flush ( u_long  flag = ACE_Task_Flags::ACE_FLUSHALL) [inline]

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 <flush> function, just rewrite the iostream function as ::<flush>.

int ACE_Task_Ex::getq ( ACE_MESSAGE_TYPE *&  mb,
ACE_Time_Value timeout = 0 
) [inline]

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.

ACE_Module< ACE_SYNCH_USE > * ACE_Task_Ex::module ( void  ) const

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

ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, ACE_SYNCH_USE > * ACE_Task_Ex::msg_queue ( void  )

Gets the message queue associated with this task.

void ACE_Task_Ex::msg_queue ( MESSAGE_QUEUE_EX mq) [inline]

Sets the message queue associated with this task.

const ACE_TCHAR * ACE_Task_Ex::name ( 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 > * ACE_Task_Ex::next ( void  ) [inline]

Get next Task pointer.

void ACE_Task_Ex::next ( ACE_Task< ACE_SYNCH_USE > *  q) [inline]

Set next Task pointer.

int ACE_Task_Ex::put_next ( ACE_MESSAGE_TYPE *  msg,
ACE_Time_Value timeout = 0 
) [inline]

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

int ACE_Task_Ex::putq ( ACE_MESSAGE_TYPE *  mb,
ACE_Time_Value timeout = 0 
) [inline]

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

int ACE_Task_Ex::reply ( ACE_MESSAGE_TYPE *  mb,
ACE_Time_Value timeout = 0 
) [inline]

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

ACE_Task< ACE_SYNCH_USE > * ACE_Task_Ex::sibling ( void  )

Alwasy return 0.

Todo:
FIXME
Todo:
FIXME Need to impl ACE_Moudle to support ACE_Task as well. Now always return 0 for sibling
int ACE_Task_Ex::ungetq ( ACE_MESSAGE_TYPE *  mb,
ACE_Time_Value timeout = 0 
) [inline]

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

void ACE_Task_Ex::water_marks ( ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds  cmd,
size_t  wm_size 
) [inline]

Manipulate watermarks.


Friends And Related Function Documentation

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

Member Data Documentation

Declare the dynamic allocation hooks.

true if should delete Message_Queue, false otherwise.

ACE_Module<ACE_SYNCH_USE>* ACE_Task_Ex::mod_

Back-pointer to the enclosing module.

Queue of messages on the ACE_Task..

ACE_Task<ACE_SYNCH_USE>* ACE_Task_Ex::next_

Pointer to adjacent ACE_Task.


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