summaryrefslogtreecommitdiff
path: root/ACE/examples/Web_Crawler/URL.h
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/examples/Web_Crawler/URL.h')
-rw-r--r--ACE/examples/Web_Crawler/URL.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/ACE/examples/Web_Crawler/URL.h b/ACE/examples/Web_Crawler/URL.h
new file mode 100644
index 00000000000..68c41f018ad
--- /dev/null
+++ b/ACE/examples/Web_Crawler/URL.h
@@ -0,0 +1,82 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// examples/Web_Crawler
+//
+// = FILENAME
+// URL.h
+//
+// = AUTHOR
+// Douglas C. Schmidt <schmidt@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef _URL_H
+#define _URL_H
+
+#include "Mem_Map_Stream.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "URL_Addr.h"
+#include "URL_Status.h"
+
+#include "ace/SString.h"
+
+
+// Forward declaration.
+class URL_Visitor;
+
+class URL
+{
+ // = TITLE
+ // Base class for a URL.
+ //
+ // = DESCRIPTION
+ // This class plays a role in the Visitor pattern.
+public:
+ virtual ~URL (void);
+ // Destructor.
+
+ virtual int accept (URL_Visitor *visitor) = 0;
+ // Accept the visitor, which will then perform a particular
+ // visitation strategy on the URL. This method is part of the
+ // Visitor pattern.
+
+ virtual ssize_t send_request (void) = 0;
+ // Send a <GET> command to fetch the contents in the URI from the
+ // server.
+
+ virtual const ACE_URL_Addr &url_addr (void) const = 0;
+ // Returns the URL that we represent.
+
+ virtual Mem_Map_Stream &stream (void);
+ // Returns the <Mem_Map_Stream>.
+
+ // = Get/set the reply status.
+ virtual const URL_Status &reply_status (void);
+ virtual void reply_status (const URL_Status &);
+
+ // = Get/set the reply status.
+ virtual const ACE_CString &content_type (void);
+ virtual void content_type (const ACE_CString &);
+
+
+
+private:
+ URL_Status reply_status_;
+ // Reply status of the URL.
+
+ ACE_CString content_type_;
+ // Content-type of the URL.
+
+ Mem_Map_Stream stream_;
+ // Contents of the stream.
+};
+
+#endif /* _URL_H */