Covalent Bond  0.0.1-alpha
'covalent bond' is a data middle office. As a 2022-2023 Fall SWE final project.
Macros
pch.hpp File Reference

The precompiled head. More...

#include <iostream>
#include <string>
#include <cmath>
#include <sstream>
#include <fstream>
#include <vector>
#include <cstdint>
#include <unordered_map>
#include <functional>
#include <fmt/core.h>
#include <fmt/chrono.h>
#include <fmt/ranges.h>
#include <fmt/os.h>
#include <fmt/color.h>
#include <rapidjson/document.h>
#include <rapidjson/writer.h>
#include <rapidjson/reader.h>
#include <rapidjson/stringbuffer.h>
#include <glog/logging.h>
Include dependency graph for pch.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FMT_HEADER_ONLY
 _WIN32 More...
 
#define CB_GLOG   1
 
#define LOG_INFO   LOG(INFO)
 
#define LOG_ERR   LOG(ERROR)
 
#define LOG_WARN   LOG(WARN)
 
#define LOG_FATAL   LOG(FATAL)
 
#define LOG_CHECK(x, ...)
 
#define CHECK_LOWER_THAN(x, y, ...)   LOG_CHECK((x) < (y), __VA_ARGS__)
 
#define CHECK_GREATER_THAN(x, y, ...)   LOG_CHECK((x) > (y), __VA_ARGS__)
 
#define CHECK_EQUAL(x, y, ...)   LOG_CHECK((x) == (y), __VA_ARGS__)
 
#define CHECK_LOWER_EQUAL(x, y, ...)   LOG_CHECK((x) <= (y), __VA_ARGS__)
 
#define CHECK_GREATER_EQUAL(x, y, ...)   LOG_CHECK((x) >= (y), __VA_ARGS__)
 
#define CHECK_NOT_EQUAL(x, y, ...)   LOG_CHECK((x) != (y), __VA_ARGS__)
 
#define CHECK_NULL(x, ...)   LOG_CHECK((x) != NULL, __VA_ARGS__)
 
#define CB_ALIGNED(x)   __attribute__((aligned(x)))
 CB_GLOG == 0. More...
 
#define CB_FORCE_INLINE   inline __attribute__((always_inline))
 
#define CB_INLINE_CPU   CB_FORCE_INLINE
 
#define CB_INLINE_NORMAL   inline
 
#define CB_CONSTEXPR   constexpr
 
#define CB_IS_NAN(func)   std::isnan(func)
 
#define CB_IS_INF(func)   std::isinf(func)
 
#define NO_TYPE_PTR   void*
 
#define CB_SHAPE_ERROR_EXIT   1
 
#define CB_TYPE_ERROR_EXIT   2
 
#define CB_MEM_ERROR_EXIT   3
 
#define CB_OTHER_ERROR_EXIT   4
 
#define CB_USE_SOL   true
 
#define MAKE_SHARED(x)   std::make_shared<x>
 
#define SHARED_PTR(x)   std::shared_ptr<x>
 

Detailed Description

The precompiled head.

Author
chenghua Wang (cheng.nosp@m.hua..nosp@m.wang..nosp@m.edu@.nosp@m.gmail.nosp@m..com)
Version
0.1
Date
2022-10-22

Definition in file pch.hpp.

Macro Definition Documentation

◆ CB_ALIGNED

#define CB_ALIGNED (   x)    __attribute__((aligned(x)))

CB_GLOG == 0.

To align the data.

x normally set to 4, 8, 16. This attribute will make data aligned to x. For example, you can use this macro like this: float foo_1[10] CB_ALIGNED(4); int32_t foo_2[10] CB_ALIGNED(8);

Definition at line 157 of file pch.hpp.

◆ CB_CONSTEXPR

#define CB_CONSTEXPR   constexpr

Definition at line 168 of file pch.hpp.

◆ CB_FORCE_INLINE

#define CB_FORCE_INLINE   inline __attribute__((always_inline))

Definition at line 163 of file pch.hpp.

◆ CB_GLOG

#define CB_GLOG   1

Definition at line 56 of file pch.hpp.

◆ CB_INLINE_CPU

#define CB_INLINE_CPU   CB_FORCE_INLINE

