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

Endpoint.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Endpoint.h
00006  *
00007  *  $Id: Endpoint.h,v 1.1.1.2 2003/02/21 18:36:44 chad Exp $
00008  *
00009  * Endpoint interface, part of TAO pluggable protocol framework.
00010  *
00011  *
00012  *  @author Marina Spivak <marina@cs.wustl.edu>
00013  */
00014 //=============================================================================
00015 
00016 
00017 #ifndef TAO_ENDPOINT_H
00018 #define TAO_ENDPOINT_H
00019 #include "ace/pre.h"
00020 
00021 #include "tao/corbafwd.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #include "ace/Synch_T.h"
00028 
00029 
00030 /**
00031  * @class TAO_Endpoint
00032  *
00033  * @brief Defines the Endpoint interface in the Pluggable Protocol
00034  * framework.
00035  *
00036  * Lightweight encapsulation of addressing information for a
00037  * single acceptor endpoint.  In other words, Endpoint represents
00038  * a single point of contact for the server, and is the smallest
00039  * unit of addressing information necessary for a client to connect
00040  * to a server.
00041  * A Profile contains one or more Endpoints, i.e., knows of
00042  * one or more ways to contact server(s).
00043  */
00044 class TAO_Export TAO_Endpoint
00045 {
00046 public:
00047   /// Constructor.
00048   TAO_Endpoint (CORBA::ULong tag,
00049                 CORBA::Short priority = TAO_INVALID_PRIORITY);
00050 
00051   /// Destructor.
00052   virtual ~TAO_Endpoint (void);
00053 
00054   /// IOP protocol tag accessor.
00055   CORBA::ULong tag (void) const;
00056 
00057   /// <priority_> attribute setter.
00058   void priority (CORBA::Short priority);
00059 
00060   /// <priority_> attribute getter.
00061   CORBA::Short priority (void) const;
00062 
00063   // = Abstract methods to be implemented by concrete subclasses.
00064 
00065   /// Return true if this endpoint is equivalent to <other_endpoint>.  Two
00066   /// endpoints are equivalent iff their port and host are the same.
00067   virtual CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint) = 0;
00068 
00069   /// Endpoints can be stringed in a list.  Return the next endpoint in
00070   /// the list, if any.
00071   virtual TAO_Endpoint *next (void) = 0;
00072 
00073   /**
00074    * Return a string representation for the address.  Returns
00075    * -1 if buffer is too small.  The purpose of this method is to
00076    * provide a general interface to the underlying address object's
00077    * addr_to_string method.  This allows the protocol implementor to
00078    * select the appropriate string format.
00079    */
00080   virtual int addr_to_string (char *buffer, size_t length) = 0;
00081 
00082   /// This method is used when a connection has been reset, requiring
00083   /// the hint to be cleaned up and reset to NULL.
00084   virtual void reset_hint (void) = 0;
00085 
00086   /// This method returns a copy of the corresponding endpoints by
00087   /// allocation memory
00088   virtual TAO_Endpoint *duplicate (void) = 0;
00089 
00090   /// Return a hash value for this object.
00091   virtual CORBA::ULong hash (void) = 0;
00092 
00093 protected:
00094 
00095   /// Lock for the address lookup.
00096   /// @@todo: This lock should be strategised so that we dont lock in
00097   /// single threaded configurations. I am not able to do this now as
00098   /// most of the information is available in the ORB_Core which is
00099   /// not available here...
00100   TAO_SYNCH_MUTEX addr_lookup_lock_;
00101 
00102 private:
00103 
00104   /// Endpoints should not be copied.
00105   ACE_UNIMPLEMENTED_FUNC (TAO_Endpoint (const TAO_Endpoint&))
00106   ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Endpoint&))
00107 
00108   /// IOP tag, identifying the protocol for which this endpoint
00109   /// contains addressing info.
00110   CORBA::ULong tag_;
00111 
00112   /**
00113    * CORBA priority of the acceptor this Endpoint is representing.
00114    * This is part of TAO 'prioritized endpoints' architecture, and is
00115    * currently used for RTCORBA only.
00116    */
00117   CORBA::Short priority_;
00118 
00119 
00120 };
00121 
00122 #if defined (__ACE_INLINE__)
00123 # include "tao/Endpoint.i"
00124 #endif /* __ACE_INLINE__ */
00125 
00126 #include "ace/post.h"
00127 #endif  /* TAO_PROFILE_H */

Generated on Mon Jun 16 13:48:22 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002