aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/dbg_output/dumpers.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/dbg_output/dumpers.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/dbg_output/dumpers.h')
-rw-r--r--library/cpp/dbg_output/dumpers.h250
1 files changed, 125 insertions, 125 deletions
diff --git a/library/cpp/dbg_output/dumpers.h b/library/cpp/dbg_output/dumpers.h
index 4868e97da0..cb4ea68126 100644
--- a/library/cpp/dbg_output/dumpers.h
+++ b/library/cpp/dbg_output/dumpers.h
@@ -1,52 +1,52 @@
-#pragma once
-
-#include "engine.h"
-
-#include <util/generic/fwd.h>
-#include <util/generic/strbuf.h>
+#pragma once
+
+#include "engine.h"
+
+#include <util/generic/fwd.h>
+#include <util/generic/strbuf.h>
#include <util/generic/string.h>
-
-//smart pointers
-template <class T, class D>
-struct TDumper<TAutoPtr<T, D>> {
- template <class S>
- static inline void Dump(S& s, const TAutoPtr<T, D>& v) {
- s << DumpRaw("TAutoPtr(") << v.Get() << DumpRaw(")");
- }
-};
-
-template <class T, class D>
-struct TDumper<THolder<T, D>> {
- template <class S>
- static inline void Dump(S& s, const THolder<T, D>& v) {
- s << DumpRaw("THolder(") << v.Get() << DumpRaw(")");
- }
-};
-
-template <class T, class Ops>
-struct TDumper<TIntrusivePtr<T, Ops>> {
- template <class S>
- static inline void Dump(S& s, const TIntrusivePtr<T, Ops>& v) {
- s << DumpRaw("TIntrusivePtr(") << v.Get() << DumpRaw(")");
- }
-};
-
-template <class T, class C, class D>
-struct TDumper<TSharedPtr<T, C, D>> {
- template <class S>
- static inline void Dump(S& s, const TSharedPtr<T, C, D>& v) {
- s << DumpRaw("TSharedPtr(") << v.Get() << DumpRaw(")");
- }
-};
-
-template <class T, class C, class D>
-struct TDumper<TCopyPtr<T, C, D>> {
- template <class S>
- static inline void Dump(S& s, const TCopyPtr<T, C, D>& v) {
- s << DumpRaw("TCopyPtr(") << v.Get() << DumpRaw(")");
- }
-};
-
+
+//smart pointers
+template <class T, class D>
+struct TDumper<TAutoPtr<T, D>> {
+ template <class S>
+ static inline void Dump(S& s, const TAutoPtr<T, D>& v) {
+ s << DumpRaw("TAutoPtr(") << v.Get() << DumpRaw(")");
+ }
+};
+
+template <class T, class D>
+struct TDumper<THolder<T, D>> {
+ template <class S>
+ static inline void Dump(S& s, const THolder<T, D>& v) {
+ s << DumpRaw("THolder(") << v.Get() << DumpRaw(")");
+ }
+};
+
+template <class T, class Ops>
+struct TDumper<TIntrusivePtr<T, Ops>> {
+ template <class S>
+ static inline void Dump(S& s, const TIntrusivePtr<T, Ops>& v) {
+ s << DumpRaw("TIntrusivePtr(") << v.Get() << DumpRaw(")");
+ }
+};
+
+template <class T, class C, class D>
+struct TDumper<TSharedPtr<T, C, D>> {
+ template <class S>
+ static inline void Dump(S& s, const TSharedPtr<T, C, D>& v) {
+ s << DumpRaw("TSharedPtr(") << v.Get() << DumpRaw(")");
+ }
+};
+
+template <class T, class C, class D>
+struct TDumper<TCopyPtr<T, C, D>> {
+ template <class S>
+ static inline void Dump(S& s, const TCopyPtr<T, C, D>& v) {
+ s << DumpRaw("TCopyPtr(") << v.Get() << DumpRaw(")");
+ }
+};
+
//small ints
// Default dumper prints them via IOutputStream << (value), which results in raw
// chars, not integer values. Cast to a bigger int type to force printing as
@@ -60,20 +60,20 @@ template <>
struct TDumper<i8>: public TDumper<i32> {
};
-//chars
-template <>
-struct TDumper<char>: public TCharDumper {
-};
-
-template <>
-struct TDumper<wchar16>: public TCharDumper {
-};
-
-//pairs
-template <class A, class B>
-struct TDumper<std::pair<A, B>> {
- template <class S>
- static inline void Dump(S& s, const std::pair<A, B>& v) {
+//chars
+template <>
+struct TDumper<char>: public TCharDumper {
+};
+
+template <>
+struct TDumper<wchar16>: public TCharDumper {
+};
+
+//pairs
+template <class A, class B>
+struct TDumper<std::pair<A, B>> {
+ template <class S>
+ static inline void Dump(S& s, const std::pair<A, B>& v) {
s.ColorScheme.Key(s);
s.ColorScheme.Literal(s);
s << v.first;
@@ -86,18 +86,18 @@ struct TDumper<std::pair<A, B>> {
s << v.second;
s.ColorScheme.ResetType(s);
s.ColorScheme.ResetRole(s);
- }
-};
-
-//sequences
-template <class T, class A>
+ }
+};
+
+//sequences
+template <class T, class A>
struct TDumper<TVector<T, A>>: public TSeqDumper {
-};
-
-template <class T, class A>
-struct TDumper<std::vector<T, A>>: public TSeqDumper {
-};
-
+};
+
+template <class T, class A>
+struct TDumper<std::vector<T, A>>: public TSeqDumper {
+};
+
template <class T>
struct TDumper<TArrayRef<T>>: public TSeqDumper {
};
@@ -106,68 +106,68 @@ template <class T, size_t N>
struct TDumper<std::array<T, N>>: public TSeqDumper {
};
-template <class T, class A>
+template <class T, class A>
struct TDumper<TDeque<T, A>>: public TSeqDumper {
-};
-
-template <class T, class A>
+};
+
+template <class T, class A>
struct TDumper<TList<T, A>>: public TSeqDumper {
-};
-
-//associatives
-template <class K, class V, class P, class A>
+};
+
+//associatives
+template <class K, class V, class P, class A>
struct TDumper<TMap<K, V, P, A>>: public TAssocDumper {
-};
-
-template <class K, class V, class P, class A>
+};
+
+template <class K, class V, class P, class A>
struct TDumper<TMultiMap<K, V, P, A>>: public TAssocDumper {
-};
-
-template <class T, class P, class A>
+};
+
+template <class T, class P, class A>
struct TDumper<TSet<T, P, A>>: public TAssocDumper {
-};
-
-template <class T, class P, class A>
+};
+
+template <class T, class P, class A>
struct TDumper<TMultiSet<T, P, A>>: public TAssocDumper {
-};
-
-template <class K, class V, class H, class P, class A>
+};
+
+template <class K, class V, class H, class P, class A>
struct TDumper<THashMap<K, V, H, P, A>>: public TAssocDumper {
-};
-
-template <class K, class V, class H, class P, class A>
+};
+
+template <class K, class V, class H, class P, class A>
struct TDumper<THashMultiMap<K, V, H, P, A>>: public TAssocDumper {
-};
-
-template <class T, class H, class P, class A>
+};
+
+template <class T, class H, class P, class A>
struct TDumper<THashSet<T, H, P, A>>: public TAssocDumper {
-};
-
-template <class T, class H, class P, class A>
+};
+
+template <class T, class H, class P, class A>
struct TDumper<THashMultiSet<T, H, P, A>>: public TAssocDumper {
-};
-
-//strings
-template <>
+};
+
+//strings
+template <>
struct TDumper<TString>: public TStrDumper {
-};
-
-template <>
-struct TDumper<const char*>: public TStrDumper {
-};
-
-template <>
+};
+
+template <>
+struct TDumper<const char*>: public TStrDumper {
+};
+
+template <>
struct TDumper<TUtf16String>: public TStrDumper {
-};
-
-template <>
-struct TDumper<const wchar16*>: public TStrDumper {
-};
-
-template <class C, class T, class A>
-struct TDumper<std::basic_string<C, T, A>>: public TStrDumper {
-};
-
-template <class TChar>
+};
+
+template <>
+struct TDumper<const wchar16*>: public TStrDumper {
+};
+
+template <class C, class T, class A>
+struct TDumper<std::basic_string<C, T, A>>: public TStrDumper {
+};
+
+template <class TChar>
struct TDumper<TBasicStringBuf<TChar>>: public TStrDumper {
-};
+};