souffle  2.0.2-371-g6315b36
Namespaces | Macros | Typedefs | Functions
MiscUtil.h File Reference
#include "tinyformat.h"
#include <cassert>
#include <chrono>
#include <cstdlib>
#include <iostream>
#include <memory>
#include <utility>
Include dependency graph for MiscUtil.h:

Go to the source code of this file.

Namespaces

 souffle
 

Macros

#define UNREACHABLE_BAD_CASE_ANALYSIS   fatal("unhandled switch branch");
 

Typedefs

template<typename A , typename B >
using souffle::copy_const_t = std::conditional_t< std::is_const_v< A >, const B, B >
 
using souffle::time_point = std::chrono::high_resolution_clock::time_point
 

Functions

template<typename B , typename A >
std::enable_if_t< std::is_base_of_v< A, B >, copy_const_t< A, B > * > souffle::as (A &x)
 
template<typename B , typename A >
auto souffle::as (A *x)
 Helpers for dynamic_casting without having to specify redundant type qualifiers. More...
 
template<typename B , typename A >
B * souffle::as (const std::unique_ptr< A > &x)
 
template<typename A >
std::unique_ptr< A > souffle::clone (const A *node)
 
template<typename A , typename B >
auto souffle::clone (const std::pair< A, B > &p)
 
template<typename A >
std::unique_ptr< A > souffle::clone (const std::unique_ptr< A > &node)
 
long souffle::duration_in_ns (const time_point &start, const time_point &end)
 
long souffle::duration_in_us (const time_point &start, const time_point &end)
 
template<typename T >
bool souffle::equal_ptr (const std::unique_ptr< T > &a, const std::unique_ptr< T > &b)
 Compares two values referenced by a pointer where the case where both pointers are null is also considered equivalent. More...
 
template<typename T >
bool souffle::equal_ptr (const T *a, const T *b)
 Compares two values referenced by a pointer where the case where both pointers are null is also considered equivalent. More...
 
template<typename... Args>
void souffle::fatal (const char *format, const Args &... args)
 
template<typename B , typename A >
std::enable_if_t< std::is_base_of_v< A, B >, bool > souffle::isA (A &x)
 
template<typename B , typename A >
bool souffle::isA (A *x)
 Checks if the object of type Source can be casted to type Destination. More...
 
template<typename B , typename A >
bool souffle::isA (const std::unique_ptr< A > &x)
 
time_point souffle::now ()
 

Macro Definition Documentation

◆ UNREACHABLE_BAD_CASE_ANALYSIS

#define UNREACHABLE_BAD_CASE_ANALYSIS   fatal("unhandled switch branch");

Definition at line 206 of file MiscUtil.h.