VTK
9.4.20241227
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
IO
PostgreSQL
vtkPostgreSQLDatabasePrivate.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2
// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3
// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4
20
#ifndef vtkPostgreSQLDatabasePrivate_h
21
#define vtkPostgreSQLDatabasePrivate_h
22
23
#include "
vtkTimeStamp.h
"
24
#include "
vtkType.h
"
25
26
#include <libpq-fe.h>
27
#include <map>
28
29
VTK_ABI_NAMESPACE_BEGIN
30
class
vtkPostgreSQLDatabasePrivate
31
{
32
public
:
33
vtkPostgreSQLDatabasePrivate
() { this->
Connection
=
nullptr
; }
34
38
virtual
~vtkPostgreSQLDatabasePrivate
()
39
{
40
if
(this->
Connection
)
41
{
42
PQfinish(this->
Connection
);
43
}
44
}
45
46
// Given a Postgres column type OID, return a VTK array type (see vtkType.h).
47
int
GetVTKTypeFromOID
(Oid pgtype)
48
{
49
std::map<Oid, int>::const_iterator it = this->
DataTypeMap
.find(pgtype);
50
if
(it == this->
DataTypeMap
.end())
51
{
52
return
VTK_STRING
;
53
}
54
return
it->second;
55
}
56
57
// This is the actual database connection. It will be nullptr if no
58
// connection is open.
59
PGconn*
Connection
;
60
61
// Map Postgres column types to VTK types.
62
std::map<Oid, int>
DataTypeMap
;
63
};
64
65
VTK_ABI_NAMESPACE_END
66
#endif
// vtkPostgreSQLDatabasePrivate_h
67
// VTK-HeaderTest-Exclude: vtkPostgreSQLDatabasePrivate.h
vtkPostgreSQLDatabasePrivate
internal details of a connection to a PostgreSQL database
Definition
vtkPostgreSQLDatabasePrivate.h:31
vtkPostgreSQLDatabasePrivate::DataTypeMap
std::map< Oid, int > DataTypeMap
Definition
vtkPostgreSQLDatabasePrivate.h:62
vtkPostgreSQLDatabasePrivate::~vtkPostgreSQLDatabasePrivate
virtual ~vtkPostgreSQLDatabasePrivate()
Destroy the database connection.
Definition
vtkPostgreSQLDatabasePrivate.h:38
vtkPostgreSQLDatabasePrivate::GetVTKTypeFromOID
int GetVTKTypeFromOID(Oid pgtype)
Definition
vtkPostgreSQLDatabasePrivate.h:47
vtkPostgreSQLDatabasePrivate::vtkPostgreSQLDatabasePrivate
vtkPostgreSQLDatabasePrivate()
Definition
vtkPostgreSQLDatabasePrivate.h:33
vtkPostgreSQLDatabasePrivate::Connection
PGconn * Connection
Definition
vtkPostgreSQLDatabasePrivate.h:59
vtkTimeStamp.h
vtkType.h
VTK_STRING
#define VTK_STRING
Definition
vtkType.h:48
Generated on Fri Dec 27 2024 12:03:23 for VTK by
1.9.7