ACE 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
ACE_Module< ACE_SYNCH_DECL, TIME_POLICY > Class Template Reference

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

#include <Module.h>

Inheritance diagram for ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >:
Inheritance graph
[legend]
Collaboration diagram for ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >:
Collaboration graph
[legend]

Public Member Functions

 ACE_Module ()
 Create an empty Module.
 
virtual ~ACE_Module ()
 Shutdown the Module.
 
 ACE_Module (const ACE_TCHAR *module_name, ACE_Task< ACE_SYNCH_USE, TIME_POLICY > *writer=0, ACE_Task< ACE_SYNCH_USE, TIME_POLICY > *reader=0, void *args=0, int flags=M_DELETE)
 
int open (const ACE_TCHAR *module_name, ACE_Task< ACE_SYNCH_USE, TIME_POLICY > *writer=0, ACE_Task< ACE_SYNCH_USE, TIME_POLICY > *reader=0, void *a=0, int flags=M_DELETE)
 
int close (int flags=M_DELETE_NONE)
 
ACE_Task< ACE_SYNCH_USE, TIME_POLICY > * writer ()
 Get the writer task.
 
void writer (ACE_Task< ACE_SYNCH_USE, TIME_POLICY > *q, int flags=M_DELETE_WRITER)
 
ACE_Task< ACE_SYNCH_USE, TIME_POLICY > * reader ()
 Get the reader task.
 
void reader (ACE_Task< ACE_SYNCH_USE, TIME_POLICY > *q, int flags=M_DELETE_READER)
 
ACE_Task< ACE_SYNCH_USE, TIME_POLICY > * sibling (ACE_Task< ACE_SYNCH_USE, TIME_POLICY > *orig)
 Set and get pointer to sibling ACE_Task in an ACE_Module.
 
const ACE_TCHARname () const
 Get the module name.
 
void name (const ACE_TCHAR *)
 Set the module name.
 
voidarg () const
 Get the argument passed to the tasks.
 
void arg (void *)
 Set the argument passed to the tasks.
 
void link (ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *m)
 Link to other modules in the ustream stack.
 
virtual ACE_Module< ACE_SYNCH_USE, TIME_POLICY > * next ()
 Get the next pointer to the module above in the stream.
 
virtual void next (ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *m)
 Set the next pointer to the module above in the stream.
 
void dump () const
 Dump the state of an object.
 
- Public Member Functions inherited from ACE_Module_Base
virtual ~ACE_Module_Base ()=default
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Private Member Functions

int close_i (int which, int flags)
 

Private Attributes

ACE_Task< ACE_SYNCH_USE, TIME_POLICY > * q_pair_ [2]
 
ACE_TCHAR name_ [MAXPATHLEN+1]
 Name of the ACE_Module.
 
ACE_Module< ACE_SYNCH_USE, TIME_POLICY > * next_
 Next ACE_Module in the stack.
 
voidarg_
 
int flags_
 

Additional Inherited Members

- Public Types inherited from ACE_Module_Base
enum  {
  M_FLAGS_NOT_SET = 0 , M_DELETE_READER = 1 , M_DELETE_WRITER = 2 , M_DELETE = 3 ,
  M_DELETE_NONE = 4
}
 

Detailed Description

template<ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >

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.

Constructor & Destructor Documentation

◆ ACE_Module() [1/2]

Create an empty Module.

◆ ~ACE_Module()

Shutdown the Module.

◆ ACE_Module() [2/2]

ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::ACE_Module ( const ACE_TCHAR * module_name,
ACE_Task< ACE_SYNCH_USE, TIME_POLICY > * writer = 0,
ACE_Task< ACE_SYNCH_USE, TIME_POLICY > * 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

◆ arg() [1/2]

void * ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::arg ( ) const
inline

Get the argument passed to the tasks.

◆ arg() [2/2]

Set the argument passed to the tasks.

◆ close()

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

◆ close_i()

int ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::close_i ( int which,
int flags )
private

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

◆ dump()

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
class TIME_POLICY void ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::dump ( ) const

Dump the state of an object.

◆ link()

Link to other modules in the ustream stack.

◆ name() [1/2]

const ACE_TCHAR * ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::name ( ) const
inline

Get the module name.

◆ name() [2/2]

void ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::name ( const ACE_TCHAR * n)
inline

Set the module name.

◆ next() [1/2]

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

◆ next() [2/2]

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

◆ open()

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

Initialize the 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>.

◆ reader() [1/2]

Get the reader task.

◆ reader() [2/2]

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

◆ sibling()

Set and get pointer to sibling ACE_Task in an ACE_Module.

◆ writer() [1/2]

Get the writer task.

◆ writer() [2/2]

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

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ arg_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
void* ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::arg_
private

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

◆ flags_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
int ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::flags_
private

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

◆ name_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
ACE_TCHAR ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::name_[MAXPATHLEN+1]
private

Name of the ACE_Module.

◆ next_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
ACE_Module<ACE_SYNCH_USE, TIME_POLICY>* ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::next_
private

Next ACE_Module in the stack.

◆ q_pair_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
ACE_Task<ACE_SYNCH_USE, TIME_POLICY>* ACE_Module< ACE_SYNCH_DECL, TIME_POLICY >::q_pair_[2]
private

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


The documentation for this class was generated from the following files: