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

ACE_Module Class Template Reference

An abstraction for managing a bi-directional flow of messages. More...

#include <Module.h>

Inheritance diagram for ACE_Module:

Inheritance graph
[legend]
Collaboration diagram for ACE_Module:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Module (void)
 Create an empty Module. More...

 ~ACE_Module (void)
 Shutdown the Module. More...

 ACE_Module (const ACE_TCHAR *module_name, ACE_Task< ACE_SYNCH_USE > *writer=0, ACE_Task< ACE_SYNCH_USE > *reader=0, void *args=0, int flags=M_DELETE)
 Create an initialized module with <module_name> as its identity and <reader> and <writer> as its tasks. More...

int open (const ACE_TCHAR *module_name, ACE_Task< ACE_SYNCH_USE > *writer=0, ACE_Task< ACE_SYNCH_USE > *reader=0, void *a=0, int flags=M_DELETE)
int close (int flags=M_DELETE_NONE)
ACE_Task< ACE_SYNCH_USE > * writer (void)
 Get the writer task. More...

void writer (ACE_Task< ACE_SYNCH_USE > *q, int flags=M_DELETE_WRITER)
ACE_Task< ACE_SYNCH_USE > * reader (void)
 Get the reader task. More...

void reader (ACE_Task< ACE_SYNCH_USE > *q, int flags=M_DELETE_READER)
ACE_Task< ACE_SYNCH_USE > * sibling (ACE_Task< ACE_SYNCH_USE > *orig)
 Set and get pointer to sibling <ACE_Task> in an <ACE_Module>. More...

const ACE_TCHARname (void) const
 Get the module name. More...

void name (const ACE_TCHAR *)
 Set the module name. More...

void * arg (void) const
 Get the argument passed to the tasks. More...

void arg (void *)
 Set the argument passed to the tasks. More...

void link (ACE_Module< ACE_SYNCH_USE > *m)
 Link to other modules in the ustream stack. More...

ACE_Module< ACE_SYNCH_USE > * next (void)
 Get the next pointer to the module above in the stream. More...

void next (ACE_Module< ACE_SYNCH_USE > *m)
 Set the next pointer to the module above in the stream. More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Private Methods

int close_i (int which, int flags)
 Implements the close operation for either the reader or the writer task (depending on <which>). More...


Private Attributes

ACE_Task< ACE_SYNCH_USE > * q_pair_ [2]
 Pair of Tasks that form the "read-side" and "write-side" of the ACE_Module partitioning. More...

ACE_TCHAR name_ [MAXNAMLEN+1]
 Name of the ACE_Module. More...

ACE_Module< ACE_SYNCH_USE > * next_
 Next ACE_Module in the stack. More...

void * arg_
 Argument passed through to the reader and writer task when they are opened. More...

int flags_
 Holds flags which are used to determine if the reader and writer task have to be deleted on exit. More...


Friends

class ACE_Shutup_GPlusPlus

Detailed Description

template<ACE_SYNCH_DECL>
class ACE_Module<>

An abstraction for managing a bi-directional flow of messages.

This is based on the Module concept in System V Streams, which contains a pair of Tasks, one for handling upstream processing, one for handling downstream processing. In general, you shouldn't subclass from this class, but instead subclass from the <ACE_Task>.

Definition at line 72 of file Module.h.


Constructor & Destructor Documentation

template<ACE_SYNCH_DECL >
ACE_Module<>::ACE_Module void   
 

Create an empty Module.

template<ACE_SYNCH_DECL >
ACE_Module<>::~ACE_Module void   
 

Shutdown the Module.

template<ACE_SYNCH_DECL >
ACE_Module<>::ACE_Module const ACE_TCHAR   module_name,
ACE_Task< ACE_SYNCH_USE > *    writer = 0,
ACE_Task< ACE_SYNCH_USE > *    reader = 0,
void *    args = 0,
int    flags = M_DELETE
 

Create an initialized module with <module_name> as its identity and <reader> and <writer> as its tasks.


Member Function Documentation

template<ACE_SYNCH_DECL >
void ACE_Module<>::arg void *   
 

Set the argument passed to the tasks.

template<ACE_SYNCH_DECL >
void* ACE_Module<>::arg void    const
 

