// $Id: $ #include "Options.h" #include "URL_Visitor_Factory.h" #include "Web_Crawler.h" Web_Crawler::~Web_Crawler (void) { delete this->url_visitor_factory_; } Web_Crawler::Web_Crawler (void) : url_visitor_factory_ (0) { } int Web_Crawler::open (int argc, char *argv[]) { if (OPTIONS::instance ()->parse_args (argc, argv) == -1) return -1; // @@ Put the ACE_Service_Config::open() stuff here somewhere... else { // For now just hardcode this to create "validation" visitors. ACE_NEW_RETURN (this->url_visitor_factory_, URL_Validation_Visitor_Factory, -1); return 0; } } int Web_Crawler::run (void) { // Make the appropriate . Auto_Destroyer visitor (this->url_visitor_factory_->make_visitor ()); if (*visitor == 0) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "make_visitor"), -1); // Make the appropriate . Auto_Destroyer cp (this->url_visitor_factory_->make_command_processor ()); if (*cp == 0) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "make_command_processor"), -1); // Set the in the to make it visible. OPTIONS::instance ()->command_processor (*cp); // Set the in the to make it visible. OPTIONS::instance ()->visitor (*visitor); // @@ You fill in here... return 0; }