summary refs log tree commit diff
path: root/src/mongoStub.hpp
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:32:55 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:32:55 +0200
commitf46ca1c3415357d6fd582a582a642179c4455b1f (patch)
tree1609cf3a6be54fd03ea3d04b57e701e22be5f42c /src/mongoStub.hpp
parentMerge branch 'master' into util (diff)
parentMerge pull request #21 from ItsNewe/master (diff)
downloadserver-f46ca1c3415357d6fd582a582a642179c4455b1f.tar.xz
Merge branch 'rtc'
Diffstat (limited to '')
-rw-r--r--src/mongoStub.hpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/mongoStub.hpp b/src/mongoStub.hpp
new file mode 100644

index 00000000..2809142f --- /dev/null +++ b/src/mongoStub.hpp
@@ -0,0 +1,41 @@ +#ifndef MONGOSTUB_HPP +#define MONGOSTUB_HPP + +#include <boost/utility.hpp> +#include <cstdint> +#include <iostream> +#include <vector> +#include <mongocxx/client.hpp> +#include <mongocxx/instance.hpp> +#include <mongocxx/change_stream.hpp> +#include <bsoncxx/json.hpp> +#include <bsoncxx/document/element.hpp> + + +class mongoStub{ + public: + mongoStub(); + + 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; + mongocxx::client client{mongocxx::uri{}}; + mongocxx::database db; + mongocxx::collection col; + mongocxx::change_stream* colCs = nullptr; + + void handleUdpRequest(std::string address, int port, std::string mode); + void handleVoiceRequest(); +}; + +#endif