#pragma once

#include "ros_bridge/rapidjson/include/rapidjson/document.h"

#include <deque>
#include <memory>
#include <unordered_map>

namespace ros_bridge {
namespace com_private {

typedef rapidjson::Document JsonDoc;
typedef std::unique_ptr<JsonDoc> JsonDocUPtr;
typedef std::deque<JsonDocUPtr> JsonQueue;
typedef std::size_t HashType;

using ClientMap = std::unordered_map<HashType, std::string>;

std::size_t getHash(const std::string &str);
std::size_t getHash(const char *str);

bool getTopic(const JsonDoc &doc, std::string &topic);
bool getType(const JsonDoc &doc, std::string &type);

bool removeTopic(JsonDoc &doc);
bool removeType(JsonDoc &doc);

} // namespace com_private
} // namespace ros_bridge
