Skip to content

Commit e1df833

Browse files
rsomla1silvakid
authored andcommitted
Remove ABI tags from internal headers.
1 parent 219855c commit e1df833

File tree

20 files changed

+404
-272
lines changed

20 files changed

+404
-272
lines changed

common/collection.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "op_impl.h"
3636

3737

38-
using namespace ::mysqlx::common;
38+
using namespace ::mysqlx::impl::common;
3939

4040

4141
/*

common/common.h

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#ifndef MYSQLX_COMMON_COMMON_H
2+
#define MYSQLX_COMMON_COMMON_H
3+
4+
#include <mysqlx/common.h>
5+
6+
7+
namespace mysqlx {
8+
MYSQLX_ABI_BEGIN(2,0)
9+
namespace common {
10+
11+
class Session_pool;
12+
class Session_impl;
13+
class Result_impl;
14+
class Result_init;
15+
class Column_info;
16+
17+
using Shared_session_impl = std::shared_ptr<Session_impl>;
18+
using Session_pool_shared = std::shared_ptr<Session_pool>;
19+
20+
using cdk::col_count_t;
21+
using cdk::row_count_t;
22+
23+
}
24+
MYSQLX_ABI_END(2,0)
25+
}
26+
27+
28+
namespace mysqlx {
29+
namespace impl {
30+
namespace common {
31+
32+
using namespace mysqlx::common;
33+
34+
using cdk::col_count_t;
35+
using cdk::row_count_t;
36+
37+
}}}
38+
39+
40+
#ifndef THROW_AS_ASSERT
41+
#undef THROW
42+
#define THROW(MSG) do { mysqlx::common::throw_error(MSG); throw (MSG); } while(false)
43+
#endif
44+
45+
46+
#endif

common/db_object.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@
3131
#ifndef MYSQLX_COMMON_DB_OBJECT_H
3232
#define MYSQLX_COMMON_DB_OBJECT_H
3333

34+
#include "common.h"
35+
3436
#include <mysql/cdk.h>
35-
#include <mysqlx/common.h>
3637

3738

3839
namespace mysqlx {
39-
MYSQLX_ABI_BEGIN(2,0)
40+
namespace impl {
4041

4142
// --------------------------------------------------------------------
4243

@@ -87,7 +88,6 @@ namespace common {
8788

8889
} // common
8990

90-
MYSQLX_ABI_END(2,0)
91-
} // mysqlx
91+
}} // mysqlx::impl
9292

9393
#endif

common/op_impl.h

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,19 @@
3131
#ifndef MYSQLX_COMMON_OP_IMPL_H
3232
#define MYSQLX_COMMON_OP_IMPL_H
3333

34-
#include <mysql/cdk.h>
35-
#include <mysqlx/common.h>
36-
#include <mysqlx/common/op_if.h>
34+
#include "common.h"
3735
#include "session.h"
3836
#include "result.h"
3937
#include "db_object.h"
4038

39+
#include <mysql/cdk.h>
40+
#include <mysqlx/common.h>
41+
#include <mysqlx/common/op_if.h>
42+
43+
PUSH_SYS_WARNINGS
4144
#include <bitset>
4245
#include <list>
46+
POP_SYS_WARNINGS
4347

4448

4549
/*
@@ -48,7 +52,7 @@
4852
*/
4953

