dxFeed Graal CXX API v4.2.0
Loading...
Searching...
No Matches
Debug.hpp
1// Copyright (c) 2025 Devexperts LLC.
2// SPDX-License-Identifier: MPL-2.0
3
4#pragma once
5
6#include "../../Conf.hpp"
7
9
10// #define DXFCPP_DEBUG 1
11// #define DXFCPP_TRACE_LISTS 1
12// #define DXFCPP_TRACE_ISOLATES 1
13
14#ifndef DXFCPP_DEBUG
15# define DXFCPP_DEBUG 0
16#endif
17
18#ifndef DXFCPP_TRACE_ISOLATES
19# define DXFCPP_TRACE_ISOLATES 0
20#endif
21#ifndef DXFCPP_TRACE_LISTS
22# define DXFCPP_TRACE_LISTS 0
23#endif
24
26# define DXFCPP_TRACE DXFCPP_DEBUG
27#endif
28
30
31#if DXFCPP_DEBUG == 0
32
33static inline std::string getDebugName() {
34 return {};
35}
36
37struct DXFCPP_EXPORT Debugger {
38 static constexpr bool isDebug = false;
39 static constexpr bool traceIsolates = false;
40 static constexpr bool traceLists = false;
41
42 static void debug(std::string) {
43 }
44 static void trace(std::string) {
45 }
46};
47
48#else
49
50struct DXFCPP_EXPORT Debugger {
51 static constexpr bool isDebug = true;
52# if DXFCPP_TRACE_ISOLATES == 1
53 static constexpr bool traceIsolates = true;
54# else
55 static constexpr bool traceIsolates = false;
56# endif
57
58# if DXFCPP_TRACE_LISTS == 1
59 static constexpr bool traceLists = true;
60# else
61 static constexpr bool traceLists = false;
62# endif
63 static std::string nowStr();
64 static std::string nowStrWithTimeZone();
65 static std::string debugPrefixStr();
66 static void debug(std::string);
67# if DXFCPP_TRACE == 1
68 static std::string tracePrefixStr();
69 static void trace(std::string);
70# else
71 static void trace(std::string) {
72 }
73# endif
74};
75
76#endif
77
79
#define DXFCXX_DISABLE_MSC_WARNINGS_POP()
Definition Conf.hpp:22
#define DXFCPP_END_NAMESPACE
Definition Conf.hpp:70
#define DXFCPP_BEGIN_NAMESPACE
Definition Conf.hpp:67
#define DXFCXX_DISABLE_GCC_WARNINGS_PUSH(warnings)
Definition Conf.hpp:38
#define DXFCXX_DISABLE_GCC_WARNINGS_POP()
Definition Conf.hpp:40
#define DXFCXX_DISABLE_MSC_WARNINGS_PUSH(warnings)
Definition Conf.hpp:21
#define DXFCPP_TRACE_ISOLATES
Definition Debug.hpp:19
#define DXFCPP_DEBUG
Definition Debug.hpp:15
#define DXFCPP_TRACE_LISTS
Definition Debug.hpp:22
#define DXFCPP_EXPORT
Definition api.h:35
Base abstract class for all dxFeed C++ API entities.
Definition Entity.hpp:13
Marks all event types that can be received via dxFeed API.
Definition EventType.hpp:31
A helper class needed to construct smart pointers to objects, and does not allow explicit constructio...
Definition SharedEntity.hpp:89
static auto createShared(Args &&...args)
Creates smart pointer to object.
Definition SharedEntity.hpp:103
Base abstract "shared entity" class. Has some helpers for dynamic polymorphism.
Definition SharedEntity.hpp:21
virtual std::string toString() const
Returns a string representation of the current object.
Definition SharedEntity.hpp:78
std::shared_ptr< T > sharedAs() const noexcept
Returns a pointer to the current object wrapped in a smart pointer to type T.
Definition SharedEntity.hpp:69
std::shared_ptr< T > sharedAs() noexcept
Returns a pointer to the current object wrapped in a smart pointer to type T.
Definition SharedEntity.hpp:56
bool is() const noexcept
Checks that pointer to the current type could be converted to type T* In other words: whether type T ...
Definition SharedEntity.hpp:35
Universal functional object that allows searching std::unordered_map for string-like keys.
Definition Common.hpp:911
A simple wrapper around strings or something similar to strings to reduce the amount of code for meth...
Definition Common.hpp:794