Skip to content

Commit 74e4f20

Browse files
Refactor classes in Flight ODBC into type_fwd.h
1 parent 713c57a commit 74e4f20

File tree

8 files changed

+39
-28
lines changed

8 files changed

+39
-28
lines changed

cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_connection.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,14 @@
1919

2020
#include <arrow/flight/sql/odbc/odbc_impl/spi/connection.h>
2121
#include "arrow/flight/sql/odbc/odbc_impl/odbc_handle.h"
22+
#include "arrow/flight/sql/odbc/odbc_impl/type_fwd.h"
2223

2324
#include <sql.h>
2425
#include <map>
2526
#include <memory>
2627
#include <optional>
2728
#include <vector>
2829

29-
namespace ODBC {
30-
class ODBCEnvironment;
31-
class ODBCDescriptor;
32-
class ODBCStatement;
33-
} // namespace ODBC
34-
3530
/**
3631
* @brief An abstraction over an ODBC connection handle. This also wraps an SPI
3732
* Connection.

cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_descriptor.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#pragma once
1919

2020
#include "arrow/flight/sql/odbc/odbc_impl/odbc_handle.h"
21+
#include "arrow/flight/sql/odbc/odbc_impl/type_fwd.h"
2122

2223
#include <sql.h>
2324
#include <sqlext.h>
@@ -26,13 +27,7 @@
2627
#include <string>
2728
#include <vector>
2829

29-
namespace arrow::flight::sql::odbc {
30-
class ResultSetMetadata;
31-
} // namespace arrow::flight::sql::odbc
32-
3330
namespace ODBC {
34-
class ODBCConnection;
35-
class ODBCStatement;
3631

3732
struct DescriptorRecord {
3833
std::string base_column_name;

cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_environment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#pragma once
1919

2020
#include "arrow/flight/sql/odbc/odbc_impl/odbc_handle.h"
21+
#include "arrow/flight/sql/odbc/odbc_impl/type_fwd.h"
2122

2223
#include <sql.h>
2324
#include <memory>
@@ -28,7 +29,6 @@ class Driver;
2829
} // namespace arrow::flight::sql::odbc
2930

3031
namespace ODBC {
31-
class ODBCConnection;
3232

3333
/**
3434
* @brief An abstraction over an ODBC environment handle.

cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,14 @@
1818
#pragma once
1919

2020
#include "arrow/flight/sql/odbc/odbc_impl/odbc_handle.h"
21+
#include "arrow/flight/sql/odbc/odbc_impl/type_fwd.h"
2122

2223
#include <arrow/flight/sql/odbc/odbc_impl/platform.h>
2324
#include <sql.h>
2425
#include <memory>
2526
#include <string>
2627

27-
namespace arrow::flight::sql::odbc {
28-
class Statement;
29-
class ResultSet;
30-
} // namespace arrow::flight::sql::odbc
31-
3228
namespace ODBC {
33-
class ODBCConnection;
34-
class ODBCDescriptor;
3529

3630
/**
3731
* @brief An abstraction over an ODBC connection handle. This also wraps an SPI

cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/connection.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#include "arrow/flight/sql/odbc/odbc_impl/diagnostics.h"
2929
#include "arrow/flight/sql/odbc/odbc_impl/types.h"
30+
#include "arrow/flight/sql/odbc/odbc_impl/type_fwd.h"
3031

3132
namespace arrow::flight::sql::odbc {
3233

@@ -42,8 +43,6 @@ struct CaseInsensitiveComparator {
4243
// PropertyMap is case-insensitive for keys.
4344
typedef std::map<std::string, std::string, CaseInsensitiveComparator> PropertyMap;
4445

45-
class Statement;
46-
4746
/// \brief High-level representation of an ODBC connection.
4847
class Connection {
4948
protected:

cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/result_set.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
#include "arrow/flight/sql/odbc/odbc_impl/platform.h"
2424

2525
#include "arrow/flight/sql/odbc/odbc_impl/types.h"
26+
#include "arrow/flight/sql/odbc/odbc_impl/type_fwd.h"
2627

2728
#include <sqltypes.h>
2829

2930
namespace arrow::flight::sql::odbc {
3031

31-
class ResultSetMetadata;
32-
3332
class ResultSet {
3433
protected:
3534
ResultSet() = default;

cpp/src/arrow/flight/sql/odbc/odbc_impl/spi/statement.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222
#include <optional>
2323
#include <vector>
2424

25-
namespace arrow::flight::sql::odbc {
26-
27-
class ResultSet;
25+
#include "arrow/flight/sql/odbc/odbc_impl/type_fwd.h"
2826

29-
class ResultSetMetadata;
27+
namespace arrow::flight::sql::odbc {
3028

3129
/// \brief High-level representation of an ODBC statement.
3230
class Statement {
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
#pragma once
19+
20+
namespace arrow::flight::sql::odbc {
21+
class Statement;
22+
class ResultSet;
23+
class ResultSetMetadata;
24+
}
25+
26+
namespace ODBC {
27+
class ODBCEnvironment;
28+
class ODBCDescriptor;
29+
class ODBCStatement;
30+
class ODBCConnection;
31+
}

0 commit comments

Comments
 (0)