Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / Web_Crawler / URL.h
blob796c7bf6fd2c30dade54c5307edf5aca7b9ec571
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file URL.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 */
9 //=============================================================================
12 #ifndef _URL_H
13 #define _URL_H
15 #include "Mem_Map_Stream.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "URL_Addr.h"
22 #include "URL_Status.h"
24 #include "ace/SString.h"
27 // Forward declaration.
28 class URL_Visitor;
30 /**
31 * @class URL
33 * @brief Base class for a URL.
35 * This class plays a role in the Visitor pattern.
37 class URL
39 public:
40 /// Destructor.
41 virtual ~URL ();
43 /**
44 * Accept the visitor, which will then perform a particular
45 * visitation strategy on the URL. This method is part of the
46 * Visitor pattern.
48 virtual int accept (URL_Visitor *visitor) = 0;
50 /// Send a <GET> command to fetch the contents in the URI from the
51 /// server.
52 virtual ssize_t send_request () = 0;
54 /// Returns the URL that we represent.
55 virtual const ACE_URL_Addr &url_addr () const = 0;
57 /// Returns the <Mem_Map_Stream>.
58 virtual Mem_Map_Stream &stream ();
60 // = Get/set the reply status.
61 virtual const URL_Status &reply_status ();
62 virtual void reply_status (const URL_Status &);
64 // = Get/set the reply status.
65 virtual const ACE_CString &content_type ();
66 virtual void content_type (const ACE_CString &);
69 private:
70 /// Reply status of the URL.
71 URL_Status reply_status_;
73 /// Content-type of the URL.
74 ACE_CString content_type_;
76 /// Contents of the stream.
77 Mem_Map_Stream stream_;
80 #endif /* _URL_H */