diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/ace/Name_Proxy.h | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/ace/Name_Proxy.h')
-rw-r--r-- | ACE/ace/Name_Proxy.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/ACE/ace/Name_Proxy.h b/ACE/ace/Name_Proxy.h new file mode 100644 index 00000000000..16411b17334 --- /dev/null +++ b/ACE/ace/Name_Proxy.h @@ -0,0 +1,101 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Name_Proxy.h + * + * $Id$ + * + * Proxy for dealing with remote server process managing NET_LOCAL + * Name_Bindings. + * + * + * @author Gerhard Lenzer + * @author Douglas C. Schmidt + * @author Prashant Jain + */ +//============================================================================= + + +#ifndef ACE_NAME_PROXY_H +#define ACE_NAME_PROXY_H +#include /**/ "ace/pre.h" + +#include "ace/INET_Addr.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/SOCK_Connector.h" +#include "ace/SOCK_Stream.h" +#include "ace/Service_Config.h" +#include "ace/Synch_Options.h" +#include "ace/Name_Request_Reply.h" +#include "ace/Event_Handler.h" + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +/** + * @class ACE_Name_Proxy + * + * @brief Proxy for dealing with remote server process managing NET_LOCAL + * NameBindings. + * + * Shields applications from details of interacting with the + * ACE_Name Server. + */ +class ACE_Export ACE_Name_Proxy : public ACE_Event_Handler +{ +public: + /// Default constructor. + ACE_Name_Proxy (void); + + // = Establish a binding with the ACE_Name Server. + ACE_Name_Proxy (const ACE_INET_Addr &remote_addr, // Address of ACE_Name Server. + ACE_Synch_Options& options = + ACE_Synch_Options::defaults); + + int open (const ACE_INET_Addr &remote_addr, // Address of ACE_Name Server. + ACE_Synch_Options& options = + ACE_Synch_Options::defaults); + + /// Perform the request and wait for the reply. + int request_reply (ACE_Name_Request &request); + + /// Perform the request. + int send_request (ACE_Name_Request &request); + + /// Receive the reply. + int recv_reply (ACE_Name_Request &reply); + + /// Obtain underlying handle. + virtual ACE_HANDLE get_handle (void) const; + + /// Close down the connection to the server. + virtual ~ACE_Name_Proxy (void); + + /// Dump the state of the object; + void dump (void) const; + +private: + + /// ACE_Connector factory used to establish connections actively. + ACE_SOCK_Connector connector_; + + /// Connection to ACE_Name Server peer. + ACE_SOCK_Stream peer_; + + /// Pointer to ACE_Reactor (used if we are run in "reactive-mode"). + ACE_Reactor *reactor_; + +private: + // Prevent copying + ACE_Name_Proxy (const ACE_Name_Proxy &); + ACE_Name_Proxy &operator= (const ACE_Name_Proxy &); +}; + +ACE_END_VERSIONED_NAMESPACE_DECL + +#include /**/ "ace/post.h" +#endif /* ACE_NAME_PROXY_H */ |