diff options
author | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-08-18 11:21:07 +0000 |
---|---|---|
committer | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-08-18 11:21:07 +0000 |
commit | d9033014d2befb99e000ad38fbe8fa5cc8f62c39 (patch) | |
tree | d502627224d1b2bd5d1126627ee3901e2b4f00b5 /apps | |
parent | 5d52ad33806f7fc0611f91a7ef8556be23a88dc8 (diff) | |
download | ATCD-d9033014d2befb99e000ad38fbe8fa5cc8f62c39.tar.gz |
*** empty log message ***
Diffstat (limited to 'apps')
-rw-r--r-- | apps/JAWS/clients/Caching/Location_Server.cpp | 17 | ||||
-rw-r--r-- | apps/JAWS/clients/Caching/Location_Server.h | 122 | ||||
-rw-r--r-- | apps/JAWS/clients/Caching/Location_Server.i | 23 | ||||
-rw-r--r-- | apps/JAWS/clients/Caching/Web_Locator.cpp | 79 | ||||
-rw-r--r-- | apps/JAWS/clients/Caching/Web_Locator.h | 251 | ||||
-rw-r--r-- | apps/JAWS/clients/Caching/Web_Locator.i | 223 |
6 files changed, 0 insertions, 715 deletions
diff --git a/apps/JAWS/clients/Caching/Location_Server.cpp b/apps/JAWS/clients/Caching/Location_Server.cpp deleted file mode 100644 index bbb6b07a753..00000000000 --- a/apps/JAWS/clients/Caching/Location_Server.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// Location_Server.cpp -// $Id$ - -#if !defined (ACE_LOCATION_SERVER_C) -#define ACE_LOCATION_SERVER_C - -#define ACE_BUILD_DLL -#include "Location_Server.h" - -#if !defined (__ACE_INLINE__) -#include "Location_Server.i" -#endif /* __ACE_INLINE__ */ - -// @@ Nanbor, please make sure that you add the template -// specializations that are necessary to get this to work with GCC. - -#endif /* ACE_LOCATION_SERVER_C */ diff --git a/apps/JAWS/clients/Caching/Location_Server.h b/apps/JAWS/clients/Caching/Location_Server.h deleted file mode 100644 index a1cbea01165..00000000000 --- a/apps/JAWS/clients/Caching/Location_Server.h +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// none -// -// = FILENAME -// Location_Server.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#if !defined (ACE_LOCATION_SERVER_H) -#define ACE_LOCATION_SERVER_H - -#include "ace/Containers.h" -#include "Web_Locator.h" - -class ACE_URL_Record - // = TITLE - // An offer record in the offer repository. - // - // = DESCRIPTION - // This class holds an offer record in offer repository -{ -public: - ACE_URL_Record (ACE_URL_OfferID id, ACE_URL_Offer &offer); - // Construct an URL record. - - ~ACE_URL_Record (void) const; - // Destructor. - - ACE_URL_OfferID id (void); - // Get internal id string. - - void id (ACE_URL_OfferID id); - // Set id string. - -Protected: - ACE_URL_OfferID id_; - // Offer ID of this record. - - ACE_URL_Offer offer_; - // URL Offer in this record. -}; - -typedef ACE_Unbounded_Queue<ACE_URL_Record> ACE_URL_Repository; -typedef ACE_Unbounded_Queue_Iterator<ACE_URL_Record> ACE_URL_Repository_Iterator; - -class ACE_Location_Service - // = TITLE - // Location Servers maintain a collection of offers other URL - // servers willing to provide. - // - // = DESCRIPTION - // This class implements the location server's end point. Clients - // connect to it to query offer information. Providers (servers) - // connect to it to register their offer. -{ -public: - ACE_URL_OfferID export (ACE_URL_Offer &offer); - // Register an offer to the location server. Operation will fail if - // there is an offer with identical URL string exist in the - // repository and the function returns NULL. On success, it returns - // an OfferID. - - int query (const ACE_Specified_Property how, - const ACE_URL_Property_Seq *pseq, - const int how_many, - ACE_URL_Offer_Seq *offer); - // Query the offer repository whether there are offers that match - // our requirement specified in <how> and <pseq>. Create an offer - // sequence that contains at most <how_many> offers in it. Offers - // are picked out from the beginning. So if there are too many - // offers that meet our requirement, some may never get picked. On - // success, the function return 0, non-zero indicates error - // condition. - - int withdraw (const ACE_URL_OfferID offer); - // Withdraw an image offer. return 0 if succeed, -1 otherwise (most - // likely, there isn't an offer with id:<offer>. - - ACE_URL_Offer *describe (const ACE_URL_OfferID offer); - // Query a specific offer. This function returns a pointer points - // to the ACE_URL_Offer field with corresponding <offer> id. - - int modify (const ACE_URL_OfferID offer, - const char *url = 0, - const ACE_URL_Property_Seq *del = 0, - const ACE_URL_Property_Seq *modify = 0); - // Modify an already registered offer. If <url> != 0, the URL of - // the offer will be replaced by string pointed by <url>. <del> - // points to a sequence of properties to be delete from the offer. - // <modify> points to a sequence of properties to be modified. It - // this offer contains a property with the same name, the value of - // this property will be replaced by the new value. If the offer - // doesn't contain the same property, this property will be added to - // the offer. - -protected: - ACE_URL_Repository repository_; - // URL back store. - - u_long id_counter_; - // This number is used to maintain the uniqueness of OfferID. An - // offer ID is derived from concatenating two strings. First number - // is the ASCII representation of number from ACE_OS::time() and the - // second number is the ASCII representation of <id_counter_>. The - // <id_counter_> get incremented everytime a new offer ID is - // generated. The length of Offer ID is yet to be determined. -}; - -#if define (__ACE_INLINE__) -#include "Location_Server.i" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_LOCATION_SERVER_H */ diff --git a/apps/JAWS/clients/Caching/Location_Server.i b/apps/JAWS/clients/Caching/Location_Server.i deleted file mode 100644 index 433dc65abc5..00000000000 --- a/apps/JAWS/clients/Caching/Location_Server.i +++ /dev/null @@ -1,23 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -ACE_INLINE ACE_URL_OfferID -ACE_URL_Record::id (void) const -{ - return this->id_; -} - -ACE_INLINE void -ACE_URL_Record::id (ACE_URL_OfferID id) -{ - delete [] this->id_; - - if (id) - { - ACE_NEW (this->id_, TCHAR[ACE_OS::strlen (id) + 1]); - ACE_OS::strcpy (this->id_, id); - } - else - this->id_ = 0; -} diff --git a/apps/JAWS/clients/Caching/Web_Locator.cpp b/apps/JAWS/clients/Caching/Web_Locator.cpp deleted file mode 100644 index 31bcc4c6cdf..00000000000 --- a/apps/JAWS/clients/Caching/Web_Locator.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// Web_Locator.cpp -// $Id$ - -#if !defined (ACE_WEB_LOCATOR_C) -#define ACE_WEB_LOCATOR_C - -#define ACE_BUILD_DLL -#include "Web_Locator.h" - -#if !defined (__ACE_INLINE__) -#include "Web_Locator.i" -#endif /* __ACE_INLINE__ */ - -ACE_URL_Locator::ACE_URL_Locator (ACE_HANDLE handle, - const ACE_Time_Value &timeout) - : errno_ (0), - timeout_ (timeout), - handle_ (handle) -{ -} - -int -ACE_URL_Locator_Query::query (const ACE_Specified_Property how, - const ACE_URL_Property_Seq *pseq, - const int how_many, - ACE_URL_Offer_Seq *offer) -{ - // First send out request - - // Then, receive offers or error code. - - return -1; -} - -ACE_URL_OfferID -ACE_URL_Locator_Register::export (const ACE_URL_Offer *img) -{ - // Set Registration request - - // Receive an ID or an error code. - - return 0; -} - - -int -ACE_URL_Locator_Register::withdraw (const ACE_URL_OfferID offer) -{ - // Send request - - // Recieve a success/fail result - - return -1; -} - -ACE_URL_Offer * -ACE_URL_Locator_Register::describe (const ACE_URL_OfferID offer) -{ - // Send request - - // Receive and construct an offer - return 0; -} - -int -ACE_URL_Locator_Register::modify (const ACE_URL_OfferID offer, - const char *url, - const ACE_URL_Property_Seq *del, - const ACE_URL_Property_Seq *modify) -{ - // Send modification request - - // Receive a succeess/fail result - return -1; -} - -// @@ Nanbor, please make sure that you add the template -// specializations that are necessary to get this to work with GCC. -#endif /* ACE_WEB_LOCATOR_C */ diff --git a/apps/JAWS/clients/Caching/Web_Locator.h b/apps/JAWS/clients/Caching/Web_Locator.h deleted file mode 100644 index f8ea9cd67ca..00000000000 --- a/apps/JAWS/clients/Caching/Web_Locator.h +++ /dev/null @@ -1,251 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// none -// -// = FILENAME -// Web_Locator.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -// @@ Nanbor, should we change this name from "Web_Locator" to -// "Content_Locator" or "URL_Locator"? It seems like "Web" is too general! - -#if !defined (ACE_WEB_LOCATOR_H) -#define ACE_WEB_LOCATOR_H - -#include "ace/OS.h" -#include "ace/Array.h" - -class ACE_Export ACE_URL_Property - // = TITLE - // Defines a property of a URL. - // - // = DESCRIPTION - // A property contains a <name> and a <value>. -{ -public: - ACE_URL_Property (LPCTSTR name = 0, LPCTSTR value=0); - // Create a property. - - ACE_URL_Property (ACE_URL_Property &p); - // Copy constructor. - - ~ACE_URL_Property (void); - // Destructor. - - ACE_URL_Property &operator= (ACE_URL_Property &rhs); - // Assignment operator. - - int operator== (ACE_URL_Property &rhs) const; - // Equals operator. - - int operator!= (ACE_URL_Property &rhs) const; - // Not equals operator. - - LPCTSTR name (void) const; - // Query property name. - - void name (LPCTSTR name); - // Set property name. - - LPCTSTR value (void) const; - // Query property value. - - void value (LPCTSTR value); - // Set property value. - -protected: - LPTSTR name_; - // Property name pointer. - - LPTSTR value_; - // Property value. -} ; - -typedef ACE_Array<ACE_URL_Property> ACE_URL_Property_Seq; - -class ACE_Export ACE_URL_Offer - // = TITLE - // Defines a URL offer. - // - // = DESCRIPTION - // A URL offer is defined by an <url> and an - // <ACE_URL_Property_Seq>. -{ -public: - ACE_URL_Offer (LPCTSTR url, ACE_URL_Property_Seq &prop_seq); - // Create an offer. - - ACE_URL_Offer (ACE_URL_Offer &o); - // Copy ctor. - - ~ACE_URL_Offer (void); - // Default destructor. - - ACE_URL_Offer &operator= (ACE_URL_Offer &rhs); - // Assignment operator. - - int operator== (ACE_URL_Offer &rhs) const; - // Equality operator. - - int operator!= (ACE_URL_Offer &rhs) const; - // Inequality operator. - - LPCTSTR url (void) const; - // Get URL string. - - Void url (LPCTSTR url); - // Set URL. - - ACE_URL_Property_Seq &url_properties (void); - // Get properties of this offer. - - void url_properties (ACE_URL_Property_Seq &prop); - // Set properties of this offer. - -protected: - char *url_; - // URL of this offer. - - ACE_URL_Property_Seq prop_; - // Properties associate with this offer. - -private: - // @@ Nanbor, please make sure you move this definition into the *.cpp file. - ACE_URL_Offer (void) {} - // Do not allow access to default constructor -}; - -typedef ACE_Array<ACE_URL_Offer> ACE_URL_Offer_Seq; -typedef char *ACE_URL_OfferID; - -class ACE_Export ACE_URL_Locator - // = TITLE - // Base class for the URL locator. - // - // = DESCRIPTION - // This class provide an interface for clients to communicate - // with a URL locator thru a stream specified in <handle>. -{ -public: - enum ACE_Specified_Property - { - NONE, - SOME, - ALL - }; - // Specify how to select offers. - - Ace_Url_Locator (ACE_HANDLE handle = ACE_INVALID_HANDLE, - const ACE_Time_Value &timeout = ACE_Time_Value::zero); - // Try to "Bind" to a URL locator. - - ~ACE_URL_Locator (void); - // Default destructor. - - void set_timeout (const ACE_Time_Value &timeout); - // Set timeout value. - - ACE_Time_Value get_timeout (void) const; - // Get timeout value for this locator. - - void set_handle (ACE_HANDLE handle); - // Set the handle used to connect to locator. - - ACE_HANDLE get_handle (void) const; - // Get the handle used to connect to locator. - - LPCTSTR error_status (void); - // Provide detailed human readable error status. - -protected: - int errno_; - // Record operation error (to avoid using exception.) - - ACE_Time_Value timeout_; - // Timeout value when communicate with the connected location - // server. - - ACE_HANDLE handle_; - // Handle used to communicate with locator. -}; - -// @@ Nanbor, I'm not really sure why you are using inheritance here? -// Is this so that you don't have to reimplement the accessor methods -// in ACE_URL_Locator? There doesn't seem to be any virtual functions -// in the base class. Can you please explain this design choice to -// me?! - -class ACE_Export ACE_URL_Locator_Query : public ACE_URL_Locator - // = TITLE - // A query interface to locate a URL. - // - // = DESCRIPTION - // This class provide an interface for clients to - // query a URL locator with certain properties. -{ -public: - ACE_URL_Locator_Query (ACE_HANDLE handle = ACE_INVALID_HANDLE, - const ACE_Time_Value &timeout = ACE_Time_Value::zero); - // Try to "Bind" to a URL locator. - - ~ACE_URL_Locator_Query (void); - // Default destructor. - - int query (const ACE_Specified_Property how, - const ACE_URL_Property_Seq *pseq, - const int how_many, - ACE_URL_Offer_Seq *offer); - // Query the locator for HTTP with designate properties (none, some, - // or all). The locator being queried will return a sequence of - // offers with <how_many> offers in it. This interface allocates - // <offer> so users must deallocate it after use. -}; - -class ACE_Export ACE_URL_Locator_Register : public ACE_URL_Locator - // = TITLE - // This class provides interfaces for HTTP servers to export - // their services. - // - // = DESCRIPTION - // HTTP servers can use this class to register their offers to a - // URL locator so clients can locate resources provided by - // servers thru the locator. -{ -public: - ACE_URL_Locator_Register (ACE_HANDLE handle = ACE_INVALID_HANDLE, - const ACE_Time_Value &timeout = ACE_Time_Value::zero); - // Instantiate a registration interface to "locator." - - ~ACE_URL_Locator_Register (void); - // Default destructor. - - ACE_URL_OfferID export (const ACE_URL_Offer *offer); - // Export an offer to the locator. - - int withdraw (const ACE_URL_OfferID offer); - // Withdraw an offer. return 0 if succeed, -1 otherwise. - - ACE_URL_Offer *describe (const ACE_URL_OfferID offer); - // Query a specific offer. - - int modify (const ACE_URL_OfferID offer, - const char *url = 0, - const ACE_URL_Property_Seq *del = 0, - const ACE_URL_Property_Seq *modify = 0); - // Modify a previously registered offer. -}; - -#if defined (__ACE_INLINE__) -#include "Web_Locator.i" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_WEB_LOCATOR_H */ diff --git a/apps/JAWS/clients/Caching/Web_Locator.i b/apps/JAWS/clients/Caching/Web_Locator.i deleted file mode 100644 index 32919f5ad8b..00000000000 --- a/apps/JAWS/clients/Caching/Web_Locator.i +++ /dev/null @@ -1,223 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -ACE_INLINE -ACE_URL_Property::ACE_URL_Property (LPCTSTR name, LPCTSTR value) - : name_ (0), - value_ (0) -{ - this->name (name); - this->value (value); -} - -ACE_INLINE -ACE_URL_Property::ACE_URL_Property (ACE_URL_Property &p) - : name_ (0), - value_ (0) -{ - this->name (p.name ()); - this->value (p.value ()); -} - -ACE_INLINE -ACE_URL_Property::~ACE_URL_Property (void) -{ - delete[] this->name_; - delete[] this->value_; -} - -ACE_INLINE ACE_URL_Property & -ACE_URL_Property::operator= (ACE_URL_Property &rhs) -{ - if (this != &rhs) - { - this->name (rhs.name ()); - this->value (rhs.value ()); - } - return *this; -} - -ACE_INLINE int -ACE_URL_Property::operator== (ACE_URL_Property &rhs) const -{ - if (this == &rhs) - { - if (ACE_OS::strcmp (this->name (), rhs.name ()) || - ACE_OS::strcmp (this->value (), rhs.value ())) - return 0; - } - return 1; -} - -ACE_INLINE int -ACE_URL_Property::operator!= (ACE_URL_Property &rhs) const -{ - return !(*this == rhs); -} - -ACE_INLINE LPCTSTR -ACE_URL_Property::name (void) const -{ - return this->name_; -} - -ACE_INLINE void -ACE_URL_Property::name (LPCTSTR name) -{ - delete [] this->name_; - - if (name) - { - ACE_NEW (this->name_, TCHAR[ACE_OS::strlen (name) + 1]); - ACE_OS::strcpy (this->name_, name); - } - else - this->name_ = 0; -} - -ACE_INLINE LPCTSTR -ACE_URL_Property::value (void) const -{ - return this->value_; -} - -ACE_INLINE void -ACE_URL_Property::value (LPCTSTR value) -{ - delete [] this->value_; - - if (value) - { - ACE_NEW (this->value_, TCHAR[ACE_OS::strlen (value) + 1]); - ACE_OS::strcpy (this->value_, value); - } - else - this->value_ = 0; -} - -ACE_INLINE -ACE_URL_Offer::ACE_URL_Offer (LPCTSTR url, ACE_URL_Property_Seq &prop_seq) - : url_ (0), - prop_ (prop_seq) -{ - this->url (url); -} - -ACE_INLINE -ACE_URL_Offer::~ACE_URL_Offer (void) -{ - delete [] this->url_; -} - -ACE_INLINE ACE_URL_Offer & -ACE_URL_Offer::operator= (ACE_URL_Offer &rhs) -{ - if (this != &rhs) - { - this->url (rhs.url ()); - this->url_properties (rhs.url_properties ()); - } - return *this; -} - -ACE_INLINE int -ACE_URL_Offer::operator== (ACE_URL_Offer &rhs) const -{ - // @@ Nanbor, I reformatted this expression. Please make sure it is - // still correct! - - if (this != &rhs - && (ACE_OS::strcmp (this->url (), rhs.url ()) - || this->prop_ != rhs.url_properties ())) - return 0; - else - return 1; -} - -ACE_INLINE int -ACE_URL_Offer::operator!= (ACE_URL_Offer &rhs) const -{ - return !(*this == rhs); -} - -ACE_INLINE LPCTSTR -ACE_URL_Offer::url (void) const -{ - return this->url_; -} - -ACE_INLINE void -ACE_URL_Offer::url (LPCTSTR url) -{ - delete [] this->url_; - - if (url != 0) - { - ACE_NEW (this->url_, TCHAR[ACE_OS::strlen (url) + 1]); - ACE_OS::strcpy (this->url_, url); - } - else - this->url_ = 0; -} - -ACE_INLINE ACE_URL_Property_Seq & -ACE_URL_Offer::url_properties (void) -{ - return this->prop_; -} - -ACE_INLINE void -ACE_URL_Offer::url_properties (ACE_URL_Property_Seq &prop) -{ - if (&this->prop_ != &prop) - this->prop_ = prop; -} - -ACE_INLINE void -ACE_URL_Locator::set_timeout (const ACE_Time_Value &timeout) -{ - this->timeout_ = timeout; -} - -ACE_INLINE ACE_Time_Value -ACE_URL_Locator::get_timeout (void) const -{ - return this->timeout_; -} - -ACE_INLINE void -ACE_URL_Locator::set_handle (ACE_HANDLE handle) -{ - this->handle_ = handle ; -} - -ACE_INLINE ACE_HANDLE -ACE_URL_Locator::get_handle (void) const -{ - return this->handle_; -} - -ACE_INLINE -ACE_URL_Locator_Query::ACE_URL_Locator_Query (ACE_HANDLE handle, - const ACE_Time_Value &timeout) - : ACE_URL_Locator (handle, timeout) -{ -} - -ACE_INLINE -ACE_URL_Locator_Query::~ACE_URL_Locator_Query (void) -{ -} - -ACE_INLINE -ACE_URL_Locator_Register::ACE_URL_Locator_Register (ACE_HANDLE handle, - const ACE_Time_Value &timeout) - : ACE_URL_Locator (handle, timeout) -{ -} - -ACE_INLINE -ACE_URL_Locator_Register::~ACE_URL_Locator_Register (void) -{ -} |