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

Last change on this file since 21455 was 21455, checked in by ak19, 12 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
Line 
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"
12
13#ifdef ENABLE_MG
14#include "mgsearch.h"
15#endif
16#ifdef ENABLE_MGPP
17#include "mgppsearch.h"
18#endif
19#ifdef ENABLE_LUCENE
20#include "lucenesearch.h"
21#endif
22
23class collectset : public configurable
24{
25 protected:
26 collectservermapclass cservers;
27#ifdef ENABLE_MG
28 mgsearchclass *mgsearch;
29#endif
30#ifdef ENABLE_MGPP
31 mgppsearchclass *mgppsearch;
32#endif
33#ifdef ENABLE_LUCENE
34 lucenesearchclass *lucenesearch;
35#endif
36
37 text_t httpdomain;
38 text_t httpprefix;
39
40 public:
41 collectset(text_t& gsdlhome, text_t& collecthome);
42
43 // this constructor is used by the Firefox Greenstone
44 collectset(text_t& httpprefix_arg);
45
46 // this constructor is used by the local library
47 collectset();
48
49 virtual ~collectset();
50
51 // initialise the collections
52 bool init(ostream &logout);
53
54 // configure all the servers as supplied
55 virtual void configure (const text_t &key, const text_tarray &cfgline);
56
57 // Add/remove collections
58 void add_all_collections (const text_t &gsdlhome, const text_t& collecthome);
59 void remove_all_collections ();
60
61 void remove_collection (const text_t &collection);
62 void remove_collection (const text_t &collection, ostream& logout);
63
64 void add_collection (const text_t &collection,
65 const text_t &gsdlhome,
66 const text_t& collecthome);
67
68 void add_collection_group(const text_t& collection,
69 const text_t& gsdlhome,
70 const text_t& collecthome);
71
72 void add_all_collection_groups (const text_t& gsdlhome,
73 const text_t& collecthome);
74
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 }
88
89 protected:
90 bool collection_is_collect_group (const text_t& collect_dir);
91};
92
93#endif
Note: See TracBrowser for help on using the repository browser.