VTK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
dox
IO
PostgreSQL
vtkPostgreSQLDatabasePrivate.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkPostgreSQLDatabasePrivate.h
5
6
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7
All rights reserved.
8
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10
This software is distributed WITHOUT ANY WARRANTY; without even
11
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
PURPOSE. See the above copyright notice for more information.
13
14
=========================================================================*/
15
/*-------------------------------------------------------------------------
16
Copyright 2008 Sandia Corporation.
17
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18
the U.S. Government retains certain rights in this software.
19
-------------------------------------------------------------------------*/
20
35
#ifndef vtkPostgreSQLDatabasePrivate_h
36
#define vtkPostgreSQLDatabasePrivate_h
37
38
#include "
vtkStdString.h
"
39
#include "
vtkType.h
"
40
#include "
vtkTimeStamp.h
"
41
42
#include <libpq-fe.h>
43
#include <map>
44
45
class
vtkPostgreSQLDatabasePrivate
46
{
47
public
:
48
vtkPostgreSQLDatabasePrivate
()
49
{
50
this->
Connection
= NULL;
51
}
52
54
56
virtual
~vtkPostgreSQLDatabasePrivate
()
57
{
58
if
(this->
Connection
)
59
{
60
PQfinish(this->
Connection
);
61
}
62
}
64
65
// Given a Postgres column type OID, return a VTK array type (see vtkType.h).
66
int
GetVTKTypeFromOID
( Oid pgtype )
67
{
68
std::map<Oid,int>::const_iterator it = this->
DataTypeMap
.find( pgtype );
69
if
( it == this->
DataTypeMap
.end() )
70
{
71
return
VTK_STRING
;
72
}
73
return
it->second;
74
}
75
76
77
78
// This is the actual database connection. It will be NULL if no
79
// connection is open.
80
PGconn *
Connection
;
81
82
// Map Postgres column types to VTK types.
83
std::map<Oid,int>
DataTypeMap
;
84
};
85
86
#endif // vtkPostgreSQLDatabasePrivate_h
87
// VTK-HeaderTest-Exclude: vtkPostgreSQLDatabasePrivate.h
vtkPostgreSQLDatabasePrivate
internal details of a connection to a PostgreSQL database
Definition:
vtkPostgreSQLDatabasePrivate.h:45
vtkPostgreSQLDatabasePrivate::Connection
PGconn * Connection
Definition:
vtkPostgreSQLDatabasePrivate.h:80
vtkPostgreSQLDatabasePrivate::DataTypeMap
std::map< Oid, int > DataTypeMap
Definition:
vtkPostgreSQLDatabasePrivate.h:83
VTK_STRING
#define VTK_STRING
Definition:
vtkType.h:41
vtkPostgreSQLDatabasePrivate::vtkPostgreSQLDatabasePrivate
vtkPostgreSQLDatabasePrivate()
Definition:
vtkPostgreSQLDatabasePrivate.h:48
vtkTimeStamp.h
vtkStdString.h
vtkPostgreSQLDatabasePrivate::~vtkPostgreSQLDatabasePrivate
virtual ~vtkPostgreSQLDatabasePrivate()
Definition:
vtkPostgreSQLDatabasePrivate.h:56
vtkType.h
vtkPostgreSQLDatabasePrivate::GetVTKTypeFromOID
int GetVTKTypeFromOID(Oid pgtype)
Definition:
vtkPostgreSQLDatabasePrivate.h:66
Generated on Wed Dec 16 2015 17:15:05 for VTK by
1.8.9.1