#ifndef _PARSER_H_ #define _PARSER_H_ #include #include #include #include #include "../sql/db_handle.h" #include "../common/common.h" #include "../common/formatting.h" #include "../ws/ssl_ws.h" #include "./parser_aux.h" //TODO: Remove ws here and use a safequeue namespace parser { /******************************************************************************* Parser object *******************************************************************************/ class parser { public: parser(ws::connection_metadata::ptr, pqxx::connection*); ~parser(void); void process_queue(); void process_queue_start(); void process_queue_stop(); void process_queue_thread_join(); private: ws::connection_metadata::ptr m_metadata; bool m_process_queue_state; pthread_t m_process_queue_thread; pqxx::connection* m_connection; static void* process_queue_helper(void*); }; /******************************************************************************* Message parsing *******************************************************************************/ template ws_msg_parsed single(std::string); template ws_msg_parsed single_j(nlohmann::json); template <> ws_msg_parsed single(std::string); template<> ws_msg_parsed single(std::string); template <> ws_msg_parsed single_j(nlohmann::json ); template<> ws_msg_parsed single(std::string); template <> ws_msg_parsed single(std::string); } // parser #endif