Definition at line 164 of file pch.hpp.

◆ CB_INLINE_NORMAL

#define CB_INLINE_NORMAL   inline

Definition at line 165 of file pch.hpp.

◆ CB_IS_INF

#define CB_IS_INF (   func)    std::isinf(func)

Definition at line 171 of file pch.hpp.

◆ CB_IS_NAN

#define CB_IS_NAN (   func)    std::isnan(func)

Definition at line 170 of file pch.hpp.

◆ CB_MEM_ERROR_EXIT

#define CB_MEM_ERROR_EXIT   3

Definition at line 177 of file pch.hpp.

◆ CB_OTHER_ERROR_EXIT

#define CB_OTHER_ERROR_EXIT   4

Definition at line 178 of file pch.hpp.

◆ CB_SHAPE_ERROR_EXIT

#define CB_SHAPE_ERROR_EXIT   1

Definition at line 175 of file pch.hpp.

◆ CB_TYPE_ERROR_EXIT

#define CB_TYPE_ERROR_EXIT   2

Definition at line 176 of file pch.hpp.

◆ CB_USE_SOL

#define CB_USE_SOL   true

Definition at line 180 of file pch.hpp.

◆ CHECK_EQUAL

#define CHECK_EQUAL (   x,
  y,
  ... 
)    LOG_CHECK((x) == (y), __VA_ARGS__)

Definition at line 141 of file pch.hpp.

◆ CHECK_GREATER_EQUAL

#define CHECK_GREATER_EQUAL (   x,
  y,
  ... 
)    LOG_CHECK((x) >= (y), __VA_ARGS__)

Definition at line 143 of file pch.hpp.

◆ CHECK_GREATER_THAN

#define CHECK_GREATER_THAN (   x,
  y,
  ... 
)    LOG_CHECK((x) > (y), __VA_ARGS__)

Definition at line 140 of file pch.hpp.

◆ CHECK_LOWER_EQUAL

#define CHECK_LOWER_EQUAL (   x,
  y,
  ... 
)    LOG_CHECK((x) <= (y), __VA_ARGS__)

Definition at line 142 of file pch.hpp.

◆ CHECK_LOWER_THAN

#define CHECK_LOWER_THAN (   x,
  y,
  ... 
)    LOG_CHECK((x) < (y), __VA_ARGS__)

Definition at line 139 of file pch.hpp.

◆ CHECK_NOT_EQUAL

#define CHECK_NOT_EQUAL (   x,
  y,
  ... 
)    LOG_CHECK((x) != (y), __VA_ARGS__)

Definition at line 144 of file pch.hpp.

◆ CHECK_NULL

#define CHECK_NULL (   x,
  ... 
)    LOG_CHECK((x) != NULL, __VA_ARGS__)

Definition at line 145 of file pch.hpp.

◆ FMT_HEADER_ONLY

#define FMT_HEADER_ONLY

_WIN32

defined(unix) && defined(clang) _WIN32 unix

Definition at line 43 of file pch.hpp.

◆ LOG_CHECK

#define LOG_CHECK (   x,
  ... 
)
Value:
if (!(x)) { \
LOG_ERR << "Failed when testing " << #x << "\n"; \
std::cerr, __VA_ARGS__, std::endl; \
std::exit(1); \
}

Definition at line 132 of file pch.hpp.

◆ LOG_ERR

#define LOG_ERR   LOG(ERROR)

Definition at line 128 of file pch.hpp.

◆ LOG_FATAL

#define LOG_FATAL   LOG(FATAL)

Definition at line 130 of file pch.hpp.

◆ LOG_INFO

#define LOG_INFO   LOG(INFO)

Definition at line 127 of file pch.hpp.

◆ LOG_WARN

#define LOG_WARN   LOG(WARN)

Definition at line 129 of file pch.hpp.

◆ MAKE_SHARED

#define MAKE_SHARED (   x)    std::make_shared<x>

Definition at line 182 of file pch.hpp.

◆ NO_TYPE_PTR

#define NO_TYPE_PTR   void*

Definition at line 173 of file pch.hpp.

◆ SHARED_PTR

#define SHARED_PTR (   x)    std::shared_ptr<x>

Definition at line 183 of file pch.hpp.