aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/lwtrace/symbol.h
diff options
context:
space:
mode:
authorserxa <serxa@yandex-team.ru>2022-02-10 16:49:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:08 +0300
commitd6d7db348c2cc64e71243cab9940ee6778f4317d (patch)
treebac67f42a02f9368eb4d329f5d79b77d0a6adc18 /library/cpp/lwtrace/symbol.h
parent8d57b69dee81198a59c39e64704f7dc9f04b4fbf (diff)
downloadydb-d6d7db348c2cc64e71243cab9940ee6778f4317d.tar.gz
Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/lwtrace/symbol.h')
-rw-r--r--library/cpp/lwtrace/symbol.h132
1 files changed, 66 insertions, 66 deletions
diff --git a/library/cpp/lwtrace/symbol.h b/library/cpp/lwtrace/symbol.h
index ef9e6cdf94..2e7d3da745 100644
--- a/library/cpp/lwtrace/symbol.h
+++ b/library/cpp/lwtrace/symbol.h
@@ -1,68 +1,68 @@
-#pragma once
-
+#pragma once
+
#include <util/generic/string.h>
-#include <util/string/builder.h>
-#include <util/system/src_location.h>
-
-#define LWTRACE_DEFINE_SYMBOL(variable, text) \
- static TString variable##_holder(text); \
- ::NLWTrace::TSymbol variable(&variable##_holder); \
- /**/
-
-#define LWTRACE_INLINE_SYMBOL(text) \
- [&] { \
- static TString _holder(text); \
- return ::NLWTrace::TSymbol(&_holder); \
- }() /**/
-
-#define LWTRACE_LOCATION_SYMBOL \
- [](const char* func) { \
+#include <util/string/builder.h>
+#include <util/system/src_location.h>
+
+#define LWTRACE_DEFINE_SYMBOL(variable, text) \
+ static TString variable##_holder(text); \
+ ::NLWTrace::TSymbol variable(&variable##_holder); \
+ /**/
+
+#define LWTRACE_INLINE_SYMBOL(text) \
+ [&] { \
+ static TString _holder(text); \
+ return ::NLWTrace::TSymbol(&_holder); \
+ }() /**/
+
+#define LWTRACE_LOCATION_SYMBOL \
+ [](const char* func) { \
static TString _holder(TStringBuilder() << func << " (" << __LOCATION__ << ")"); \
- return ::NLWTrace::TSymbol(&_holder); \
- }(Y_FUNC_SIGNATURE) /**/
-
-namespace NLWTrace {
- struct TSymbol {
- TString* Str;
-
- TSymbol()
- : Str(nullptr)
- {
- }
-
- explicit TSymbol(TString* str)
- : Str(str)
- {
- }
-
- TSymbol& operator=(const TSymbol& o) {
- Str = o.Str;
- return *this;
- }
-
- TSymbol(const TSymbol& o)
- : Str(o.Str)
- {
- }
-
- bool operator<(const TSymbol& rhs) const {
- return Str < rhs.Str;
- }
- bool operator>(const TSymbol& rhs) const {
- return Str > rhs.Str;
- }
- bool operator<=(const TSymbol& rhs) const {
- return Str <= rhs.Str;
- }
- bool operator>=(const TSymbol& rhs) const {
- return Str >= rhs.Str;
- }
- bool operator==(const TSymbol& rhs) const {
- return Str == rhs.Str;
- }
- bool operator!=(const TSymbol& rhs) const {
- return Str != rhs.Str;
- }
- };
-
-}
+ return ::NLWTrace::TSymbol(&_holder); \
+ }(Y_FUNC_SIGNATURE) /**/
+
+namespace NLWTrace {
+ struct TSymbol {
+ TString* Str;
+
+ TSymbol()
+ : Str(nullptr)
+ {
+ }
+
+ explicit TSymbol(TString* str)
+ : Str(str)
+ {
+ }
+
+ TSymbol& operator=(const TSymbol& o) {
+ Str = o.Str;
+ return *this;
+ }
+
+ TSymbol(const TSymbol& o)
+ : Str(o.Str)
+ {
+ }
+
+ bool operator<(const TSymbol& rhs) const {
+ return Str < rhs.Str;
+ }
+ bool operator>(const TSymbol& rhs) const {
+ return Str > rhs.Str;
+ }
+ bool operator<=(const TSymbol& rhs) const {
+ return Str <= rhs.Str;
+ }
+ bool operator>=(const TSymbol& rhs) const {
+ return Str >= rhs.Str;
+ }
+ bool operator==(const TSymbol& rhs) const {
+ return Str == rhs.Str;
+ }
+ bool operator!=(const TSymbol& rhs) const {
+ return Str != rhs.Str;
+ }
+ };
+
+}