IODA Bundle
Types.cc
Go to the documentation of this file.
1
/*
2
* (C) Copyright 1996-2012 ECMWF.
3
*
4
* This software is licensed under the terms of the Apache Licence Version 2.0
5
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6
* In applying this licence, ECMWF does not waive the privileges and immunities
7
* granted to it by virtue of its status as an intergovernmental organisation nor
8
* does it submit to any jurisdiction.
9
*/
10
11
#include "eckit/exception/Exceptions.h"
12
#include "eckit/sql/type/SQLType.h"
13
#include "eckit/utils/Translator.h"
14
15
#include "
odc/sql/Types.h
"
16
17
using namespace
eckit
;
18
using namespace
eckit::sql::type
;
19
using namespace
odc::api
;
20
21
namespace
odc
{
22
namespace
sql {
23
24
//----------------------------------------------------------------------------------------------------------------------
25
26
ColumnType
sqlToOdbType
(
const
SQLType& t) {
27
28
switch
(t.getKind()) {
29
case
SQLType::realType:
30
return
REAL
;
31
case
SQLType::integerType:
32
return
INTEGER
;
33
case
SQLType::stringType:
34
return
STRING
;
35
case
SQLType::bitmapType:
36
return
BITFIELD
;
37
case
SQLType::doubleType:
38
return
DOUBLE
;
39
case
SQLType::blobType:
40
throw
SeriousBug(
"SQL blob type not supported in odc"
, Here());
41
default
:
42
throw
SeriousBug(
"Unrecognised type found: "
+ Translator<int, std::string>()(t.getKind()), Here());
43
};
44
45
ASSERT(
false
);
46
return
IGNORE
;
47
}
48
49
50
//----------------------------------------------------------------------------------------------------------------------
51
52
}
// namespace sql
53
}
// namespace odc
Types.h
airnow2ioda-nc.type
type
Definition:
airnow2ioda-nc.py:99
eckit
Definition:
DistributionUtils.h:15
odc::api
Definition:
ColumnInfo.h:24
odc::api::ColumnType
ColumnType
Definition:
ColumnType.h:22
odc::api::INTEGER
@ INTEGER
Definition:
ColumnType.h:24
odc::api::REAL
@ REAL
Definition:
ColumnType.h:25
odc::api::IGNORE
@ IGNORE
Definition:
ColumnType.h:23
odc::api::BITFIELD
@ BITFIELD
Definition:
ColumnType.h:27
odc::api::DOUBLE
@ DOUBLE
Definition:
ColumnType.h:28
odc::api::STRING
@ STRING
Definition:
ColumnType.h:26
odc::sql::sqlToOdbType
ColumnType sqlToOdbType(const SQLType &t)
Definition:
Types.cc:26
odc
Definition:
ColumnInfo.h:23
odc
src
odc
sql
Types.cc
Generated on Fri Aug 20 2021 11:49:12 for IODA Bundle by
1.9.1