#include <Stream.h>
Collaboration diagram for ACE_Stream<>:
Public Types | |
enum | { M_DELETE = 3 } |
Public Member Functions | |
ACE_Stream (void *arg=0, ACE_Module< ACE_SYNCH_USE > *head=0, ACE_Module< ACE_SYNCH_USE > *tail=0) | |
virtual int | open (void *arg, ACE_Module< ACE_SYNCH_USE > *head=0, ACE_Module< ACE_SYNCH_USE > *tail=0) |
virtual int | close (int flags=M_DELETE) |
Close down the stream and release all the resources. | |
virtual | ~ACE_Stream (void) |
Close down the stream and release all the resources. | |
virtual int | push (ACE_Module< ACE_SYNCH_USE > *mod) |
virtual int | pop (int flags=M_DELETE) |
are invoked to cleanup the tasks. | |
virtual int | top (ACE_Module< ACE_SYNCH_USE > *&mod) |
virtual int | insert (const ACE_TCHAR *prev_name, ACE_Module< ACE_SYNCH_USE > *mod) |
Insert a new module <mod> below the named module <prev_name>. | |
virtual int | replace (const ACE_TCHAR *replace_name, ACE_Module< ACE_SYNCH_USE > *mod, int flags=M_DELETE) |
Replace the named module <replace_name> with a new module <mod>. | |
virtual int | remove (const ACE_TCHAR *mod, int flags=M_DELETE) |
virtual ACE_Module< ACE_SYNCH_USE > * | head (void) |
Return current stream head. | |
virtual ACE_Module< ACE_SYNCH_USE > * | tail (void) |
Return current stream tail. | |
virtual ACE_Module< ACE_SYNCH_USE > * | find (const ACE_TCHAR *mod) |
Find a particular ACE_Module. | |
virtual int | link (ACE_Stream< ACE_SYNCH_USE > &) |
Create a pipe between two Streams. | |
virtual int | unlink (void) |
Remove a pipe formed between two Streams. | |
virtual int | put (ACE_Message_Block *mb, ACE_Time_Value *timeout=0) |
virtual int | get (ACE_Message_Block *&mb, ACE_Time_Value *timeout=0) |
virtual int | control (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds cmd, void *args) |
Send control message down the stream. | |
virtual int | wait (void) |
Synchronize with the final close of the stream. | |
virtual void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Private Member Functions | |
int | unlink_i (void) |
int | link_i (ACE_Stream< ACE_SYNCH_USE > &) |
int | push_module (ACE_Module< ACE_SYNCH_USE > *, ACE_Module< ACE_SYNCH_USE > *=0, ACE_Module< ACE_SYNCH_USE > *=0) |
Must a new module onto the Stream. | |
Private Attributes | |
ACE_Module< ACE_SYNCH_USE > * | stream_head_ |
Pointer to the head of the stream. | |
ACE_Module< ACE_SYNCH_USE > * | stream_tail_ |
Pointer to the tail of the stream. | |
ACE_Stream< ACE_SYNCH_USE > * | linked_us_ |
Pointer to an adjoining linked stream. | |
ACE_SYNCH_MUTEX_T | lock_ |
Protect the stream against race conditions. | |
ACE_SYNCH_CONDITION_T | final_close_ |
Use to tell all threads waiting on the close that we are done. | |
Friends | |
class | ACE_Stream_Iterator<ACE_SYNCH_USE> |
A Stream consists of a stack of <ace_modules>, each of which contains two <ace_tasks>. Even though the methods in this class are virtual, this class isn't really intended for subclassing unless you know what you are doing. In particular, the <ace_stream> destructor calls <close>, which won't be overridden properly unless you call it in a subclass destructor.
|
|
|
Create a Stream consisting of <head> and <tail> as the Stream head and Stream tail, respectively. If these are 0 then the <ace_stream_head> and <ace_stream_tail> are used, respectively. <arg> is the value past in to the <open> methods of the tasks. |
|
Close down the stream and release all the resources.
|
|
Close down the stream and release all the resources.
|
|
Send control message down the stream.
|
|
Dump the state of an object.
|
|
Find a particular ACE_Module.
|
|
Read the message <mb> that is stored in the stream head. Wait for upto <timeout> amount of absolute time for the operation to complete (or block forever if <timeout> == 0). |
|
Return current stream head.
|
|
Insert a new module <mod> below the named module <prev_name>.
|
|
Create a pipe between two Streams.
|
|
Actually perform the linking of two Streams (must be called with locks held). |
|
Create a Stream consisting of <head> and <tail> as the Stream head and Stream tail, respectively. If these are 0 then the <ace_stream_head> and <ace_stream_tail> are used, respectively. <arg> is the value past in to the <open> methods of the tasks. |
|
are invoked to cleanup the tasks.
|
|
Add a new module <mod> right below the Stream head. The <open()> hook methods of the <ace_tasks> in this <ace_module> are invoked to initialize the tasks. |
|
Must a new module onto the Stream.
|
|
Send the message <mb> down the stream, starting at the Module below the Stream head. Wait for upto <timeout> amount of absolute time for the operation to complete (or block forever if <timeout> == 0). |
|
Remove the named module <mod> from the stream. This bypasses the strict LIFO ordering of <push> and <pop>. |
|
Replace the named module <replace_name> with a new module <mod>.
|
|
Return current stream tail.
|
|
Return the top module on the stream (right below the stream head). |
|
Remove a pipe formed between two Streams.
|
|
Actually perform the unlinking of two Streams (must be called with locks held). |
|
Synchronize with the final close of the stream.
|
|
|
|
Declare the dynamic allocation hooks.
|
|
Use to tell all threads waiting on the close that we are done.
|
|
Pointer to an adjoining linked stream.
|
|
Protect the stream against race conditions.
|
|
Pointer to the head of the stream.
|
|
Pointer to the tail of the stream.
|