NAME

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

SYNOPSIS

#include <ace/Task_T.h>

template<ACE_SYNCH_DECL> class ACE_Task : public ACE_Task_Base { public: friend class ACE_Module<ACE_SYNCH_USE>; friend class ACE_Module_Type; ACE_Task ( ACE_Thread_Manager *thr_mgr = 0, ACE_Message_Queue<ACE_SYNCH_USE> *mq = 0 ); virtual ~ACE_Task (void); ACE_Message_Queue<ACE_SYNCH_USE> *msg_queue (void); void msg_queue (ACE_Message_Queue<ACE_SYNCH_USE> *); 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 *, ACE_Time_Value *timeout = 0); int put_next ( ACE_Message_Block *msg, ACE_Time_Value *timeout = 0 ); int can_put (ACE_Message_Block *); const ASYS_TCHAR *name (void) const; ACE_Task<ACE_SYNCH_USE> *next (void); void next (ACE_Task<ACE_SYNCH_USE> *); ACE_Task<ACE_SYNCH_USE> *sibling (void); ACE_Module<ACE_SYNCH_USE> *module (void) const; int flush (u_long flag = ACE_Task_Flags::ACE_FLUSHALL); void water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, size_t); ACE_Message_Queue<ACE_SYNCH_USE> *msg_queue_; int delete_msg_queue_; ACE_Module<ACE_SYNCH_USE> *mod_; ACE_Task<ACE_SYNCH_USE> *next_; void dump (void) const; ACE_ALLOC_HOOK_DECLARE; private: inline ACE_UNIMPLEMENTED_FUNC ( void operator= (const ACE_Task<ACE_SYNCH_USE> &) ); };

DESCRIPTION

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

Initialization/termination methods.

ACE_Task (
    ACE_Thread_Manager *thr_mgr = 0,
    ACE_Message_Queue<ACE_SYNCH_USE> *mq = 0
    );

virtual ~ACE_Task (void);

ACE_Message_Queue<ACE_SYNCH_USE> *msg_queue (void);

void msg_queue (ACE_Message_Queue<ACE_SYNCH_USE> *);

Message queue manipulation methods.

Enqueue and dequeue methods.

For the following five method if timeout == 0, the caller will block until action is possible, else will wait until the absolute time specified in *timeout elapses). These calls will return, however, when queue is closed, deactivated, when a signal occurs, or if the time specified in timeout elapses, (in which case errno = EWOULDBLOCK).
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 *, ACE_Time_Value *timeout = 0);

int put_next (ACE_Message_Block *msg, ACE_Time_Value *timeout = 0);

int can_put (ACE_Message_Block *);

ACE_Task utility routines to identify names et al.

const ASYS_TCHAR *name (void) const;

Pointers to next ACE_Task_Base (if ACE is part of an ACE_Stream).

ACE_Task<ACE_SYNCH_USE> *next (void);

void next (ACE_Task<ACE_SYNCH_USE> *);

ACE_Task<ACE_SYNCH_USE> *sibling (void);

ACE_Module<ACE_SYNCH_USE> *module (void) const;

int flush (u_long flag = ACE_Task_Flags::ACE_FLUSHALL);

Special routines corresponding to certain message types.

void water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, size_t);

ACE_Message_Queue<ACE_SYNCH_USE> *msg_queue_;

int delete_msg_queue_;

ACE_Module<ACE_SYNCH_USE> *mod_;

ACE_Task<ACE_SYNCH_USE> *next_;

void dump (void) const;

ACE_ALLOC_HOOK_DECLARE;

Disallow these operations.

inline ACE_UNIMPLEMENTED_FUNC (
    void operator= (const ACE_Task<ACE_SYNCH_USE> &)
    );

AUTHOR

Douglas C. Schmidt schmidt@cs.wustl.edu

LIBRARY

ace