• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

dox/IO/vtkMySQLDatabase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMySQLDatabase.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00038 #ifndef __vtkMySQLDatabase_h
00039 #define __vtkMySQLDatabase_h
00040 
00041 #include "vtkSQLDatabase.h"
00042 
00043 class vtkSQLQuery;
00044 class vtkMySQLQuery;
00045 class vtkStringArray;
00046 class vtkMySQLDatabasePrivate;
00047 
00048 class VTK_IO_EXPORT vtkMySQLDatabase : public vtkSQLDatabase
00049 {
00050 //BTX
00051   friend class vtkMySQLQuery;
00052 //ETX
00053 
00054 public:
00055   vtkTypeRevisionMacro(vtkMySQLDatabase, vtkSQLDatabase);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057   static vtkMySQLDatabase *New();
00058 
00062   bool Open( const char* password = 0 );
00063 
00065   void Close();
00066   
00068   bool IsOpen();
00069 
00071   vtkSQLQuery* GetQueryInstance();
00072   
00074   vtkStringArray* GetTables();
00075     
00077   vtkStringArray* GetRecord(const char *table);
00078 
00080   bool IsSupported(int feature);
00081   
00083   bool HasError();
00084   
00086   const char* GetLastErrorText();
00087   
00089 
00090   vtkGetStringMacro(DatabaseType);
00092 
00094 
00095   vtkSetStringMacro(HostName);
00096   vtkGetStringMacro(HostName);
00098 
00100 
00101   vtkSetStringMacro(User);
00102   vtkGetStringMacro(User);
00104 
00106 
00107   vtkSetStringMacro(Password);
00109 
00111 
00112   vtkSetStringMacro(DatabaseName);
00113   vtkGetStringMacro(DatabaseName);
00115 
00117 
00118   vtkSetStringMacro(ConnectOptions);
00119   vtkGetStringMacro(ConnectOptions);
00121 
00123 
00124   vtkSetClampMacro(ServerPort, int, 0, VTK_INT_MAX);
00125   vtkGetMacro(ServerPort, int);
00127   
00129   virtual vtkStdString GetURL();
00130 
00134   virtual vtkStdString GetTablePreamble( bool b ) { return b ? vtkStdString() :"IF NOT EXISTS "; }
00135  
00137 
00144   virtual vtkStdString GetColumnSpecification( vtkSQLDatabaseSchema* schema,
00145                                                int tblHandle,
00146                                                int colHandle );
00148  
00150 
00156   virtual vtkStdString GetIndexSpecification( vtkSQLDatabaseSchema* schema,
00157                                               int tblHandle,
00158                                               int idxHandle,
00159                                               bool& skipped );
00161 
00165   bool CreateDatabase( const char* dbName, bool dropExisting );
00166 
00169   bool DropDatabase( const char* dbName );
00170 
00171 protected:
00172   vtkMySQLDatabase();
00173   ~vtkMySQLDatabase();
00174 
00178   virtual bool ParseURL(const char* url);
00179 
00180 private:
00181   // We want this to be private, a user of this class
00182   // should not be setting this for any reason
00183   vtkSetStringMacro(DatabaseType);
00184   
00185   vtkStringArray *Tables;
00186   vtkStringArray *Record;
00187 
00188   char* DatabaseType;
00189   char* HostName;
00190   char* User;
00191   char* Password;
00192   char* DatabaseName;
00193   int ServerPort;
00194   char* ConnectOptions;
00195 
00196 //BTX
00197   vtkMySQLDatabasePrivate* const Private;
00198 //ETX
00199 
00200   vtkMySQLDatabase(const vtkMySQLDatabase &); // Not implemented.
00201   void operator=(const vtkMySQLDatabase &); // Not implemented.
00202 };
00203 
00204 #endif // __vtkMySQLDatabase_h
00205 

Generated by  doxygen 1.7.1