VTK
|
maintain a connection to a PostgreSQL database More...
#include <vtkPostgreSQLDatabase.h>
Public Types | |
typedef vtkSQLDatabase | Superclass |
![]() | |
typedef vtkSQLDatabase *(* | CreateFunction )(const char *URL) |
![]() |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
bool | Open (const char *password=0) |
void | Close () |
bool | IsOpen () |
vtkSQLQuery * | GetQueryInstance () |
virtual bool | HasError () |
const char * | GetLastErrorText () |
virtual void | SetPassword (const char *) |
virtual vtkStdString | GetURL () |
vtkStringArray * | GetTables () |
vtkStringArray * | GetRecord (const char *table) |
bool | IsSupported (int feature) |
vtkStringArray * | GetDatabases () |
bool | CreateDatabase (const char *dbName, bool dropExisting=false) |
bool | DropDatabase (const char *dbName) |
virtual char * | GetDatabaseType () |
virtual void | SetHostName (const char *) |
virtual char * | GetHostName () |
virtual void | SetUser (const char *) |
virtual char * | GetUser () |
virtual void | SetDatabaseName (const char *) |
virtual char * | GetDatabaseName () |
virtual void | SetConnectOptions (const char *) |
virtual char * | GetConnectOptions () |
virtual void | SetServerPort (int) |
virtual int | GetServerPortMinValue () |
virtual int | GetServerPortMaxValue () |
virtual int | GetServerPort () |
virtual vtkStdString | GetColumnSpecification (vtkSQLDatabaseSchema *schema, int tblHandle, int colHandle) |
![]() | |
virtual bool | IsSupported (int vtkNotUsed(feature)) |
virtual vtkStdString | GetTablePreamble (bool) |
virtual bool | EffectSchema (vtkSQLDatabaseSchema *, bool dropIfExists=false) |
virtual vtkStdString | GetIndexSpecification (vtkSQLDatabaseSchema *schema, int tblHandle, int idxHandle, bool &skipped) |
virtual vtkStdString | GetTriggerSpecification (vtkSQLDatabaseSchema *schema, int tblHandle, int trgHandle) |
![]() | |
virtual void | DebugOn () |
virtual void | DebugOff () |
unsigned char | GetDebug () |
void | SetDebug (unsigned char debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
![]() | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &os) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkPostgreSQLDatabase * | SafeDownCast (vtkObject *o) |
static vtkPostgreSQLDatabase * | New () |
![]() | |
static vtkSQLDatabase * | CreateFromURL (const char *URL) |
static vtkInformationObjectBaseKey * | DATABASE () |
static void | RegisterCreateFromURLCallback (CreateFunction callback) |
static void | UnRegisterCreateFromURLCallback (CreateFunction callback) |
static void | UnRegisterAllCreateFromURLCallbacks () |
![]() | |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Protected Member Functions | |
vtkPostgreSQLDatabase () | |
~vtkPostgreSQLDatabase () | |
void | UpdateDataTypeMap () |
virtual bool | ParseURL (const char *url) |
virtual void | SetDatabaseType (const char *) |
virtual void | SetLastErrorText (const char *) |
void | NullTrailingWhitespace (char *msg) |
bool | OpenInternal (const char *connectionOptions) |
![]() | |
vtkSQLDatabase () | |
~vtkSQLDatabase () | |
![]() | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
![]() | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &os) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
vtkTimeStamp | URLMTime |
vtkPostgreSQLDatabasePrivate * | Connection |
vtkTimeStamp | ConnectionMTime |
vtkStringArray * | Tables |
char * | DatabaseType |
char * | HostName |
char * | User |
char * | Password |
char * | DatabaseName |
int | ServerPort |
char * | ConnectOptions |
char * | LastErrorText |
Friends | |
class | vtkPostgreSQLQuery |
class | vtkPostgreSQLQueryPrivate |
maintain a connection to a PostgreSQL database
PostgreSQL (http://www.postgres.org) is a BSD-licensed SQL database. It's large, fast, and can not be easily embedded inside other applications. Its databases are stored in files that belong to another process.
This class provides a VTK interface to PostgreSQL. You do need to download external libraries: we need a copy of PostgreSQL 8 (currently 8.2 or 8.3) so that we can link against the libpq C interface.
Definition at line 58 of file vtkPostgreSQLDatabase.h.
Reimplemented from vtkSQLDatabase.
Definition at line 66 of file vtkPostgreSQLDatabase.h.
|
protected |
|
protected |
|
virtual |
Reimplemented from vtkSQLDatabase.
|
static |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkSQLDatabase.
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkSQLDatabase.
|
static |
Reimplemented from vtkSQLDatabase.
|
virtual |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkSQLDatabase.
|
static |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject.
|
virtual |
Open a new connection to the database. You need to set the filename before calling this function. Returns true if the database was opened successfully; false otherwise.
Implements vtkSQLDatabase.
|
virtual |
Close the connection to the database.
Implements vtkSQLDatabase.
|
virtual |
Return whether the database has an open connection
Implements vtkSQLDatabase.
|
virtual |
Return an empty query on this database.
Implements vtkSQLDatabase.
|
virtual |
Did the last operation generate an error
Implements vtkSQLDatabase.
|
virtual |
Get the last error text from the database
Implements vtkSQLDatabase.
|
virtual |
String representing database type (e.g. "psql").
Implements vtkSQLDatabase.
|
virtual |
The database server host name.
|
virtual |
The database server host name.
|
virtual |
The user name for connecting to the database server.
|
virtual |
The user name for connecting to the database server.
|
virtual |
The user's password for connecting to the database server.
|
virtual |
The name of the database to connect to.
|
virtual |
The name of the database to connect to.
|
virtual |
Additional options for the database.
|
virtual |
Additional options for the database.
|
inlinevirtual |
The port used for connecting to the database.
Definition at line 250 of file vtkPostgreSQLDatabase.h.
|
inlinevirtual |
The port used for connecting to the database.
Definition at line 125 of file vtkPostgreSQLDatabase.h.
|
inlinevirtual |
The port used for connecting to the database.
Definition at line 129 of file vtkPostgreSQLDatabase.h.
|
virtual |
The port used for connecting to the database.
|
virtual |
Get a URL referencing the current database connection. This is not well-defined if the HostName and DatabaseName have not been set. The URL will be of the form 'psql://'[username[':'password]'@']hostname[':'port]'/'database
.
Implements vtkSQLDatabase.
|
virtual |
Get the list of tables from the database
Implements vtkSQLDatabase.
|
virtual |
Get the list of fields for a particular table
Implements vtkSQLDatabase.
bool vtkPostgreSQLDatabase::IsSupported | ( | int | feature | ) |
Return whether a feature is supported by the database.
vtkStringArray* vtkPostgreSQLDatabase::GetDatabases | ( | ) |
Return a list of databases on the server.
bool vtkPostgreSQLDatabase::CreateDatabase | ( | const char * | dbName, |
bool | dropExisting = false |
||
) |
Create a new database, optionally dropping any existing database of the same name. Returns true when the database is properly created and false on failure.
bool vtkPostgreSQLDatabase::DropDatabase | ( | const char * | dbName | ) |
Drop a database if it exists. Returns true on success and false on failure.
|
virtual |
Return the SQL string with the syntax to create a column inside a "CREATE TABLE" SQL statement. NB: this method implements the PostgreSQL-specific syntax: <column name>=""> <column type>=""> <column attributes>="">
Reimplemented from vtkSQLDatabase.
|
protected |
Create or refresh the map from Postgres column types to VTK array types. Postgres defines a table for types so that users may define types. This adaptor does not support user-defined types or even all of the default types defined by Postgres (some are inherently difficult to translate into VTK since Postgres allows columns to have composite types, vector-valued types, and extended precision types that vtkVariant does not support. This routine examines the pg_types table to get a map from Postgres column type IDs (stored as OIDs) to VTK array types. It is called whenever a new database connection is initiated.
|
protectedvirtual |
Overridden to determine connection parameters given the URL. This is called by CreateFromURL() to initialize the instance. Look at CreateFromURL() for details about the URL format.
Implements vtkSQLDatabase.
|
protectedvirtual |
|
protectedvirtual |
|
protected |
|
protected |
|
friend |
Definition at line 61 of file vtkPostgreSQLDatabase.h.
|
friend |
Definition at line 62 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 199 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 200 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 201 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 202 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 203 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 204 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 205 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 206 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 207 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 208 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 209 of file vtkPostgreSQLDatabase.h.
|
protected |
Definition at line 210 of file vtkPostgreSQLDatabase.h.