summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgor Pugin <egor.pugin@gmail.com>2020-03-22 21:26:34 +0300
committerEgor Pugin <egor.pugin@gmail.com>2020-03-22 21:26:34 +0300
commit6c5373974fdf3ec1924357cd40fbab330804361c (patch)
tree412d55d90ad53dad9a94e3920b10e465aba4ed50
parentb8b21c410ea4a00150195d420915235e187a1f77 (diff)
Move method to source file. Put include with boost asio at the first place, because otherwise it is compiler error somewhere in files related to include order.
-rw-r--r--include/tgbot/Bot.h8
-rw-r--r--src/Bot.cpp6
2 files changed, 8 insertions, 6 deletions
diff --git a/include/tgbot/Bot.h b/include/tgbot/Bot.h
index 58d667c..023a71b 100644
--- a/include/tgbot/Bot.h
+++ b/include/tgbot/Bot.h
@@ -3,8 +3,6 @@
#include "tgbot/Api.h"
#include "tgbot/EventHandler.h"
-#include "tgbot/net/HttpClient.h"
-#include "tgbot/net/BoostHttpOnlySslClient.h"
#include <memory>
#include <string>
@@ -13,6 +11,7 @@
namespace TgBot {
class EventBroadcaster;
+class HttpClient;
/**
* @brief This object holds other objects specific for this bot instance.
@@ -53,10 +52,7 @@ public:
}
private:
- static HttpClient& _getDefaultHttpClient() {
- static BoostHttpOnlySslClient instance;
- return instance;
- }
+ static HttpClient &_getDefaultHttpClient();
const std::string _token;
const Api _api;
diff --git a/src/Bot.cpp b/src/Bot.cpp
index e0acbdb..11bea2c 100644
--- a/src/Bot.cpp
+++ b/src/Bot.cpp
@@ -1,3 +1,4 @@
+#include "tgbot/net/BoostHttpOnlySslClient.h"
#include "tgbot/Bot.h"
#include "tgbot/EventBroadcaster.h"
@@ -14,4 +15,9 @@ Bot::Bot(std::string token, const HttpClient& httpClient)
, _eventHandler(getEvents()) {
}
+HttpClient& Bot::_getDefaultHttpClient() {
+ static BoostHttpOnlySslClient instance;
+ return instance;
+}
+
}