Use override/default for RTPortableServer
[ACE_TAO.git] / ACE / ace / MEM_Stream.h
blobc9e6e5a23300e849cdbec478ee0e4b9770c3bc31
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file MEM_Stream.h
7 * @author Nanbor Wang <nanbor@cs.wustl.edu>
8 */
9 //=============================================================================
12 #ifndef ACE_MEM_STREAM_H
13 #define ACE_MEM_STREAM_H
15 #include /**/ "ace/pre.h"
17 #include /**/ "ace/ACE_export.h"
19 #include "ace/MEM_IO.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1)
27 #include "ace/INET_Addr.h"
29 #if !defined (ACE_MEM_STREAM_MIN_BUFFER)
30 # define ACE_MEM_STREAM_MIN_BUFFER 4096
31 #endif /* ACE_MEM_STREAM_MIN_BUFFER */
33 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
35 class ACE_MEM_Acceptor;
36 class ACE_MEM_Connector;
38 /**
39 * @class ACE_MEM_Stream
41 * @brief Defines the methods in the ACE_MEM_Stream abstraction.
43 * This adds additional wrapper methods atop the ACE_MEM_IO
44 * class. Notice that ACE_MEM_Stream can only send messages no bigger
45 * than the underlying MMAP file size minus sizeof (ACE_MEM_SAP_Node).
46 * The size of the MMAP file is default to ACE_MEM_STREAM_MIN_BUFFER.
47 * (Define above in this file, to 4096 bytes.)
48 * If you need to increase the size of allowable message
49 * ACE_MEM_Stream can handle, you can set it to either
50 * @c ACE_MEM_Acceptor::malloc_options(). minimal_bytes_
51 * @c ACE_MEM_Acceptor::init_buffer_size (size_t size);
52 * before establishing a connection.
54 class ACE_Export ACE_MEM_Stream : public ACE_MEM_IO
56 public:
57 friend class ACE_MEM_Acceptor;
58 friend class ACE_MEM_Connector;
60 // Initialization and termination methods.
61 /// Constructor.
62 ACE_MEM_Stream ();
64 /// Constructor (sets the underlying ACE_HANDLE with <h>).
65 ACE_MEM_Stream (ACE_HANDLE h);
67 /// Destructor.
68 ~ACE_MEM_Stream ();
70 //= The following two methods use write and read system calls.
71 /// Send n bytes, keep trying until n are sent.
72 /// Recv n bytes, keep trying until n are received.
73 ssize_t send_n (const void *buf, size_t n);
74 ssize_t recv_n (void *buf, size_t n);
76 // = The following two methods use the send and recv system calls.
77 /// Send n bytes, keep trying until n are sent.
78 /// Recv n bytes, keep trying until n are received.
79 ssize_t send_n (const void *buf, size_t n, int flags);
80 ssize_t recv_n (void *buf, size_t n, int flags);
82 // = Selectively close endpoints.
84 /// Close down the reader.
85 int close_reader ();
87 /// Close down the writer.
88 int close_writer ();
90 /**
91 * Close down the socket (we need this to make things work correctly
92 * on Win32, which requires use to do a <close_writer> before doing
93 * the close to avoid losing data).
95 int close ();
97 // = Meta-type info
98 typedef ACE_Addr PEER_ADDR;
100 /// Dump the state of an object.
101 void dump () const;
103 /// Declare the dynamic allocation hooks.
104 ACE_ALLOC_HOOK_DECLARE;
107 ACE_END_VERSIONED_NAMESPACE_DECL
109 #if defined (__ACE_INLINE__)
110 #include "ace/MEM_Stream.inl"
111 #endif /* __ACE_INLINE__ */
113 #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */
115 #include /**/ "ace/post.h"
116 #endif /* ACE_MEM_STREAM_H */