Make routingworker.hh public

Given that worker.hh was public, it made sense to make routingworker.hh
public as well. This removes the need to include private headers in
modules and allows C++ constructs to be used in C++ code when previously
only the C API was available.
This commit is contained in:
Markus Mäkelä 2018-08-30 03:21:21 +03:00
parent bd2e23fb85
commit 26dfb19ea4
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
16 changed files with 58 additions and 35 deletions

View File

@ -15,14 +15,16 @@
#include <maxscale/ccdefs.hh>
#include <unordered_map>
#include <vector>
#include <mutex>
#include <maxbase/semaphore.hh>
#include <maxbase/worker.hh>
#include <maxscale/poll.h>
#include <maxscale/query_classifier.h>
#include <maxscale/routingworker.h>
#include <maxscale/session.hh>
#include "session.hh"
namespace maxscale
{

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2018 MariaDB Corporation Ab
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
*
* Change Date: 2022-01-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2 or later of the General
* Public License.
*/
#pragma once
#include <maxscale/utils.hh>
namespace maxscale
{
/**
* Specialization of RegistryTraits for the session registry.
*/
template<>
struct RegistryTraits<MXS_SESSION>
{
typedef uint64_t id_type;
typedef MXS_SESSION* entry_type;
static id_type get_id(entry_type entry)
{
return entry->ses_id;
}
static entry_type null_entry()
{
return NULL;
}
};
}

View File

@ -51,9 +51,9 @@
#include <maxscale/service.h>
#include <maxscale/spinlock.h>
#include <maxscale/utils.h>
#include <maxscale/routingworker.hh>
#include "internal/modules.h"
#include "internal/routingworker.hh"
#include "internal/session.h"
using maxscale::RoutingWorker;

View File

@ -58,6 +58,7 @@
#include <maxscale/utils.h>
#include <maxscale/version.h>
#include <maxscale/random.h>
#include <maxscale/routingworker.hh>
#include "internal/admin.hh"
#include "internal/config.hh"
@ -65,7 +66,6 @@
#include "internal/modules.h"
#include "internal/monitor.h"
#include "internal/poll.hh"
#include "internal/routingworker.hh"
#include "internal/service.hh"
#include "internal/statistics.h"

View File

@ -26,27 +26,10 @@
#include "filter.hh"
#include "service.hh"
#include "session.h"
namespace maxscale
{
/**
* Specialization of RegistryTraits for the session registry.
*/
template<>
struct RegistryTraits<MXS_SESSION>
{
typedef uint64_t id_type;
typedef MXS_SESSION* entry_type;
static id_type get_id(entry_type entry)
{
return entry->ses_id;
}
static entry_type null_entry()
{
return NULL;
}
};
typedef struct SESSION_VARIABLE
{

View File

@ -15,8 +15,9 @@
#include <time.h>
#include <maxscale/routingworker.hh>
#include "internal/maxscale.h"
#include "internal/routingworker.hh"
#include "internal/service.hh"
static time_t started;

View File

@ -34,8 +34,9 @@
#include <maxscale/clock.h>
#include <maxscale/server.h>
#include <maxscale/statistics.h>
#include <maxscale/routingworker.hh>
#include "internal/poll.hh"
#include "internal/routingworker.hh"
using maxbase::Worker;
using maxscale::RoutingWorker;

View File

@ -25,6 +25,7 @@
#include <maxscale/modulecmd.h>
#include <maxscale/server.hh>
#include <maxscale/spinlock.hh>
#include <maxscale/routingworker.hh>
#include "internal/config_runtime.h"
#include "internal/filter.hh"
@ -33,7 +34,6 @@
#include "internal/modules.h"
#include "internal/monitor.h"
#include "internal/query_classifier.hh"
#include "internal/routingworker.hh"
#include "internal/service.hh"
#include "internal/session.h"

View File

@ -11,7 +11,7 @@
* Public License.
*/
#include "internal/routingworker.hh"
#include <maxscale/routingworker.hh>
#include <errno.h>
#include <fcntl.h>

View File

@ -45,10 +45,10 @@
#include <maxscale/http.hh>
#include <maxscale/maxscale.h>
#include <maxscale/server.hh>
#include <maxscale/routingworker.hh>
#include "internal/monitor.h"
#include "internal/poll.hh"
#include "internal/routingworker.hh"
#include "internal/config.hh"
#include "internal/service.hh"
#include "internal/modules.h"

View File

@ -53,12 +53,12 @@
#include <maxscale/version.h>
#include <maxscale/json_api.h>
#include <maxscale/routingworker.h>
#include <maxscale/routingworker.hh>
#include "internal/config.hh"
#include "internal/filter.hh"
#include "internal/modules.h"
#include "internal/service.hh"
#include "internal/routingworker.hh"
#include "internal/maxscale.h"
/** This define is needed in CentOS 6 systems */

View File

@ -39,11 +39,11 @@
#include <maxscale/utils.h>
#include <maxscale/json_api.h>
#include <maxscale/protocol/mysql.h>
#include <maxscale/routingworker.hh>
#include "internal/dcb.h"
#include "internal/filter.hh"
#include "internal/routingworker.hh"
#include "internal/session.h"
#include "internal/session.hh"
#include "internal/service.hh"
using std::string;

View File

@ -36,8 +36,8 @@
#include <maxscale/config.h>
#include <maxscale/listener.h>
#include <maxscale/routingworker.hh>
#include "../internal/routingworker.hh"
#include "../dcb.cc"
#include "test_utils.h"

View File

@ -24,11 +24,11 @@
#include <maxscale/query_classifier.h>
#include <maxscale/paths.h>
#include <maxscale/alloc.h>
#include <maxscale/routingworker.hh>
#include <sys/stat.h>
#include "../internal/poll.hh"
#include "../internal/routingworker.hh"
#include "../internal/statistics.h"

View File

@ -12,11 +12,9 @@
*/
#include <maxscale/protocol/mariadb_client.hh>
#include <maxscale/routingworker.hh>
#include <maxscale/utils.h>
// TODO: Find a way to cleanly expose this
#include "../../../core/internal/routingworker.hh"
#ifdef EPOLLRDHUP
#define ERROR_EVENTS (EPOLLRDHUP | EPOLLHUP | EPOLLERR)
#else

View File

@ -54,6 +54,7 @@
#include <maxscale/utils.h>
#include <maxscale/version.h>
#include <maxscale/routingworker.h>
#include <maxscale/routingworker.hh>
#include <debugcli.h>
@ -65,7 +66,6 @@
#include "../../../core/internal/poll.hh"
#include "../../../core/internal/session.h"
#include "../../../core/internal/filter.hh"
#include "../../../core/internal/routingworker.hh"
#define MAXARGS 14