VTK
|
maintain a connection to a PostgreSQL database More...
#include <vtkPostgreSQLDatabase.h>
Public Types | |
typedef vtkSQLDatabase | Superclass |
![]() | |
typedef vtkObject | Superclass |
typedef vtkSQLDatabase *(* | CreateFunction) (const char *URL) |
![]() | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkPostgreSQLDatabase * | NewInstance () const |
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 bool | ParseURL (const char *url) |
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) |
![]() | |
vtkSQLDatabase * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
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) |
![]() | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool 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) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(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 &) |
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 (vtkObjectBase *o) |
static vtkPostgreSQLDatabase * | New () |
![]() | |
static int | IsTypeOf (const char *type) |
static vtkSQLDatabase * | SafeDownCast (vtkObjectBase *o) |
static vtkSQLDatabase * | CreateFromURL (const char *URL) |
static vtkInformationObjectBaseKey * | DATABASE () |
static void | RegisterCreateFromURLCallback (CreateFunction callback) |
static void | UnRegisterCreateFromURLCallback (CreateFunction callback) |
static void | UnRegisterAllCreateFromURLCallbacks () |
![]() | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObjectBase *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
![]() | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkPostgreSQLDatabase () | |
~vtkPostgreSQLDatabase () | |
void | UpdateDataTypeMap () |
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 &) |
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 |
![]() | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
![]() | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
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 59 of file vtkPostgreSQLDatabase.h.
Definition at line 67 of file vtkPostgreSQLDatabase.h.
|
protected |
|
protected |
|
static |
|
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 |
|
protectedvirtual |
Reimplemented from vtkSQLDatabase.
vtkPostgreSQLDatabase* vtkPostgreSQLDatabase::NewInstance | ( | ) | const |
|
virtual |
|
static |
|
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 251 of file vtkPostgreSQLDatabase.h.
|
inlinevirtual |
The port used for connecting to the database.
Definition at line 126 of file vtkPostgreSQLDatabase.h.
|
inlinevirtual |
The port used for connecting to the database.
Definition at line 130 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.
|
virtual |
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.
|
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 |
|
protectedvirtual |
|
protected |
|
protected |
|
friend |
Definition at line 62 of file vtkPostgreSQLDatabase.h.
|
friend |
Definition at line 63 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.
|
protected |
Definition at line 211 of file vtkPostgreSQLDatabase.h.