Changing the error return values to +ve values
[csql.git] / include / DatabaseManager.h
blob8f3d9596f451c2beb4e169902f8a8943db5c34cb
1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
4 * *
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. *
9 * *
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. *
14 * *
15 ***************************************************************************/
16 #ifndef DATABASE_MANAGER_H
17 #define DATABASE_MANAGER_H
18 #include<Info.h>
19 class Table;
20 /**
21 * @class DatabaseManager
23 * @brief Interface for database management operations.
24 * This manages all the database objects. Currently it supports two database <br>
25 * objects namely table and index.<br/>
26 * <br/>
27 * Functionality: <br/>
28 * 1.Table Management (create, drop, open and close) <br/>
29 * 2.Index Management (create and drop) <br/>
30 * <br/>
31 * @author Prabakaran Thirumalai
33 class DatabaseManager
35 public:
36 /** creates a table in the database
37 * @param name name of the table
38 * @param def table definition
39 * @return DbRetVal
41 virtual DbRetVal createTable(const char *name, TableDef &def)=0;
43 /** deletes a table from the database
44 * @param name name of the table
45 * @return DbRetVal
47 virtual DbRetVal dropTable(const char *name)=0;
49 /** opens a table for processing
50 * @param name name of the table
51 * @return DbRetVal
53 virtual Table* openTable(const char *name)=0;
55 /** closes the table handle passed
56 * @param table handle to the table
58 virtual void closeTable(Table *table)=0;
60 /** creates an index on the specified table. <br/>
61 * Create appropriate derived class object of IndexInitInfo based on the type of <br/>
62 * the index created and pass it to this method.
63 * @param indName index name
64 * @param info IndexInitInfo
66 virtual DbRetVal createIndex(const char *indName, IndexInitInfo *info)=0;
68 /** deletes the index object
69 * @param name index name
71 virtual DbRetVal dropIndex(const char *name)=0;
72 virtual ~DatabaseManager(){ }
75 #endif