Get the argument passed to the tasks.

Referenced by ACE_Stream::insert, ACE_Module< ACE_SYNCH_USE >::open, ACE_Stream::push_module, and ACE_Stream::replace.

template<ACE_SYNCH_DECL >
int ACE_Module<>::close int    flags = M_DELETE_NONE
 

Close down the Module and its Tasks. The flags argument can be used to override the default behaviour, which depends on previous <flags> values in calls to c'tor, <open>, <reader>, and <writer>. A previous value M_DELETE[_XXX] can not be overridden. Should not be called from within <ACE_Task::module_closed>.

Referenced by ACE_Module_Type::fini, ACE_Stream::pop, ACE_Stream::remove, ACE_Stream::replace, and ACE_Module< ACE_SYNCH_USE >::~ACE_Module.

template<ACE_SYNCH_DECL >
int ACE_Module<>::close_i int    which,
int    flags
[private]
 

Implements the close operation for either the reader or the writer task (depending on <which>).

Referenced by ACE_Module< ACE_SYNCH_USE >::close, ACE_Module< ACE_SYNCH_USE >::open, ACE_Module< ACE_SYNCH_USE >::reader, and ACE_Module< ACE_SYNCH_USE >::writer.

template<ACE_SYNCH_DECL >
void ACE_Module<>::dump void    const
 

Dump the state of an object.

template<ACE_SYNCH_DECL >
void ACE_Module<>::link ACE_Module< ACE_SYNCH_USE > *    m
 

Link to other modules in the ustream stack.

Referenced by ACE_Stream::insert, ACE_Stream::push_module, ACE_Stream::remove, and ACE_Stream::replace.

template<ACE_SYNCH_DECL >
void ACE_Module<>::name const ACE_TCHAR  
 

Set the module name.

template<ACE_SYNCH_DECL >
const ACE_TCHAR* ACE_Module<>::name void    const
 

Get the module name.

Referenced by ace_get_module, ACE_Module< ACE_SYNCH_USE >::ACE_Module, ACE_Stream::ACE_Stream, ACE_Stream::dump, ACE_Stream::find, ACE_Stream::insert, ACE_Module< ACE_SYNCH_USE >::open, ACE_Stream::remove, and ACE_Stream::replace.

template<ACE_SYNCH_DECL >
void ACE_Module<>::next ACE_Module< ACE_SYNCH_USE > *    m
 

Set the next pointer to the module above in the stream.

template<ACE_SYNCH_DECL >
ACE_Module<ACE_SYNCH_USE>* ACE_Module<>::next void   
 

Get the next pointer to the module above in the stream.

Referenced by ACE_Stream::dump, ACE_Stream::find, ACE_Stream::insert, ACE_Module< ACE_SYNCH_USE >::link, ACE_Stream::link_i, ACE_Stream::pop, ACE_Stream::push, ACE_Stream::push_module, ACE_Stream::remove, ACE_Stream::replace, and ACE_Stream::unlink_i.

template<ACE_SYNCH_DECL >
int ACE_Module<>::open const ACE_TCHAR   module_name,
ACE_Task< ACE_SYNCH_USE > *    writer = 0,
ACE_Task< ACE_SYNCH_USE > *    reader = 0,
void *    a = 0,
int    flags = M_DELETE
 

Create an initialized module with <module_name> as its identity and <reader> and <writer> as its tasks. Previously register reader or writers or closed down and deleted according to the value of flags_. Should not be called from within <ACE_Task::module_closed>.

Referenced by ACE_Module< ACE_SYNCH_USE >::ACE_Module.

template<ACE_SYNCH_DECL >
void ACE_Module<>::reader ACE_Task< ACE_SYNCH_USE > *    q,
int    flags = M_DELETE_READER
 

Set the reader task. <flags> can be used to indicate that the module should delete the reader during a call to close or to the destructor. If a previous reader exists, it is closed. It may also be deleted, depending on the old flags_ value. Should not be called from within <ACE_Task::module_closed>.

template<ACE_SYNCH_DECL >
ACE_Task<ACE_SYNCH_USE>* ACE_Module<>::reader void   
 

Get the reader task.

