00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file IPC_SAP.h 00006 * 00007 * $Id: IPC_SAP.h 77114 2007-02-14 08:55:20Z johnnyw $ 00008 * 00009 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef ACE_IPC_SAP_H 00014 #define ACE_IPC_SAP_H 00015 #include /**/ "ace/pre.h" 00016 00017 #include "ace/Flag_Manip.h" 00018 #include "ace/os_include/sys/os_types.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00025 00026 /** 00027 * @class ACE_IPC_SAP 00028 * 00029 * @brief Defines the member functions for the base class of the 00030 * ACE_IPC_SAP abstraction. 00031 */ 00032 class ACE_Export ACE_IPC_SAP 00033 { 00034 public: 00035 00036 /// Interface for <ioctl>. 00037 int control (int cmd, void *) const; 00038 00039 // = Common I/O handle options related to sockets. 00040 00041 /** 00042 * Enable asynchronous I/O (ACE_SIGIO), urgent data (ACE_SIGURG), 00043 * non-blocking I/O (ACE_NONBLOCK), or close-on-exec (ACE_CLOEXEC), 00044 * which is passed as the @a value. 00045 */ 00046 int enable (int value) const; 00047 00048 /** 00049 * Disable asynchronous I/O (ACE_SIGIO), urgent data (ACE_SIGURG), 00050 * non-blocking I/O (ACE_NONBLOCK), or close-on-exec (ACE_CLOEXEC), 00051 * which is passed as the @a value. 00052 */ 00053 int disable (int value) const; 00054 00055 /// Get the underlying handle. 00056 ACE_HANDLE get_handle (void) const; 00057 00058 /// Set the underlying handle. 00059 void set_handle (ACE_HANDLE handle); 00060 00061 /// Dump the state of an object. 00062 void dump (void) const; 00063 00064 /// Declare the dynamic allocation hooks. 00065 ACE_ALLOC_HOOK_DECLARE; 00066 00067 protected: 00068 00069 // = Ensure that ACE_IPC_SAP is an abstract base class. 00070 /// Default constructor. 00071 ACE_IPC_SAP (void); 00072 00073 /// Protected destructor. 00074 /** 00075 * Not a virtual destructor. Protected destructor to prevent 00076 * operator delete() from being called through a base class 00077 * ACE_IPC_SAP pointer/reference. 00078 */ 00079 ~ACE_IPC_SAP (void); 00080 00081 private: 00082 /// Underlying I/O handle. 00083 ACE_HANDLE handle_; 00084 00085 /// Cache the process ID. 00086 static pid_t pid_; 00087 }; 00088 00089 ACE_END_VERSIONED_NAMESPACE_DECL 00090 00091 #if defined (__ACE_INLINE__) 00092 #include "ace/IPC_SAP.inl" 00093 #endif /* __ACE_INLINE__ */ 00094 00095 #include /**/ "ace/post.h" 00096 #endif /* ACE_IPC_SAP_H */