Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / Web_Crawler / HTTP_URL.h
blob817a5f1119e75cf613ade5b8319d6dbf2b800f9a
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file HTTP_URL.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 */
9 //=============================================================================
12 #ifndef _HTTP_URL_H
13 #define _HTTP_URL_H
15 #include "URL_Status.h"
16 #include "URL.h"
17 #include "Options.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 /**
24 * @class HTTP_URL
26 * @brief An ADT for an HTTP URL.
28 * This class plays the "element" role in the Visitor pattern.
30 class HTTP_URL : public URL
32 public:
33 /**
34 * The <url_addr> is the URL that we're going to be visiting. We
35 * also keep track of the containing page, if any, which is used to
36 * print out more meaningful messages.
38 HTTP_URL (const ACE_URL_Addr &url_addr,
39 HTTP_URL *containing_page = 0);
41 /**
42 * Accept the visitor, which will then perform a particular
43 * visitation strategy on the URL. This method is part of the
44 * Visitor pattern.
46 virtual int accept (URL_Visitor *visitor);
48 /// Send a <GET> command to fetch the contents in the URI from the
49 /// server.
50 virtual ssize_t send_request ();
52 /// Returns the URL that we represent.
53 virtual const ACE_URL_Addr &url_addr () const;
55 /// Commit suicide
56 int destroy ();
57 private:
58 /// Address of the URL we're connected to.
59 ACE_URL_Addr url_addr_;
61 /// Page that contained us.
62 HTTP_URL *containing_page_;
65 #endif /* _HTTP_URL_H */