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-24 17:51:06 +0200
committerGitHub <noreply@github.com>2021-05-24 17:51:06 +0200
commit2e1a821601299f212df414262defaf72edbeaa67 (patch)
tree626afe93c2bf9ad7176964f4beb70f2059daf798 /src/mongoStub.hpp
parentMerge pull request #19 from ItsNewe/master (diff)
parent[edit] Deprecate gRPC in favor of MongoDB (diff)
downloadserver-2e1a821601299f212df414262defaf72edbeaa67.tar.xz
Merge pull request #20 from ItsNewe/master
[edit] Deprecate gRPC in favor of MongoDB
Diffstat (limited to '')
-rw-r--r--src/mongoStub.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mongoStub.hpp b/src/mongoStub.hpp
new file mode 100644

index 00000000..3cee472c --- /dev/null +++ b/src/mongoStub.hpp
@@ -0,0 +1,29 @@ +#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/v_noabi/mongocxx/change_stream.hpp> +#include <bsoncxx/json.hpp> + + +class mongoStub : boost::noncopyable { + public: + mongoStub(); + std::vector<std::string> 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; +}; + +#endif