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
commite5d4696304c6689379ac7ce334512404d4b7836c (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/lwtrace/symbol.h
parentd6d7db348c2cc64e71243cab9940ee6778f4317d (diff)
downloadydb-e5d4696304c6689379ac7ce334512404d4b7836c.tar.gz
Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 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 2e7d3da745..ef9e6cdf94 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;
+ }
+ };
+
+}