home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / OPipeCli.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  3KB  |  96 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OPipeCli.hpp
  5.  
  6. /*
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 1. Redistributions of source code must retain the above copyright
  11.  *    notice, this list of conditions and the following disclaimer.
  12.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  13.  *    endorse or promote products derived from this software
  14.  *    without specific prior written permission.
  15.  * 3. See OCL.INF for a detailed copyright notice.
  16.  *
  17.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  18.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  21.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27.  * SUCH DAMAGE.
  28.  */
  29.  
  30. // $Header: W:/Projects/OCL/Include/rcs/OPipeCli.hpp 1.50 1996/08/11 23:47:26 B.STEIN Release $
  31.  
  32. #ifndef OPIPECLI_INCLUDED
  33.   #define OPIPECLI_INCLUDED
  34.  
  35. #ifndef ONPIPE_INCLUDED
  36.   #include <ONPipe.hpp>
  37. #endif
  38.  
  39.  
  40. typedef class OPipeCli *pOPipeCli;   // a pipe Client
  41.  
  42.  
  43. class __CPP_EXPORT__ OPipeCli
  44.   : public ONPipe
  45. {
  46.  private:
  47.    BOOL              waitForInstance;
  48.  
  49.    BOOL
  50.       connectPipe    (PCSZ pipeName),
  51.       disconnectPipe ();
  52.  
  53.  public:
  54.    OThread<OPipeCli> pipeThread;
  55.    OString           Name;
  56.    HPIPE             Pipe;
  57.    BOOL              connected;
  58.  
  59.    OPipeCli         (const ULONG Size,
  60.                      const ULONG openMode = CLI_PIPE_OPEN_DEFAULT,
  61.                      const ULONG pipeMode = SVR_PIPE_PIPE_DEFAULT,
  62.                      const ULONG timeout = PIPE_TIMEOUT_DEFAULT,
  63.                      const BOOL  waitFor = FALSE);
  64.                           // if waitFor == TRUE
  65.                           // beginPiping() will return only
  66.                           // when a pipe instance became available
  67.                           // default is to return FALSE when no
  68.                           // pipe instance could be opened
  69.  
  70.    virtual
  71.       ~OPipeCli     ();
  72.  
  73.    virtual
  74.       PSZ isOfType  () const;
  75.  
  76.    void
  77.       setSize       (const ULONG Size);
  78.  
  79.    BOOL
  80.       beginPiping   (PCSZ pipeName),
  81.       stopPiping    (),
  82.       postPipe      (PVOID pvData, ULONG client = 0);  // unused
  83.  
  84.    void
  85.       Pipe_IO       ();
  86.  
  87.    virtual void
  88.       OPipeCommand  (PVOID pvData) = 0;
  89. };
  90.  
  91.  
  92.  
  93. #endif // OPIPECLI_INCLUDED
  94.  
  95. // end of source
  96.