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

Pipe.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    Pipe.h
00006  *
00007  *  $Id: Pipe.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Doug Schmidt
00010  */
00011 //==========================================================================
00012 
00013 
00014 #ifndef ACE_PIPE_H
00015 #define ACE_PIPE_H
00016 
00017 #include "ace/pre.h"
00018 
00019 #include "ace/ACE_export.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #include "ace/OS.h"
00026 
00027 /**
00028  * @class ACE_Pipe
00029  *
00030  * @brief Provides a bidirectional "pipe" abstraction that is portable
00031  * to Windows NT, SVR4 UNIX, and BSD UNIX.
00032  *
00033  * Uses "name" for lookup in the ACE service repository. Obtains
00034  * the object and returns it as the appropriate type.
00035  */
00036 class ACE_Export ACE_Pipe
00037 {
00038 public:
00039   // = Initialization and termination.
00040   /// Default constructor (does nothing...).
00041   ACE_Pipe (void);
00042 
00043   /// Open the pipe and initialize the handles.
00044   ACE_Pipe (ACE_HANDLE handles[2]);
00045 
00046   /// Initialize the <ACE_Pipe> from the <read> and <write> handles.
00047   ACE_Pipe (ACE_HANDLE read, ACE_HANDLE write);
00048 
00049   /// Default dtor.  It doesn't close the handles for you.
00050   ~ACE_Pipe (void);
00051 
00052   /// Open the pipe and initialize the handles.
00053   int open (ACE_HANDLE handles[2]);
00054 
00055   /// Open the pipe, setting the buffer size to the maximum.
00056   int open (int buffer_size = ACE_DEFAULT_MAX_SOCKET_BUFSIZ);
00057 
00058   /// Close down the pipe HANDLEs;
00059   int close (void);
00060 
00061   // = Accessors.
00062 
00063   /**
00064    * This is the "read" side of the pipe.  Note, however, that
00065    * processes can also write to this handle as well since pipes are
00066    * bi-directional.
00067    */
00068   ACE_HANDLE read_handle (void) const;
00069 
00070   /**
00071    * This is the "write" side of the pipe.  Note, however, that
00072    * processes can also read to this handle as well since pipes are
00073    * bi-directional.
00074    */
00075   ACE_HANDLE write_handle (void) const;
00076 
00077   /// Dump the state of the object.
00078   void dump (void) const;
00079 
00080 private:
00081   ACE_HANDLE handles_[2];
00082 };
00083 
00084 #if !defined (ACE_LACKS_INLINE_FUNCTIONS)
00085 #include "ace/Pipe.i"
00086 #endif /* ACE_LACKS_INLINE_FUNCTIONS */
00087 
00088 #include "ace/post.h"
00089 
00090 #endif /* ACE_PIPE_H */

Generated on Mon Jun 16 11:20:49 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002