source: main/trunk/greenstone2/runtime-src/src/colservr/collectset.h@ 21455

Last change on this file since 21455 was 21455, checked in by ak19, 14 years ago

Major bug fix after Dr Bainbridge debugged the server code which was causing the server to crash upon Enter Library: the line where it failed was simply where a local-scope text_t object was being naturally destructed. The real error was a memory corruption which the use of the new heapchk function helped to locate: collectset's inherited method configure() ought to have been specified as virtual, since it was declared virtual in the superclass configurable. A couple of destructors (in collectset and oaiservr's oaiconfig) have been made virtual as well since the superclass configurable has virtual methods which requires all related destructors to be virtual.

  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
RevLine 
[1860]1/************************************************************
2 *
3 * Collection set
4 *
5 ************************************************************/
6
7#ifndef COLLECTSET_H
8#define COLLECTSET_H
9
10#include "collectserver.h"
11#include "cnfgable.h"
[21324]12
13#ifdef ENABLE_MG
[2549]14#include "mgsearch.h"
[21324]15#endif
16#ifdef ENABLE_MGPP
[2549]17#include "mgppsearch.h"
[21324]18#endif
19#ifdef ENABLE_LUCENE
[8028]20#include "lucenesearch.h"
[21324]21#endif
[1860]22
23class collectset : public configurable
24{
25 protected:
26 collectservermapclass cservers;
[21324]27#ifdef ENABLE_MG
[2545]28 mgsearchclass *mgsearch;
[21324]29#endif
30#ifdef ENABLE_MGPP
[2545]31 mgppsearchclass *mgppsearch;
[21324]32#endif
33#ifdef ENABLE_LUCENE
[8028]34 lucenesearchclass *lucenesearch;
[21324]35#endif
36
[1860]37 text_t httpdomain;
38 text_t httpprefix;
39
40 public:
[16310]41 collectset(text_t& gsdlhome, text_t& collecthome);
[17989]42
43 // this constructor is used by the Firefox Greenstone
44 collectset(text_t& httpprefix_arg);
45
[1886]46 // this constructor is used by the local library
[19365]47 collectset();
[1886]48
[21455]49 virtual ~collectset();
[1860]50
51 // initialise the collections
52 bool init(ostream &logout);
53
54 // configure all the servers as supplied
[21455]55 virtual void configure (const text_t &key, const text_tarray &cfgline);
[1860]56
57 // Add/remove collections
[16310]58 void add_all_collections (const text_t &gsdlhome, const text_t& collecthome);
[9028]59 void remove_all_collections ();
[15002]60
61 void remove_collection (const text_t &collection);
62 void remove_collection (const text_t &collection, ostream& logout);
[9028]63
64 void add_collection (const text_t &collection,
[16310]65 const text_t &gsdlhome,
66 const text_t& collecthome);
[1860]67
[15002]68 void add_collection_group(const text_t& collection,
[16310]69 const text_t& gsdlhome,
70 const text_t& collecthome);
[15002]71
[16310]72 void add_all_collection_groups (const text_t& gsdlhome,
73 const text_t& collecthome);
74
[1860]75 // return the total number of servers in the set
76 int size();
77
78 void getCollectionList(text_tarray &collist);
79
80 // return the component map
81 collectservermapclass servers();
82
83 // return an individual collection server
84 collectserver *getCollectServer(const text_t &collection)
85 {
86 return cservers.getcollectserver(collection);
87 }
[21453]88
89 protected:
90 bool collection_is_collect_group (const text_t& collect_dir);
[1860]91};
92
93#endif
Note: See TracBrowser for help on using the repository browser.