1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 ***************************************************************************/
16 #ifndef DATABASE_MANAGER_H
17 #define DATABASE_MANAGER_H
22 * @class DatabaseManager
24 * @brief Interface for database management operations.
25 * This manages all the database objects. Currently it supports two database <br>
26 * objects namely table and index.<br/>
28 * Functionality: <br/>
29 * 1.Table Management (create, drop, open and close) <br/>
30 * 2.Index Management (create and drop) <br/>
37 /** creates a table in the database
38 * @param name name of the table
39 * @param def table definition
42 virtual DbRetVal
createTable(const char *name
, TableDef
&def
)=0;
44 /** deletes a table from the database
45 * @param name name of the table
48 virtual DbRetVal
dropTable(const char *name
)=0;
50 /** opens a table for processing
51 * @param name name of the table
54 virtual Table
* openTable(const char *name
)=0;
56 /** closes the table handle passed
57 * @param table handle to the table
59 virtual void closeTable(Table
*table
)=0;
61 /** Returns all the tables as list
62 * @return List of table names
64 virtual List
getAllTableNames()=0;
66 /** creates an index on the specified table. <br/>
67 * Create appropriate derived class object of IndexInitInfo based on the type of <br/>
68 * the index created and pass it to this method.
69 * @param indName index name
70 * @param info IndexInitInfo
72 virtual DbRetVal
createIndex(const char *indName
, IndexInitInfo
*info
)=0;
74 /** deletes the index object
75 * @param name index name
77 virtual DbRetVal
dropIndex(const char *name
)=0;
78 virtual ~DatabaseManager(){ }