Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ATM_Stream.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    ATM_Stream.h
00006  *
00007  *  $Id: ATM_Stream.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Joe Hoffert
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_ATM_STREAM_H
00015 #define ACE_ATM_STREAM_H
00016 #include "ace/pre.h"
00017 
00018 #include "ace/config-all.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #if defined (ACE_HAS_ATM)
00025 
00026 #include "ace/ATM_Addr.h"
00027 #include "ace/ATM_Params.h"
00028 
00029 #if defined (ACE_WIN32)
00030 #include "SOCK_Stream.h"
00031 typedef ACE_SOCK_Stream ATM_Stream;
00032 #else
00033 #include "TLI_Stream.h"
00034 typedef ACE_TLI_Stream ATM_Stream;
00035 #endif
00036 
00037 /**
00038  * @class ACE_ATM_Stream
00039  *
00040  * @brief Defines the member functions for ACE_ATM_Stream abstraction.
00041  */
00042 class ACE_Export ACE_ATM_Stream
00043 {
00044 public:
00045   // = Initialization and termination methods.
00046   /// Default constructor.
00047   ACE_ATM_Stream (void);
00048 
00049   // = ATM-specific open and shutdown operations.
00050   /// open the stream.
00051   int open (ACE_ATM_Params params = ACE_ATM_Params());
00052 
00053   /// Close down and release resources.
00054   int close (void);
00055 
00056   /// Get the underlying handle.
00057   ACE_HANDLE get_handle (void) const;
00058 
00059   /// Get the underlying stream.
00060   ATM_Stream& get_stream (void);
00061 
00062   /// Get the name of the connected host.
00063   char* get_peer_name (void) const;
00064 
00065   /// Get the VPI and VCI of the stream.
00066   int get_vpi_vci (ACE_UINT16 &vpi,
00067                    ACE_UINT16 &vci) const;
00068 
00069   /// Recv an n byte buffer from the connected transport mechanism.
00070   ssize_t recv (void *buf,
00071                 size_t n,
00072                 int *flags = 0) const;
00073 
00074   /// Send exactly n bytes to the connected transport mechanism.
00075   ssize_t send_n (const void *buf,
00076                   size_t n,
00077                   int flags) const;
00078 
00079   // = Meta-type info
00080   typedef ACE_ATM_Addr PEER_ADDR;
00081 
00082   /// Dump the state of an object.
00083   void dump (void) const;
00084 
00085   /// Declare the dynamic allocation hooks.
00086   ACE_ALLOC_HOOK_DECLARE;
00087 
00088 private:
00089   /// Typedef'd to the appropriate stream mechanism above.
00090   ATM_Stream stream_;
00091 };
00092 
00093 #if defined (__ACE_INLINE__)
00094 #include "ace/ATM_Stream.i"
00095 #endif /* __ACE_INLINE__ */
00096 
00097 #endif /* ACE_HAS_ATM */
00098 #include "ace/post.h"
00099 #endif /* ACE_ATM_STREAM_H */

Generated on Mon Jun 16 11:19:09 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002