From a905f81cf058667c4c313fef2d3fe34210ed4241 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 4 Mar 2018 12:28:21 +0000 Subject: Add fwd headers to reduce the compile overheads of simple clients. --- libdbpp/command.h | 4 +--- libdbpp/command_fwd.h | 21 +++++++++++++++++++++ libdbpp/connection.h | 2 +- libdbpp/connection_fwd.h | 12 ++++++++++++ libdbpp/modifycommand.h | 1 - libdbpp/selectcommand.h | 1 - 6 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 libdbpp/command_fwd.h create mode 100644 libdbpp/connection_fwd.h diff --git a/libdbpp/command.h b/libdbpp/command.h index 1647e50..aa91282 100644 --- a/libdbpp/command.h +++ b/libdbpp/command.h @@ -1,6 +1,7 @@ #ifndef DB_COMMAND_H #define DB_COMMAND_H +#include "command_fwd.h" #include #include #include @@ -24,8 +25,6 @@ namespace DB { ParameterOutOfRange(); }; - typedef std::map CommandOptionsMap; - /// Represents the basic options that can be passed when creating new commands. class DLL_PUBLIC CommandOptions { public: @@ -124,7 +123,6 @@ namespace DB { /// Bind a (possibly null) c-string to parameter i. void bindParamS(unsigned int, char * const); }; - typedef boost::shared_ptr CommandPtr; typedef AdHoc::Factory CommandOptionsFactory; } diff --git a/libdbpp/command_fwd.h b/libdbpp/command_fwd.h new file mode 100644 index 0000000..0a35b18 --- /dev/null +++ b/libdbpp/command_fwd.h @@ -0,0 +1,21 @@ +#ifndef DB_COMMAND_FWD_H +#define DB_COMMAND_FWD_H + +#include +#include +#include + +namespace DB { + typedef std::map CommandOptionsMap; + class CommandOptions; + class Command; + typedef boost::shared_ptr CommandPtr; + class ModifyCommand; + typedef boost::shared_ptr ModifyCommandPtr; + class SelectCommand; + typedef boost::shared_ptr SelectCommandPtr; +} + + +#endif + diff --git a/libdbpp/connection.h b/libdbpp/connection.h index 4b75c18..f3cd014 100644 --- a/libdbpp/connection.h +++ b/libdbpp/connection.h @@ -1,6 +1,7 @@ #ifndef DB_CONNECTION_H #define DB_CONNECTION_H +#include "connection_fwd.h" #include #include #include @@ -183,7 +184,6 @@ namespace DB { Connection * conn; }; - typedef boost::shared_ptr ConnectionPtr; typedef AdHoc::Factory ConnectionFactory; } diff --git a/libdbpp/connection_fwd.h b/libdbpp/connection_fwd.h new file mode 100644 index 0000000..0594490 --- /dev/null +++ b/libdbpp/connection_fwd.h @@ -0,0 +1,12 @@ +#ifndef DB_CONNECTION_FWD_H +#define DB_CONNECTION_FWD_H + +#include + +namespace DB { + class Connection; + typedef boost::shared_ptr ConnectionPtr; +} + +#endif + diff --git a/libdbpp/modifycommand.h b/libdbpp/modifycommand.h index 0e225f4..53152aa 100644 --- a/libdbpp/modifycommand.h +++ b/libdbpp/modifycommand.h @@ -23,7 +23,6 @@ namespace DB { /// Execute the command and return effected row count virtual unsigned int execute(bool allowNoChange = true) = 0; }; - typedef boost::shared_ptr ModifyCommandPtr; } #endif diff --git a/libdbpp/selectcommand.h b/libdbpp/selectcommand.h index 5e48f4d..32b5cbe 100644 --- a/libdbpp/selectcommand.h +++ b/libdbpp/selectcommand.h @@ -136,7 +136,6 @@ namespace DB { /// Columns in the result set. Columns * columns; }; - typedef boost::shared_ptr SelectCommandPtr; } #endif -- cgit v1.2.3