summaryrefslogtreecommitdiff
path: root/ace/ATM_Stream.h
diff options
context:
space:
mode:
authorjoeh <joeh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-02 23:38:04 +0000
committerjoeh <joeh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-08-02 23:38:04 +0000
commit3e4b479e4600f95e4ad37d313cb4bfc93d829bb4 (patch)
tree86edb2eb7bea85bb26aa258e676fcbe76791dc03 /ace/ATM_Stream.h
parentf8fd150adae009332d50e0d788aa1da8a9de1c8f (diff)
downloadATCD-3e4b479e4600f95e4ad37d313cb4bfc93d829bb4.tar.gz
Adding new classes to wrap ATM functionality
Diffstat (limited to 'ace/ATM_Stream.h')
-rw-r--r--ace/ATM_Stream.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/ace/ATM_Stream.h b/ace/ATM_Stream.h
new file mode 100644
index 00000000000..5519247ee90
--- /dev/null
+++ b/ace/ATM_Stream.h
@@ -0,0 +1,85 @@
+/* -*- C++ -*- */
+// $Id$
+
+
+// ============================================================================
+//
+// = LIBRARY
+// ace
+//
+// = FILENAME
+// ATM_Stream.h
+//
+// = AUTHOR
+// Joe Hoffert
+//
+// ============================================================================
+
+#ifndef ACE_ATM_STREAM_H
+#define ACE_ATM_STREAM_H
+
+#include "ace/ATM_Addr.h"
+#include "ace/ATM_Params.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_ATM)
+
+#if defined (ACE_WIN32)
+#include "SOCK_Stream.h"
+typedef ACE_SOCK_Stream ATM_Stream;
+#else
+#include "TLI_Stream.h"
+typedef ACE_TLI_Stream ATM_Stream;
+#endif
+
+class ACE_Export ACE_ATM_Stream
+{
+ // = TITLE
+ // Defines the member functions for ACE_ATM_Stream abstraction.
+public:
+ // = Initialization and termination methods.
+ ACE_ATM_Stream (void);
+ // Default constructor.
+
+ // = ATM-specific open and shutdown operations.
+ int open (ACE_ATM_Params params = ACE_ATM_Params());
+ // open the stream.
+ int close (void);
+ // Close down and release resources.
+
+ ACE_HANDLE get_handle (void) const;
+ // Get the underlying handle.
+
+ ATM_Stream& get_stream (void);
+ // Get the underlying stream.
+
+ char* get_peer_name (void) const;
+ // Get the name of the connected host.
+
+ ssize_t recv (void *buf, size_t n, int *flags = 0) const;
+ // Recv an n byte buffer from the connected transport mechanism
+
+ ssize_t send_n (const void *buf, size_t n, int flags) const;
+ // Send exactly n bytes to the connected transport mechanism
+
+ // = Meta-type info
+ typedef ACE_ATM_Addr PEER_ADDR;
+
+ void dump (void) const;
+ // Dump the state of an object.
+
+ ACE_ALLOC_HOOK_DECLARE;
+ // Declare the dynamic allocation hooks.
+
+private:
+ ATM_Stream stream_;
+ // Typedef'd to the appropriate stream mechanism above
+};
+
+#include "ace/ATM_Stream.i"
+
+#endif /* ACE_HAS_ATM */
+#endif /* ACE_ATM_STREAM_H */