5054
namespace mysqlx {
51-
MYSQLX_ABI_BEGIN(2,0)
55+
namespace impl {
5256
namespace common {
5357

5458
enum class Object_type
@@ -1060,13 +1064,13 @@ class Op_projection
10601064

10611065
Scalar_prc* scalar()
10621066
{
1063-
throw_error("Scalar expression can not be used as projection");
1067+
common::throw_error("Scalar expression can not be used as projection");
10641068
return nullptr;
10651069
}
10661070

10671071
List_prc* arr()
10681072
{
1069-
throw_error("Array expression can not be used as projection");
1073+
common::throw_error("Array expression can not be used as projection");
10701074
return nullptr;
10711075
}
10721076

@@ -1201,7 +1205,7 @@ class Op_select : public Base
12011205
if (m_where_expr.empty())
12021206
{
12031207
if (m_where_set)
1204-
throw_error("Invalid selection criteria");
1208+
common::throw_error("Invalid selection criteria");
12051209
return nullptr;
12061210
}
12071211

@@ -1222,11 +1226,11 @@ class Op_select : public Base
12221226
*/
12231227

12241228
struct Op_sql
1225-
: public Op_base<common::Bind_if>
1229+
: public Op_base<Bind_if>
12261230
{
12271231
using string = std::string;
12281232

1229-
using Base = Op_base<common::Bind_if>;
1233+
using Base = Op_base<Bind_if>;
12301234

12311235
string m_query;
12321236

@@ -1470,7 +1474,7 @@ struct Op_trx<Trx_op::SAVEPOINT_REMOVE>
14701474
: Op_trx_savepoint(sess, name)
14711475
{
14721476
if (name.empty())
1473-
throw_error("Invalid empty save point name");
1477+
common::throw_error("Invalid empty save point name");
14741478
}
14751479

14761480
cdk::Reply* send_command() override
@@ -1533,7 +1537,7 @@ struct Op_create<Object_type::COLLECTION>
15331537
if (coll.schema())
15341538
add_param("schema", Value::Access::mk_str(coll.schema()->name()));
15351539
else
1536-
throw_error("No schema specified for create collection operation");
1540+
common::throw_error("No schema specified for create collection operation");
15371541
add_param("name", Value::Access::mk_str(coll.name()));
15381542
// 1050 = table already exists
15391543
if (reuse)
@@ -1574,7 +1578,7 @@ struct Op_drop
15741578
: Op_admin(sess, "drop_collection")
15751579
{
15761580
if (!obj.schema())
1577-
throw_error("No schema specified for drop collection/table operation");
1581+
common::throw_error("No schema specified for drop collection/table operation");
15781582
add_param("schema", obj.schema()->name());
15791583
add_param("name", obj.name());
15801584
// 1051 = collection doesn't exist
@@ -2547,7 +2551,7 @@ class Op_table_insert
25472551
using string = std::string;
25482552
using Row_list = std::list < Row_impl<VAL> >;
25492553
using Col_list = std::list < string >;
2550-
using Object_ref = mysqlx::common::Object_ref;
2554+
using Object_ref = impl::common::Object_ref;
25512555

25522556
Object_ref m_table;
25532557

@@ -2896,7 +2900,7 @@ class Op_table_remove
28962900

28972901

28982902
} // internal
2899-
MYSQLX_ABI_END(2,0)
2903+
} // impl
29002904
} // mysqlx
29012905

29022906
#endif

common/result.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
into values.
4545
*/
4646

47-
using namespace ::mysqlx::common;
47+
using namespace ::mysqlx::impl::common;
4848

4949

5050
/*
@@ -59,7 +59,8 @@ using namespace ::mysqlx::common;
5959

6060

6161
Value
62-
mysqlx::common::convert(cdk::bytes data, Format_descr<cdk::TYPE_STRING> &fd)
62+
mysqlx::impl::common::
63+
convert(cdk::bytes data, Format_descr<cdk::TYPE_STRING> &fd)
6364
{
6465
/*
6566
String encoding has artificial 0x00 byte appended at the end to
@@ -82,7 +83,8 @@ mysqlx::common::convert(cdk::bytes data, Format_descr<cdk::TYPE_STRING> &fd)
8283

8384

8485
Value
85-
mysqlx::common::convert(cdk::bytes data, Format_descr<cdk::TYPE_INTEGER> &fd)
86+
mysqlx::impl::common::
87+
convert(cdk::bytes data, Format_descr<cdk::TYPE_INTEGER> &fd)
8688
{
8789
auto &codec = fd.m_codec;
8890
auto &fmt = fd.m_format;
@@ -103,7 +105,8 @@ mysqlx::common::convert(cdk::bytes data, Format_descr<cdk::TYPE_INTEGER> &fd)
103105

104106

105107
Value
106-
mysqlx::common::convert(cdk::bytes data, Format_descr<cdk::TYPE_FLOAT> &fd)
108+
mysqlx::impl::common::
109+
convert(cdk::bytes data, Format_descr<cdk::TYPE_FLOAT> &fd)
107110
{
108111
auto &fmt = fd.m_format;
109112

@@ -125,7 +128,8 @@ mysqlx::common::convert(cdk::bytes data, Format_descr<cdk::TYPE_FLOAT> &fd)
125128

126129

127130
Value
128-
mysqlx::common::convert(cdk::bytes data, Format_descr<cdk::TYPE_DOCUMENT>&)
131+
mysqlx::impl::common::
132+
convert(cdk::bytes data, Format_descr<cdk::TYPE_DOCUMENT>&)
129133
{
130134
if (0 == data.size())
131135
return Value();

0 commit comments

Comments
 (0)