Remove all TRANTOR_EXPORT defines from core.

This commit is contained in:
Relintai 2022-02-10 09:52:56 +01:00
parent 482599541d
commit b8e0579a2a
7 changed files with 209 additions and 220 deletions

View File

@ -15,7 +15,6 @@
#pragma once
#include "core/containers/task_queue.h"
#include <trantor/exports.h>
#include <list>
#include <memory>
#include <vector>
@ -29,7 +28,7 @@ namespace trantor
* can be called a threads pool.
*
*/
class TRANTOR_EXPORT ConcurrentTaskQueue : public TaskQueue
class ConcurrentTaskQueue : public TaskQueue
{
public:
/**

View File

@ -16,7 +16,6 @@
#include "task_queue.h"
#include "core/loops/event_loop_thread.h"
#include <trantor/exports.h>
#include <string>
#include <queue>
#include <mutex>
@ -28,7 +27,7 @@ namespace trantor
* by one.
*
*/
class TRANTOR_EXPORT SerialTaskQueue : public TaskQueue
class SerialTaskQueue : public TaskQueue
{
public:
/**

View File

@ -16,7 +16,6 @@
#include "core/loops/event_loop.h"
#include "core/log/logger.h"
#include <trantor/exports.h>
#include <map>
#include <mutex>
#include <deque>
@ -42,7 +41,7 @@ using BucketQueue = std::deque<EntryBucket>;
* accuracy. This is usually used internally.
*
*/
class TRANTOR_EXPORT TimingWheel
class TimingWheel
{
public:
class CallbackEntry

View File

@ -6,7 +6,7 @@
// Author: Tao An
#pragma once
#include <trantor/exports.h>
#include <memory>
#include "core/loops/event_loop.h"
#include "core/net/inet_address.h"
@ -18,7 +18,7 @@ namespace trantor
* @note Although the c-ares library is not essential, it is recommended to
* install it for higher performance
*/
class TRANTOR_EXPORT Resolver
class Resolver
{
public:
using Callback = std::function<void(const trantor::InetAddress&)>;

View File

@ -17,14 +17,15 @@
// Author: Tao An
#pragma once
#include "core/loops/event_loop.h"
#include "core/net/inet_address.h"
#include "tcp_connection.h"
#include <trantor/exports.h>
#include <functional>
#include <thread>
#include <atomic>
#include <signal.h>
namespace trantor
{
class Connector;
@ -34,7 +35,7 @@ class SSLContext;
* @brief This class represents a TCP client.
*
*/
class TRANTOR_EXPORT TcpClient : NonCopyable
class TcpClient : NonCopyable
{
public:
/**

View File

@ -13,20 +13,19 @@
*/
#pragma once
#include <trantor/exports.h>
#include "core/containers/msg_buffer.h"
#include "core/loops/callbacks.h"
#include "core/loops/event_loop.h"
#include "core/net/inet_address.h"
#include <trantor/utils/NonCopyable.h>
#include "core/containers/msg_buffer.h"
#include "core/loops/callbacks.h"
#include <memory>
#include <functional>
#include <memory>
#include <string>
namespace trantor
{
namespace trantor {
class SSLContext;
TRANTOR_EXPORT std::shared_ptr<SSLContext> newSSLServerContext(
std::shared_ptr<SSLContext> newSSLServerContext(
const std::string &certPath,
const std::string &keyPath,
bool useOldTLS = false,
@ -35,8 +34,7 @@ TRANTOR_EXPORT std::shared_ptr<SSLContext> newSSLServerContext(
* @brief This class represents a TCP connection.
*
*/
class TRANTOR_EXPORT TcpConnection
{
class TcpConnection {
public:
TcpConnection() = default;
virtual ~TcpConnection(){};
@ -145,12 +143,10 @@ class TRANTOR_EXPORT TcpConnection
*
* @param context
*/
void setContext(const std::shared_ptr<void> &context)
{
void setContext(const std::shared_ptr<void> &context) {
contextPtr_ = context;
}
void setContext(std::shared_ptr<void> &&context)
{
void setContext(std::shared_ptr<void> &&context) {
contextPtr_ = std::move(context);
}
@ -161,8 +157,7 @@ class TRANTOR_EXPORT TcpConnection
* @return std::shared_ptr<T>
*/
template <typename T>
std::shared_ptr<T> getContext() const
{
std::shared_ptr<T> getContext() const {
return std::static_pointer_cast<T>(contextPtr_);
}
@ -172,8 +167,7 @@ class TRANTOR_EXPORT TcpConnection
* @return true
* @return false
*/
bool hasContext() const
{
bool hasContext() const {
return (bool)contextPtr_;
}
@ -181,8 +175,7 @@ class TRANTOR_EXPORT TcpConnection
* @brief Clear the custom data.
*
*/
void clearContext()
{
void clearContext() {
contextPtr_.reset();
}
@ -238,8 +231,7 @@ class TRANTOR_EXPORT TcpConnection
bool useOldTLS = false,
bool validateCert = true,
std::string hostname = "",
const std::vector<std::pair<std::string, std::string>> &sslConfCmds =
{}) = 0;
const std::vector<std::pair<std::string, std::string> > &sslConfCmds = {}) = 0;
/**
* @brief Start the SSL encryption on the connection (as a server).

View File

@ -20,7 +20,6 @@
#include "core/net/inet_address.h"
#include "core/net/tcp_connection.h"
#include "core/loops/timing_wheel.h"
#include <trantor/exports.h>
#include <string>
#include <memory>
#include <set>
@ -33,7 +32,7 @@ class SSLContext;
* @brief This class represents a TCP server.
*
*/
class TRANTOR_EXPORT TcpServer : NonCopyable
class TcpServer : NonCopyable
{
public:
/**