NAME
ACE_Module -
An abstraction for managing a bi-directional flow of messages.
SYNOPSIS
#include <ace/Module.h>
template<ACE_SYNCH_1>
class ACE_Module
{
public:
friend class ACE_Shutup_GPlusPlus; // Turn off g++ warning;
enum{ M_DELETE = 1 };
ACE_Module (void);
ACE_Module (
char *module_name,
ACE_Task<ACE_SYNCH_2> *writer = 0,
ACE_Task<ACE_SYNCH_2> *reader = 0,
void *a = 0
);
int open (
char *module_name,
ACE_Task<ACE_SYNCH_2> *writer = 0,
ACE_Task<ACE_SYNCH_2> *reader = 0,
void *a = 0
);
int close (u_long flags = M_DELETE);
ACE_Task<ACE_SYNCH_2> *writer (void);
void writer (ACE_Task<ACE_SYNCH_2> *q);
ACE_Task<ACE_SYNCH_2> *reader (void);
void reader (ACE_Task<ACE_SYNCH_2> *q);
ACE_Task<ACE_SYNCH_2> *sibling (ACE_Task<ACE_SYNCH_2> *orig);
const char *name (void) const;
void name (char *);
void *arg (void) const;
void arg (void *);
void link (ACE_Module<ACE_SYNCH_2> *m);
ACE_Module<ACE_SYNCH_2> *next (void);
void next (ACE_Module<ACE_SYNCH_2> *m);
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
private:
~ACE_Module (void);
ACE_Task<ACE_SYNCH_2> *q_pair_[2];
char name_[MAXNAMLEN + 1];
ACE_Module<ACE_SYNCH_2> *next_;
void *arg_;
};
DESCRIPTION
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.
Initialization and termination methods.
ACE_Module (void);
ACE_Module (
char *module_name,
ACE_Task<ACE_SYNCH_2> *writer = 0,
ACE_Task<ACE_SYNCH_2> *reader = 0,
void *a = 0
);
Create an initialized module with module_name as its identity
and reader and writer as its tasks.
int open (
char *module_name,
ACE_Task<ACE_SYNCH_2> *writer = 0,
ACE_Task<ACE_SYNCH_2> *reader = 0,
void *a = 0
);
Create an initialized module with module_name as its identity
and reader and writer as its tasks.
int close (u_long flags = M_DELETE);
Close down the Module and its Tasks. If the M_DELETE argument
is given then delete all the memory too.
ACE_Task manipulation routines
ACE_Task<ACE_SYNCH_2> *writer (void);
void writer (ACE_Task<ACE_SYNCH_2> *q);
ACE_Task<ACE_SYNCH_2> *reader (void);
void reader (ACE_Task<ACE_SYNCH_2> *q);
ACE_Task<ACE_SYNCH_2> *sibling (ACE_Task<ACE_SYNCH_2> *orig);
Set and get pointer to sibling ACE_Task in ACE_Module
Identify the module
const char *name (void) const;
void name (char *);
Argument to the Tasks.
void *arg (void) const;
Get the argument passed to the tasks.
void arg (void *);
Set the argument passed to the tasks.
void link (ACE_Module<ACE_SYNCH_2> *m);
Link to other modules in the ustream stack
ACE_Module<ACE_SYNCH_2> *next (void);
Get the next pointer to the module above in the stream.
void next (ACE_Module<ACE_SYNCH_2> *m);
Set the next pointer to the module above in the stream.
void dump (void) const;
Dump the state of an object.
ACE_ALLOC_HOOK_DECLARE;
Declare the dynamic allocation hooks.
AUTHOR
Doug Schmidt
LIBRARY
ace