summaryrefslogtreecommitdiff
path: root/ace/ATM_Stream.i
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
commite349c40fd5806b0e4abe68a48b661405fbb6b78c (patch)
tree86edb2eb7bea85bb26aa258e676fcbe76791dc03 /ace/ATM_Stream.i
parent78380acd0bb8175d147832e6c39a4cafc07460b3 (diff)
downloadATCD-e349c40fd5806b0e4abe68a48b661405fbb6b78c.tar.gz
Adding new classes to wrap ATM functionality
Diffstat (limited to 'ace/ATM_Stream.i')
-rw-r--r--ace/ATM_Stream.i110
1 files changed, 110 insertions, 0 deletions
diff --git a/ace/ATM_Stream.i b/ace/ATM_Stream.i
new file mode 100644
index 00000000000..567d68d7da9
--- /dev/null
+++ b/ace/ATM_Stream.i
@@ -0,0 +1,110 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ATM_Stream.i
+
+#include "ace/ATM_Stream.h"
+
+ACE_INLINE
+ACE_ATM_Stream::ACE_ATM_Stream (void)
+{
+ ACE_TRACE ("ACE_ATM_Stream::ACE_ATM_Stream");
+}
+
+ACE_INLINE
+int
+ACE_ATM_Stream::open (ACE_ATM_Params params)
+{
+ ACE_TRACE ("ACE_ATM_Stream::open");
+#if defined (ACE_HAS_FORE_ATM_XTI)
+ ACE_HANDLE handle = stream_.open (params.get_device(),
+ params.get_oflag(),
+ params.get_info());
+ return (handle == ACE_INVALID_HANDLE ? -1 : 0);
+#elif defined (ACE_HAS_FORE_ATM_WS2)
+ return stream_.open (params.get_type(),
+ params.get_protocol_family(),
+ params.get_protocol(),
+ params.get_reuse_addr());
+#else
+ ACE_UNUSED_ARG(params);
+ return 0;
+#endif /* ACE_HAS_FORE_ATM_XTI */
+}
+
+ACE_INLINE
+int
+ACE_ATM_Stream::close (void)
+{
+ ACE_TRACE ("ACE_ATM_Stream::close");
+#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2)
+ return stream_.close ();
+#else
+ return 0;
+#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 */
+}
+
+ACE_INLINE
+ACE_HANDLE
+ACE_ATM_Stream::get_handle (void) const
+{
+ ACE_TRACE ("ACE_ATM_Stream::get_handle");
+#if defined (ACE_HAS_FORE_ATM_XTI) || defined (ACE_HAS_FORE_ATM_WS2)
+ return stream_.get_handle ();
+#else
+ return 0;
+#endif /* ACE_HAS_FORE_ATM_XTI || ACE_HAS_FORE_ATM_WS2 */
+}
+
+ACE_INLINE
+ATM_Stream&
+ACE_ATM_Stream::get_stream (void)
+{
+ ACE_TRACE ("ACE_ATM_Stream::get_stream");
+ return stream_;
+}
+
+ACE_INLINE
+ssize_t
+ACE_ATM_Stream::recv (void *buf,
+ size_t n,
+ int *flags) const
+{
+ ACE_TRACE ("ACE_ATM_Stream::recv");
+#if defined (ACE_HAS_FORE_ATM_XTI)
+ return stream_.recv (buf,
+ n,
+ flags);
+#elif defined (ACE_HAS_FORE_ATM_WS2)
+ return stream_.recv (buf,
+ n);
+#else
+ ACE_UNUSED_ARG(buf);
+ ACE_UNUSED_ARG(n);
+ ACE_UNUSED_ARG(flags);
+ return (0);
+#endif /* ACE_HAS_FORE_ATM_XTI */
+}
+
+ACE_INLINE
+ssize_t
+ACE_ATM_Stream::send_n (const void *buf,
+ size_t n,
+ int flags) const
+{
+ ACE_TRACE ("ACE_ATM_Stream::send_n");
+#if defined (ACE_HAS_FORE_ATM_XTI)
+ return stream_.send_n (buf,
+ n,
+ flags);
+#elif defined (ACE_HAS_FORE_ATM_WS2)
+ return stream_.send_n (buf,
+ n,
+ flags);
+#else
+ ACE_UNUSED_ARG(buf);
+ ACE_UNUSED_ARG(n);
+ ACE_UNUSED_ARG(flags);
+ return (0);
+#endif /* ACE_HAS_FORE_ATM_XTI */
+}