~ubuntu-branches/ubuntu/raring/voxbo/raring

« back to all changes in this revision

Viewing changes to lib/dbdata.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2010-06-06 11:33:11 UTC
  • Revision ID: james.westby@ubuntu.com-20100606113311-v3c13imdkkd5n7ae
Tags: upstream-1.8.5~svn1172
ImportĀ upstreamĀ versionĀ 1.8.5~svn1172

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// dbdata.h
 
3
// header information for i/o functions
 
4
/* Simple class designed to hold env, DBs and global maps.
 
5
 * When it is used by remote client, env and DBs are not opened.
 
6
 * Maps are set up by data transferred from server. */
 
7
// Copyright (c) 1998-2010 by The VoxBo Development Team
 
8
 
 
9
// This file is part of VoxBo
 
10
// 
 
11
// VoxBo is free software: you can redistribute it and/or modify it
 
12
// under the terms of the GNU General Public License as published by
 
13
// the Free Software Foundation, either version 3 of the License, or
 
14
// (at your option) any later version.
 
15
// 
 
16
// VoxBo is distributed in the hope that it will be useful, but
 
17
// WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
19
// General Public License for more details.
 
20
// 
 
21
// You should have received a copy of the GNU General Public License
 
22
// along with VoxBo.  If not, see <http://www.gnu.org/licenses/>.
 
23
// 
 
24
// For general information on VoxBo, including the latest complete
 
25
// source code and binary distributions, manual, and associated files,
 
26
// see the VoxBo home page at: http://www.voxbo.org/
 
27
// 
 
28
// original version written by Dongbo Hu
 
29
 
 
30
#ifndef DBDATA_H
 
31
#define DBDATA_H
 
32
 
 
33
#include "myDB.h"
 
34
#include "mydefs.h"
 
35
#include <string>
 
36
#include <map>
 
37
 
 
38
class DBdata
 
39
{
 
40
 public:
 
41
  int open();
 
42
  void setDbNames(string dirname = "");
 
43
  int close();
 
44
  int closeTables();
 
45
  int loadRegionData();
 
46
  int readTypes(string fname);
 
47
  int readViews(string fname);
 
48
  int readScorenames(string fname);
 
49
  // int32 getScoreNames(DbTxn*); 
 
50
  void add_scorename(const DBscorename&);
 
51
  void print_types();
 
52
 
 
53
  int initDB(string inputDir, string admin_passwd, uint32 id_start);
 
54
  bool validateDir();
 
55
 
 
56
  myEnv env;
 
57
  myDB sysDB, userDB, userGrpDB, userRelationDB, permDB;
 
58
  myDB scoreNameDB, sessionDB, scoreValueDB, patientScoreDB;
 
59
  myDB contactDB, patientDB, patientListDB;
 
60
  //myDB patientGrpDB, patientGrpMemDB;
 
61
  myDB studyDB;
 
62
  myDB viewDB, viewEntryDB; // not used right now
 
63
  myDB regionNameDB, namespaceDB, synonymDB, regionRelationDB;
 
64
 
 
65
  string dirname;
 
66
  string typeFilename;
 
67
  string viewFilename;
 
68
  string scoreNameFilename;
 
69
  string sysDbName, userDbName, permissionDbName;
 
70
  string scoreNameDbName, sessionDbName, scoreValueDbName, patientScoreDbName;
 
71
  string regionDbName, synonymDbName, regionRelationDbName, namespaceDbName;
 
72
  string patientDbName, patientListDbName;
 
73
  string errMsg;
 
74
  
 
75
  map<string,DBtype> typemap;                // access types by name
 
76
  map<string,DBscorename> scorenames;        // all the possible score names
 
77
  // map<string,string> testmap;             // map test (or node) name onto scorename id
 
78
  multimap<string,string> scorenamechildren; // map each scorename to its children
 
79
  map<string,DBviewspec> viewspecs;
 
80
  map<int32,regionRec> regionNameMap;
 
81
  map<int32,synonymRec> synonymMap;
 
82
  map<int32,regionRelationRec> regionRelationMap;
 
83
};
 
84
 
 
85
#endif