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

This class is the primary abstraction for the ASX framework. It is moduled after System V Stream. More...

#include <Stream.h>

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

Public Types

enum  { M_DELETE = 3 }
 

Public Member Functions

 ACE_Stream (void *arg=0, ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *head=0, ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *tail=0)
 
virtual int open (void *arg, ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *head=0, ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *tail=0)
 
virtual int close (int flags=M_DELETE)
 Close down the stream and release all the resources.
 
virtual ~ACE_Stream ()
 Close down the stream and release all the resources.
 
virtual int push (ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *mod)
 
virtual int pop (int flags=M_DELETE)
 Remove the mod right below the Stream head and close it down.
 
virtual int top (ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *&mod)
 
virtual int insert (const ACE_TCHAR *prev_name, ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *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, TIME_POLICY > *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, TIME_POLICY > * head ()
 Return current stream head.
 
virtual ACE_Module< ACE_SYNCH_USE, TIME_POLICY > * tail ()
 Return current stream tail.
 
virtual ACE_Module< ACE_SYNCH_USE, TIME_POLICY > * find (const ACE_TCHAR *mod)
 Find a particular ACE_Module.
 
virtual int link (ACE_Stream< ACE_SYNCH_USE, TIME_POLICY > &)
 Create a pipe between two Streams.
 
virtual int unlink ()
 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 ()
 Synchronize with the final close of the stream.
 
virtual void dump () const
 Dump the state of an object.
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Protected Attributes

ACE_Module< ACE_SYNCH_USE, TIME_POLICY > * stream_head_
 Pointer to the head of the stream.
 
ACE_Module< ACE_SYNCH_USE, TIME_POLICY > * stream_tail_
 Pointer to the tail of the stream.
 
ACE_Stream< ACE_SYNCH_USE, TIME_POLICY > * linked_us_
 Pointer to an adjoining linked stream.
 
ACE_SYNCH_MUTEX_T lock_
 Protect the stream against race conditions.
 
ACE_Condition_Attributes_T< TIME_POLICYcond_attr_
 Attributes to initialize condition with.
 
ACE_SYNCH_CONDITION_T final_close_
 Use to tell all threads waiting on the close that we are done.
 

Private Member Functions

int unlink_i ()
 
int link_i (ACE_Stream< ACE_SYNCH_USE, TIME_POLICY > &)
 
int push_module (ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *, ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *=0, ACE_Module< ACE_SYNCH_USE, TIME_POLICY > *=0)
 Must a new module onto the Stream.
 

Friends

class ACE_Stream_Iterator< ACE_SYNCH_USE, TIME_POLICY >
 

Detailed Description

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

This class is the primary abstraction for the ASX framework. It is moduled after System V Stream.

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.

Member Enumeration Documentation

◆ anonymous enum

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
anonymous enum
Enumerator
M_DELETE 

Indicates that close() deletes the Tasks. Don't change this value without updating the same enum in class ACE_Module...

Constructor & Destructor Documentation

◆ ACE_Stream()

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.

◆ ~ACE_Stream()

Close down the stream and release all the resources.

Member Function Documentation

◆ close()

int ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::close ( int flags = M_DELETE)
virtual

Close down the stream and release all the resources.

◆ control()

Send control message down the stream.

◆ dump()

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

Dump the state of an object.

◆ find()

Find a particular ACE_Module.

◆ get()

int ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::get ( ACE_Message_Block *& mb,
ACE_Time_Value * timeout = 0 )
virtual

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

◆ head()

Return current stream head.

◆ insert()

int ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::insert ( const ACE_TCHAR * prev_name,
ACE_Module< ACE_SYNCH_USE, TIME_POLICY > * mod )
virtual

Insert a new module mod below the named module prev_name.

◆ link()

Create a pipe between two Streams.

◆ link_i()

Actually perform the linking of two Streams (must be called with locks held).

◆ open()

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.

◆ pop()

Remove the mod right below the Stream head and close it down.

are invoked to cleanup the tasks.

◆ push()

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.

◆ push_module()

Must a new module onto the Stream.

◆ put()

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()

int ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::remove ( const ACE_TCHAR * mod,
int flags = M_DELETE )
virtual

Remove the named module mod from the stream. This bypasses the strict LIFO ordering of push and pop.

◆ replace()

int ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::replace ( const ACE_TCHAR * replace_name,
ACE_Module< ACE_SYNCH_USE, TIME_POLICY > * mod,
int flags = M_DELETE )
virtual

Replace the named module replace_name with a new module mod.

◆ tail()

Return current stream tail.

◆ top()

Return the top module on the stream (right below the stream head).

◆ unlink()

Remove a pipe formed between two Streams.

◆ unlink_i()

int ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::unlink_i ( )
private

Actually perform the unlinking of two Streams (must be called with locks held).

◆ wait()

int ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::wait ( )
inlinevirtual

Synchronize with the final close of the stream.

Friends And Related Symbol Documentation

◆ ACE_Stream_Iterator< ACE_SYNCH_USE, TIME_POLICY >

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
friend class ACE_Stream_Iterator< ACE_SYNCH_USE, TIME_POLICY >
friend

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

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

Declare the dynamic allocation hooks.

◆ cond_attr_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
ACE_Condition_Attributes_T<TIME_POLICY> ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::cond_attr_
protected

Attributes to initialize condition with.

◆ final_close_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
ACE_SYNCH_CONDITION_T ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::final_close_
protected

Use to tell all threads waiting on the close that we are done.

◆ linked_us_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
ACE_Stream<ACE_SYNCH_USE, TIME_POLICY>* ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::linked_us_
protected

Pointer to an adjoining linked stream.

◆ lock_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
ACE_SYNCH_MUTEX_T ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::lock_
mutableprotected

Protect the stream against race conditions.

◆ stream_head_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
ACE_Module<ACE_SYNCH_USE, TIME_POLICY>* ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::stream_head_
protected

Pointer to the head of the stream.

◆ stream_tail_

template<ACE_SYNCH_DECL , class TIME_POLICY = ACE_System_Time_Policy>
ACE_Module<ACE_SYNCH_USE, TIME_POLICY>* ACE_Stream< ACE_SYNCH_DECL, TIME_POLICY >::stream_tail_
protected

Pointer to the tail of the stream.


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