mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into engine-api
This commit is contained in:
commit
ee9da6b661
|
@ -572,14 +572,6 @@ void AgencyCommManager::failedNonLocking(
|
|||
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline std::ostream& operator<<(std::ostream& o, std::deque<T> const& d) {
|
||||
for (const auto& i : d) {
|
||||
o << i << " ";
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
std::string AgencyCommManager::redirect(
|
||||
std::unique_ptr<httpclient::GeneralClientConnection> connection,
|
||||
std::string const& endpoint, std::string const& location,
|
||||
|
|
|
@ -478,14 +478,6 @@ bool State::createCollection(std::string const& name) {
|
|||
return true;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
std::ostream& operator<<(std::ostream& o, std::deque<T> const& d) {
|
||||
for (auto const& i : d) {
|
||||
o << i;
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
/// Load collections
|
||||
bool State::loadCollections(TRI_vocbase_t* vocbase,
|
||||
QueryRegistry* queryRegistry, bool waitForSync) {
|
||||
|
|
|
@ -114,4 +114,121 @@ void TRI_ShutdownDebugging();
|
|||
void TRI_FlushDebugging();
|
||||
void TRI_FlushDebugging(char const* file, int line, char const* message);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief dump vector contents to an ostream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename T>
|
||||
std::ostream& operator<<(std::ostream& stream, std::vector<T> const& data) {
|
||||
bool first = true;
|
||||
|
||||
stream << "[";
|
||||
for (auto const& it : data) {
|
||||
if (first) {
|
||||
stream << " ";
|
||||
first = false;
|
||||
} else {
|
||||
stream << ", ";
|
||||
}
|
||||
stream << it;
|
||||
}
|
||||
stream << " ]";
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief dump deque contents to an ostream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename T>
|
||||
std::ostream& operator<<(std::ostream& stream, std::deque<T> const& data) {
|
||||
bool first = true;
|
||||
|
||||
stream << "[";
|
||||
for (auto const& it : data) {
|
||||
if (first) {
|
||||
stream << " ";
|
||||
first = false;
|
||||
} else {
|
||||
stream << ", ";
|
||||
}
|
||||
stream << it;
|
||||
}
|
||||
stream << " ]";
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief dump unordered_set contents to an ostream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename T>
|
||||
std::ostream& operator<<(std::ostream& stream,
|
||||
std::unordered_set<T> const& data) {
|
||||
bool first = true;
|
||||
|
||||
stream << "{";
|
||||
for (auto const& it : data) {
|
||||
if (first) {
|
||||
stream << " ";
|
||||
first = false;
|
||||
} else {
|
||||
stream << ", ";
|
||||
}
|
||||
stream << it;
|
||||
}
|
||||
stream << " }";
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief dump unordered_map contents to an ostream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename K, typename V>
|
||||
std::ostream& operator<<(std::ostream& stream,
|
||||
std::unordered_map<K, V> const& data) {
|
||||
bool first = true;
|
||||
|
||||
stream << "{";
|
||||
for (auto const& it : data) {
|
||||
if (first) {
|
||||
stream << " ";
|
||||
first = false;
|
||||
} else {
|
||||
stream << ", ";
|
||||
}
|
||||
stream << it.first << ": " << it.second;
|
||||
}
|
||||
stream << " }";
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief dump unordered_map contents to an ostream
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename K, typename V>
|
||||
std::ostream& operator<<(std::ostream& stream, std::map<K, V> const& data) {
|
||||
bool first = true;
|
||||
|
||||
stream << "{";
|
||||
for (auto const& it : data) {
|
||||
if (first) {
|
||||
stream << " ";
|
||||
first = false;
|
||||
} else {
|
||||
stream << ", ";
|
||||
}
|
||||
stream << it.first << ": " << it.second;
|
||||
}
|
||||
stream << " }";
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -88,52 +88,6 @@ class LoggerStream {
|
|||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
LoggerStream& operator<<(std::vector<T> const& obj) {
|
||||
_out << '[';
|
||||
size_t i = 0;
|
||||
size_t const n = obj.size();
|
||||
for (auto const& it : obj) {
|
||||
_out << it;
|
||||
if (++i < n) {
|
||||
_out << ", ";
|
||||
}
|
||||
}
|
||||
_out << ']';
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
LoggerStream& operator<<(std::unordered_set<T> const& obj) {
|
||||
_out << '{';
|
||||
size_t i = 0;
|
||||
size_t const n = obj.size();
|
||||
for (auto const& it : obj) {
|
||||
_out << it;
|
||||
if (++i < n) {
|
||||
_out << ", ";
|
||||
}
|
||||
}
|
||||
_out << '}';
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
LoggerStream& operator<<(std::unordered_map<K, V> const& obj) {
|
||||
_out << '{';
|
||||
size_t i = 0;
|
||||
size_t n = obj.size();
|
||||
for (auto const& it : obj) {
|
||||
_out << it;
|
||||
if (++i < n) {
|
||||
_out << ", ";
|
||||
}
|
||||
_out << it.first << " => " << it.second;
|
||||
}
|
||||
_out << '}';
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
std::stringstream _out;
|
||||
size_t _topicId;
|
||||
|
|
Loading…
Reference in New Issue