Referenced by ACE_Stream::dump, ACE_Module_Type::fini, ACE_Module_Type::init, ACE_Stream::insert, ACE_Module< ACE_SYNCH_USE >::link, ACE_Stream::link_i, ACE_Module< ACE_SYNCH_USE >::open, ACE_Stream::pop, ACE_Stream::push_module, ACE_Stream::replace, ACE_Module_Type::resume, ACE_Module_Type::suspend, and ACE_Module< ACE_SYNCH_USE >::~ACE_Module.

template<ACE_SYNCH_DECL >
ACE_Task<ACE_SYNCH_USE>* ACE_Module<>::sibling ACE_Task< ACE_SYNCH_USE > *    orig
 

Set and get pointer to sibling <ACE_Task> in an <ACE_Module>.

template<ACE_SYNCH_DECL >
void ACE_Module<>::writer ACE_Task< ACE_SYNCH_USE > *    q,
int    flags = M_DELETE_WRITER
 

Set the writer task. <flags> can be used to indicate that the module should delete the writer during a call to close or to the destructor. If a previous writer exists, it is closed. It may also be deleted, depending on the old flags_ value. Should not be called from within <ACE_Task::module_closed>.

template<ACE_SYNCH_DECL >
ACE_Task<ACE_SYNCH_USE>* ACE_Module<>::writer void   
 

Get the writer task.

Referenced by ACE_Stream::dump, ACE_Module_Type::fini, ACE_Module_Type::init, ACE_Stream::insert, ACE_Module< ACE_SYNCH_USE >::link, ACE_Stream::link_i, ACE_Module< ACE_SYNCH_USE >::open, ACE_Stream::pop, ACE_Stream::push_module, ACE_Stream::replace, ACE_Module_Type::resume, ACE_Module_Type::suspend, ACE_Stream::unlink_i, and ACE_Module< ACE_SYNCH_USE >::~ACE_Module.


Friends And Related Function Documentation

template<ACE_SYNCH_DECL >
friend class ACE_Shutup_GPlusPlus [friend]
 

Definition at line 75 of file Module.h.


Member Data Documentation

template<ACE_SYNCH_DECL >
ACE_Module::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 169 of file Module.h.

template<ACE_SYNCH_DECL >
void* ACE_Module::arg_ [private]
 

Argument passed through to the reader and writer task when they are opened.

Definition at line 188 of file Module.h.

Referenced by ACE_Module< ACE_SYNCH_USE >::arg, and ACE_Module< ACE_SYNCH_USE >::open.

template<ACE_SYNCH_DECL >
int ACE_Module::flags_ [private]
 

Holds flags which are used to determine if the reader and writer task have to be deleted on exit.

Definition at line 192 of file Module.h.

Referenced by ACE_Module< ACE_SYNCH_USE >::close, ACE_Module< ACE_SYNCH_USE >::close_i, ACE_Module< ACE_SYNCH_USE >::open, ACE_Module< ACE_SYNCH_USE >::reader, and ACE_Module< ACE_SYNCH_USE >::writer.

template<ACE_SYNCH_DECL >
ACE_TCHAR ACE_Module::name_[MAXNAMLEN + 1] [private]
 

Name of the ACE_Module.

Definition at line 181 of file Module.h.

Referenced by ACE_Module< ACE_SYNCH_USE >::name.

template<ACE_SYNCH_DECL >
ACE_Module<ACE_SYNCH_USE>* ACE_Module::next_ [private]
 

Next ACE_Module in the stack.

Definition at line 184 of file Module.h.

Referenced by ACE_Module< ACE_SYNCH_USE >::next.

template<ACE_SYNCH_DECL >
ACE_Task<ACE_SYNCH_USE>* ACE_Module::q_pair_[2] [private]
 

Pair of Tasks that form the "read-side" and "write-side" of the ACE_Module partitioning.

Definition at line 178 of file Module.h.

Referenced by ACE_Module< ACE_SYNCH_USE >::ACE_Module, ACE_Module< ACE_SYNCH_USE >::close_i, ACE_Module< ACE_SYNCH_USE >::reader, ACE_Module< ACE_SYNCH_USE >::sibling, and ACE_Module< ACE_SYNCH_USE >::writer.


The documentation for this class was generated from the following file:
Generated on Mon Jun 16 12:50:43 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002