Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / SPIPE.h
bloba8b83666738045b86739eff7e6e924b09290bb1e
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file SPIPE.h
7 * @author Doug Schmidt
8 */
9 //=============================================================================
12 #ifndef ACE_SPIPE_H
13 #define ACE_SPIPE_H
14 #include /**/ "ace/pre.h"
16 #include "ace/IPC_SAP.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/SPIPE_Addr.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 /**
27 * @class ACE_SPIPE
29 * @brief Defines the member functions for the base class of the
30 * ACE_SPIPE abstraction.
32 * ACE_SPIPE was designed as a wrapper facade for STREAM pipes. On
33 * Windows, however, ACE_SPIPE is a wrapper for Named Pipes. Therefore,
34 * on Windows, it is better to use the ACE_Proactor or blocking operations
35 * in lieu of using the ACE_Reactor.
37 * @sa ACE_SPIPE_Acceptor for additional notes on use with ACE_Reactor
38 * on Windows.
40 * @warning Windows: Works only on Windows NT 4 and higher.
41 * @warning Works on non-Windows platforms only when @c ACE_HAS_STREAM_PIPES
42 * is defined.
44 class ACE_Export ACE_SPIPE : public ACE_IPC_SAP
46 public:
47 /// Close down the SPIPE without removing the rendezvous point.
48 /**
49 * Closes the underlying pipe handle and sets this object's handle value
50 * to @c ACE_INVALID_HANDLE.
51 * @return 0 for success; -1 for failure. If a failure occurs, further
52 * error information is available from ACE_OS::last_error().
54 int close ();
56 /// Close down the SPIPE and remove the rendezvous point from
57 /// the file system.
58 /**
59 * @return 0 for success; -1 for failure. If a failure occurs, further
60 * error information is available from ACE_OS::last_error().
62 int remove ();
64 /// Return the local address of this endpoint.
65 /**
66 * Returns the local address of the SPIPE's endpoint in @arg addr.
67 * @return 0 for success; -1 for failure. If a failure occurs, further
68 * error information is available from ACE_OS::last_error().
70 int get_local_addr (ACE_SPIPE_Addr &) const;
72 /**
73 * Disable signal @arg signum.
74 * @note This reimplements the inherited method from
75 * ACE_IPC_SAP. Since the signal actions do not make any sense on
76 * Windows, this method intercepts the call and NOPs it. On non-Windows,
77 * it is passed through to ACE_IPC_SAP::disable().
79 int disable (int signum) const ;
81 /// Dump the state of an object.
82 void dump () const;
84 #if defined (ACE_HAS_STREAM_PIPES)
85 /// Temporary store of duplex pipe handle.
86 void set_duplex_handle (ACE_HANDLE handle);
87 #endif /* ACE_HAS_STREAM_PIPES */
89 /// Declare the dynamic allocation hooks.
90 ACE_ALLOC_HOOK_DECLARE;
92 private:
93 #if defined (ACE_HAS_STREAM_PIPES)
94 /// Duplex to the pipe I/O handle.
95 /// Stored here for latter cleaning.
96 ACE_HANDLE duplex_pipe_handle_;
97 #endif /* ACE_HAS_STREAM_PIPES */
99 protected:
100 /// Ensure that this class is an abstract base class
101 ACE_SPIPE ();
103 /// Our local address.
104 ACE_SPIPE_Addr local_addr_;
107 ACE_END_VERSIONED_NAMESPACE_DECL
109 #if defined (__ACE_INLINE__)
110 #include "ace/SPIPE.inl"
111 #endif /* __ACE_INLINE__ */
113 #include /**/ "ace/post.h"
114 #endif /* ACE_SPIPE_H */