summary refs log tree commit diff
path: root/src/mongoStub.hpp
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-25 23:38:06 +0200
committerGitHub <noreply@github.com>2021-05-25 23:38:06 +0200
commitd2fb1ee4588436eca9bb0097bd06ca05dbc3e5f0 (patch)
tree28421cf19cd53b2e75fe64d844215145967d1ee3 /src/mongoStub.hpp
parentMerge pull request #20 from ItsNewe/master (diff)
parent[del] Deleted .proto (diff)
downloadserver-d2fb1ee4588436eca9bb0097bd06ca05dbc3e5f0.tar.xz
Merge pull request #21 from ItsNewe/master
Mongo payload data retrieval
Diffstat (limited to 'src/mongoStub.hpp')
-rw-r--r--src/mongoStub.hpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mongoStub.hpp b/src/mongoStub.hpp

index 3cee472c..2809142f 100644 --- a/src/mongoStub.hpp +++ b/src/mongoStub.hpp
@@ -7,16 +7,25 @@ #include <vector> #include <mongocxx/client.hpp> #include <mongocxx/instance.hpp> -#include <mongocxx/v_noabi/mongocxx/change_stream.hpp> +#include <mongocxx/change_stream.hpp> #include <bsoncxx/json.hpp> +#include <bsoncxx/document/element.hpp> -class mongoStub : boost::noncopyable { +class mongoStub{ public: mongoStub(); - std::vector<std::string> getNewMessages(mongocxx::change_stream* colCs); + + struct mongoMessage{ + std::string eventName; + std::vector<std::string> data; + }; + + std::vector<mongoMessage> getNewMessages(mongocxx::change_stream* colCs); mongocxx::collection getCol() const { return col; } + + private: mongocxx::instance instance; @@ -24,6 +33,9 @@ class mongoStub : boost::noncopyable { mongocxx::database db; mongocxx::collection col; mongocxx::change_stream* colCs = nullptr; + + void handleUdpRequest(std::string address, int port, std::string mode); + void handleVoiceRequest(); }; #endif