summaryrefslogtreecommitdiff
path: root/examples/Web_Crawler
diff options
context:
space:
mode:
authorbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-09-03 22:05:19 +0000
committerbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-09-03 22:05:19 +0000
commit43cf33b4bd359a677ccb75831f3bb346ef7e3fd3 (patch)
tree10dcb3e4c8c2ca881efa72412e6d56ed8e4d39b7 /examples/Web_Crawler
parentba901ebfa4cc69d3e18720fa7839fc9f3a00fb1d (diff)
downloadATCD-43cf33b4bd359a677ccb75831f3bb346ef7e3fd3.tar.gz
ChangeLogTag:Wed Sep 3 17:01:02 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
Diffstat (limited to 'examples/Web_Crawler')
-rw-r--r--examples/Web_Crawler/Mem_Map_Stream.h33
-rw-r--r--examples/Web_Crawler/URL_Visitor.h34
2 files changed, 37 insertions, 30 deletions
diff --git a/examples/Web_Crawler/Mem_Map_Stream.h b/examples/Web_Crawler/Mem_Map_Stream.h
index 9e6fed50598..845a2256212 100644
--- a/examples/Web_Crawler/Mem_Map_Stream.h
+++ b/examples/Web_Crawler/Mem_Map_Stream.h
@@ -16,12 +16,15 @@
#ifndef _MEM_MAP_STREAM_H
#define _MEM_MAP_STREAM_H
+#include /**/ "ace/pre.h"
+
+#include "ace/SOCK_Stream.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
-#pragma once
+#define once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/SOCK_Stream.h"
+
#include "ace/Mem_Map.h"
#include "ace/SOCK_Connector.h"
#include "ace/Connector.h"
@@ -33,7 +36,7 @@ class Mem_Map_Stream
{
// = TITLE
// Provides a memory-mapped stream abstraction to simplify parsing
- // of tokens.
+ // of tokens.
//
// = DESCRIPTION
// This class makes it possible to treat an connection as a stream
@@ -41,13 +44,13 @@ class Mem_Map_Stream
// of the connection are buffered incrementally in a memory-mapped
// file. This class maintains pointers to two positions in the
// stream:
- //
+ //
// 1. The <recv> position, which keeps track of the beginning of a
// token that is in the stream.
- //
+ //
// 2. The <get> position, which moves along character-by-character
// until the end of the token is reached.
- //
+ //
// Once a token has been located, it can be extracted from the
// stream by calling the <recv>. The length of the token, i.e.,
// the <recv_len>, is the length in bytes between the <get>
@@ -57,14 +60,14 @@ class Mem_Map_Stream
public:
typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> Svc_Handler;
-
+
typedef ACE_Strategy_Connector<Svc_Handler,
ACE_SOCK_CONNECTOR>
STRAT_CONNECTOR;
// Mem_Map_Stream (void);
// constructor added:KIRTHIKA
- virtual int open (STRAT_CONNECTOR *connector,
+ virtual int open (STRAT_CONNECTOR *connector,
const ACE_INET_Addr &);
// Initialize this object.
@@ -87,7 +90,7 @@ public:
// Return the next character in the stream and advance the <get>
// position. Returns EOF when the <get> position reaches the end of
// the HTTP stream.
-
+
virtual const char *recv (size_t &len);
// Returns a pointer to array of at most <len> characters starting
// at the <recv> position. If the <recv> position + <len> extends
@@ -126,7 +129,7 @@ public:
// Sets the <get> and <recv> positions as follows:
// o If <whence> is <SEEK_SET>, the positions are set to <offset>
// bytes from the start of the stream.
- //
+ //
// o If <whence> is <SEEK_CUR>, the positions are set to the
// current <get> position plus <offset>.
//
@@ -136,7 +139,7 @@ public:
virtual int eof (void) const;
// Returns 1 if we're at the end of the HTTP stream, else 0.
-
+
/*
typedef ACE_NOOP_Creation_Strategy<Svc_Handler>
NULL_CREATION_STRATEGY;
@@ -146,7 +149,7 @@ public:
ACE_SOCK_CONNECTOR,
ACE_SYNCH_NULL_MUTEX>
CACHED_CONNECT_STRATEGY;*/
-
+
Svc_Handler *svc_handler (void);
private:
@@ -156,7 +159,7 @@ private:
// EOF, else 0.
//ACE_SOCK_Stream stream_;
-
+
Svc_Handler *svc_handler_;
// Connection to peer. The granularity is at the Svc_Handler level.
// The Svc_Handler has an SOCK_Stream.
@@ -168,7 +171,7 @@ private:
CACHED_CONNECT_STRATEGY caching_connect_strategy_;
STRAT_CONNECTOR *strat_connector_; */
-
+
ACE_Mem_Map mem_map_;
// Memory-mapped file that we're iterating over.
@@ -184,5 +187,5 @@ private:
};
+#include /**/ "ace/post.h"
#endif /* _MEM_MAP_STREAM_H */
-
diff --git a/examples/Web_Crawler/URL_Visitor.h b/examples/Web_Crawler/URL_Visitor.h
index 508eed00bc4..4d25c8b732a 100644
--- a/examples/Web_Crawler/URL_Visitor.h
+++ b/examples/Web_Crawler/URL_Visitor.h
@@ -16,12 +16,15 @@
#ifndef _URL_VISITOR_H
#define _URL_VISITOR_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Strategies_T.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/Strategies_T.h"
+
#include "ace/Synch.h"
#include "HTTP_URL.h"
#include "Iterators.h"
@@ -217,7 +220,7 @@ public:
// @@
// virtual int visit (FTP_URL &http_url) = 0;
-
+
virtual int destroy (void) = 0;
// Cleanup the resources.
@@ -227,7 +230,7 @@ protected:
};
typedef int ATTRIBUTES;
-typedef ACE_Svc_Handler <ACE_SOCK_STREAM, ACE_NULL_SYNCH>
+typedef ACE_Svc_Handler <ACE_SOCK_STREAM, ACE_NULL_SYNCH>
Client_Svc_Handler;
typedef ACE_Pair<Client_Svc_Handler *, ATTRIBUTES>
CACHED_HANDLER;
@@ -287,7 +290,7 @@ class URL_Validation_Visitor : public URL_Visitor
// This class checks to make sure that the <HTTP_URL> is valid.
// If the <HTTP_URL> is an <HTML> file, it can also be used to
// recursively check that all embedded links in this file are
- // valid.
+ // valid.
public:
typedef ACE_Hash_Map_Manager <ACE_URL_Addr, URL_Status, ACE_Null_Mutex>
URL_CACHE;
@@ -304,7 +307,7 @@ public:
URL_Validation_Visitor (void);
virtual int destroy (void);
// Cleanup the resources.
-
+
URL_CACHE &url_cache (void);
// Returns a reference to the URL cache.
@@ -312,7 +315,7 @@ public:
/*
- typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
+ typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
Svc_Handler;
typedef ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>
STRAT_CONNECTOR;
@@ -327,23 +330,23 @@ public:
ACE_Pair<Svc_Handler *, int>,\
ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, \
ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>,\
- ACE_Null_Mutex>
+ ACE_Null_Mutex>
CONNECTION_HASH_MAP;
typedef ACE_Hash_Map_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDRESS,\
ACE_Pair<Svc_Handler *, int>,\
ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, \
ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>,\
- ACE_Null_Mutex>
+ ACE_Null_Mutex>
CONNECTION_HASH_MAP_ITERATOR;
typedef ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDRESS,\
ACE_Pair<Svc_Handler *, int>,\
ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>, \
ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDRESS>,\
- ACE_Null_Mutex>
+ ACE_Null_Mutex>
CONNECTION_HASH_MAP_REVERSE_ITERATOR;
typedef ACE_Pair_Caching_Utility <REFCOUNTED_HASH_RECYCLABLE_ADDRESS, \
ACE_Pair<Svc_Handler *, int>, \
- CONNECTION_HASH_MAP, CONNECTION_HASH_MAP_ITERATOR, int >
+ CONNECTION_HASH_MAP, CONNECTION_HASH_MAP_ITERATOR, int >
CACHING_STRATEGY_UTILITY;
typedef ACE_LRU_Caching_Strategy<REFCOUNTED_HASH_RECYCLABLE_ADDRESS,\
ACE_Pair<Svc_Handler *, int>,\
@@ -373,7 +376,7 @@ protected:
// connection.
CACHED_CONNECT_STRATEGY *caching_connect_strategy_;
- STRATEGY_CONNECTOR *strat_connector_;
+ STRATEGY_CONNECTOR *strat_connector_;
CACHING_STRATEGY caching_strategy_;
};
@@ -398,7 +401,7 @@ public:
virtual int destroy (void);
// Cleanup the resources.
-
+
protected:
URL_Visitation_Strategy_Factory *make_visitation_strategy_factory (URL &);
// Factory Method that makes a <URL_Download_Visitation_Strategy_Factory>.
@@ -419,19 +422,20 @@ public:
Auto_Destroyer (T *t): t_ (t) {}
T *operator-> (void) { return this->t_; }
T *operator *(void) { return this->t_; }
- void operator= (T *t)
+ void operator= (T *t)
{
if (this->t_ != 0)
this->t_->destroy ();
this->t_ = t;
}
- ~Auto_Destroyer (void)
+ ~Auto_Destroyer (void)
{
if (this->t_ != 0)
- t_->destroy ();
+ t_->destroy ();
}
private:
T *t_;
};
+#include /**/ "ace/post.h"
#endif /* _URL_VISITOR_H */