~ubuntu-branches/ubuntu/edgy/lurker/edgy

« back to all changes in this revision

Viewing changes to libesort/Master.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Meurer
  • Date: 2004-09-26 16:27:51 UTC
  • Revision ID: james.westby@ubuntu.com-20040926162751-z1ohcjltv7ojtg6z
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  $Id: Master.h,v 1.5 2003/05/07 15:43:13 terpstra Exp $
 
2
 *  
 
3
 *  Master.h - Coordinate commit+read interface
 
4
 *  
 
5
 *  Copyright (C) 2002 - Wesley W. Terpstra
 
6
 *  
 
7
 *  License: GPL
 
8
 *  
 
9
 *  Authors: 'Wesley W. Terpstra' <wesley@terpstra.ca>
 
10
 *  
 
11
 *    This program is free software; you can redistribute it and/or modify
 
12
 *    it under the terms of the GNU General Public License as published by
 
13
 *    the Free Software Foundation; version 2.1.
 
14
 *    
 
15
 *    This program is distributed in the hope that it will be useful,
 
16
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 *    GNU General Public License for more details.
 
19
 *    
 
20
 *    You should have received a copy of the GNU General Public License
 
21
 *    along with this program; if not, write to the Free Software
 
22
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
23
 */
 
24
 
 
25
#ifndef MASTER_H
 
26
#define MASTER_H
 
27
 
 
28
#include "esort.h"
 
29
#include "Memory.h"
 
30
#include "View.h"
 
31
#include "DbMan.h"
 
32
 
 
33
namespace ESort
 
34
{
 
35
 
 
36
class Transaction;
 
37
 
 
38
class Master : public Writer
 
39
{
 
40
 protected:
 
41
        View    view;
 
42
        Memory  memory;
 
43
        DbMan   man;
 
44
 
 
45
 public:
 
46
        Master(const Parameters& p);
 
47
        ~Master();
 
48
        
 
49
        int init(const string& db, int mode);
 
50
        
 
51
        int commit();
 
52
        int insert(const string& k);
 
53
 
 
54
        auto_ptr<Walker> seek(const string& k, Direction dir);
 
55
        auto_ptr<Walker> seek(const string& pfx, const string& k, Direction dir);
 
56
};
 
57
 
 
58
}
 
59
 
 
60
#endif