00001 /* -*- C++ -*- */ 00002 00003 //============================================================================= 00004 /** 00005 * @file ATM_Stream.h 00006 * 00007 * ATM_Stream.h,v 4.14 2005/10/28 16:14:51 ossama 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 "ace/SOCK_Stream.h" 00031 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00032 typedef ACE_SOCK_Stream ATM_Stream; 00033 ACE_END_VERSIONED_NAMESPACE_DECL 00034 #else 00035 #include "ace/TLI_Stream.h" 00036 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00037 typedef ACE_TLI_Stream ATM_Stream; 00038 ACE_END_VERSIONED_NAMESPACE_DECL 00039 #endif 00040 00041 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00042 00043 /** 00044 * @class ACE_ATM_Stream 00045 * 00046 * @brief Defines the member functions for ACE_ATM_Stream abstraction. 00047 */ 00048 class ACE_Export ACE_ATM_Stream 00049 { 00050 public: 00051 // = Initialization and termination methods. 00052 /// Default constructor. 00053 ACE_ATM_Stream (void); 00054 00055 // = ATM-specific open and shutdown operations. 00056 /// open the stream. 00057 int open (ACE_ATM_Params params = ACE_ATM_Params()); 00058 00059 /// Close down and release resources. 00060 int close (void); 00061 00062 /// Get the underlying handle. 00063 ACE_HANDLE get_handle (void) const; 00064 00065 /// Get the underlying stream. 00066 ATM_Stream& get_stream (void); 00067 00068 /// Get the name of the connected host. 00069 char* get_peer_name (void) const; 00070 00071 /// Get the VPI and VCI of the stream. 00072 int get_vpi_vci (ACE_UINT16 &vpi, 00073 ACE_UINT16 &vci) const; 00074 00075 /// Recv an n byte buffer from the connected transport mechanism. 00076 ssize_t recv (void *buf, 00077 size_t n, 00078 int *flags = 0) const; 00079 00080 /// Send exactly n bytes to the connected transport mechanism. 00081 ssize_t send_n (const void *buf, 00082 size_t n, 00083 int flags) const; 00084 00085 // = Meta-type info 00086 typedef ACE_ATM_Addr PEER_ADDR; 00087 00088 /// Dump the state of an object. 00089 void dump (void) const; 00090 00091 /// Declare the dynamic allocation hooks. 00092 ACE_ALLOC_HOOK_DECLARE; 00093 00094 private: 00095 /// Typedef'd to the appropriate stream mechanism above. 00096 ATM_Stream stream_; 00097 }; 00098 00099 ACE_END_VERSIONED_NAMESPACE_DECL 00100 00101 #if defined (__ACE_INLINE__) 00102 #include "ace/ATM_Stream.inl" 00103 #endif /* __ACE_INLINE__ */ 00104 00105 #endif /* ACE_HAS_ATM */ 00106 #include /**/ "ace/post.h" 00107 #endif /* ACE_ATM_STREAM_H */