AFIO  v2.00 late alpha
config.hpp File Reference

Configures a compiler environment for AFIO header and source code. More...

#include "quickcpplib/include/cpp_feature.h"
#include "quickcpplib/include/import.h"
#include "quickcpplib/include/config.hpp"
#include "quickcpplib/include/bitfield.hpp"
#include "quickcpplib/include/scoped_undo.hpp"
#include "quickcpplib/include/span.hpp"
#include "quickcpplib/include/optional.hpp"
#include "quickcpplib/include/string_view.hpp"
#include "outcome/include/outcome.hpp"
#include "quickcpplib/include/ringbuffer_log.hpp"
#include "quickcpplib/include/utils/thread.hpp"
#include <cstdio>
#include <ctime>

Classes

struct  afio_v2_xxx::path_hasher
 
struct  afio_v2_xxx::error_info
 The cause of the failure of an operation in AFIO. More...
 
class  afio_v2_xxx::error
 The exception type synthesised and thrown when an afio::result or afio::outcome is no-value observed. More...
 
class  afio_v2_xxx::log_level_guard
 RAII class for temporarily adjusting the log level. More...
 

Namespaces

 afio_v2_xxx
 The AFIO namespace.
 
 afio_v2_xxx::algorithm
 Collection of file system based algorithms.
 
 afio_v2_xxx::storage_profile
 YAML databaseable empirical testing of a storage's behaviour.
 
 afio_v2_xxx::utils
 Utility routines often useful when using AFIO.
 

Macros

#define AFIO_HEADERS_ONLY   1
 Whether AFIO is a headers only library. Defaults to 1 unless BOOST_ALL_DYN_LINK is defined.
 
#define AFIO_DISABLE_PATHS_IN_FAILURE_INFO   not defined
 Define to not record the current handle's path in any failure info.
 
#define AFIO_LOGGING_LEVEL   3
 How much detail to log. 0=disabled, 1=fatal, 2=error, 3=warn, 4=info, 5=debug, 6=all. Defaults to error level.
 
#define AFIO_LOG_TO_OSTREAM   std::cerr
 Any ostream to also log to. If NDEBUG is not defined, std::cerr is the default.
 
#define AFIO_LOG_BACKTRACE_LEVELS   ((1 << 1) | (1 << 2) | (1 << 3))
 Bit mask of which log levels should be stack backtraced which will slow those logs thirty fold or so. Defaults to (1<<1)|(1<<2)|(1<<3) i.e. stack backtrace on fatal, error and warn logs.
 
#define AFIO_LOGGING_MEMORY   (1024 * 1024)
 How much memory to use for the log. Defaults to 4Kb if NDEBUG defined, else 1Mb.
 
#define AFIO_V2   (QUICKCPPLIB_BIND_NAMESPACE_VERSION(afio_v2))
 The namespace configuration of this AFIO v2. Consists of a sequence of bracketed tokens later fused by the preprocessor into namespace and C++ module names.
 
#define AFIO_V2_NAMESPACE   afio_v2_xxx
 The namespace of this AFIO v2 which will be some unknown inline namespace starting with v2_ inside the boost::afio namespace.
 
#define AFIO_V2_NAMESPACE_BEGIN
 Expands into the appropriate namespace markup to enter the AFIO v2 namespace. More...
 
#define AFIO_V2_NAMESPACE_EXPORT_BEGIN
 Expands into the appropriate namespace markup to enter the C++ module exported AFIO v2 namespace. More...
 
#define AFIO_V2_NAMESPACE_END   }
 Expands into the appropriate namespace markup to exit the AFIO v2 namespace.
 
#define AFIO_DECL
 
#define AFIO_THREAD_LOCAL_IS_CXX11   QUICKCPPLIB_THREAD_LOCAL_IS_CXX11
 
#define AFIO_THREAD_LOCAL   QUICKCPPLIB_THREAD_LOCAL
 
#define AFIO_TEMPLATE(...)   QUICKCPPLIB_TEMPLATE(__VA_ARGS__)
 
#define AFIO_TREQUIRES(...)   QUICKCPPLIB_TREQUIRES(__VA_ARGS__)
 
#define AFIO_TEXPR(...)   QUICKCPPLIB_TEXPR(__VA_ARGS__)
 
#define AFIO_TPRED(...)   QUICKCPPLIB_TPRED(__VA_ARGS__)
 
#define AFIO_GLUE2(x, y)   x##y
 
#define AFIO_GLUE(x, y)   AFIO_GLUE2(x, y)
 
#define AFIO_UNIQUE_NAME   AFIO_GLUE(__t, __COUNTER__)
 
#define AFIO_MAKE_FREE_FUNCTION
 
#define AFIO_LOG_INST_TO_TLS(inst)
 
#define AFIO_LOG_FATAL_TO_CERR(expr)
 
#define AFIO_LOG_FATAL(inst, message)
 
#define AFIO_LOG_ERROR(inst, message)   AFIO_V2_NAMESPACE::log().emplace_back(QUICKCPPLIB_NAMESPACE::ringbuffer_log::level::error, (message), (unsigned) (uintptr_t)(inst), QUICKCPPLIB_NAMESPACE::utils::thread::this_thread_id(), (AFIO_LOG_BACKTRACE_LEVELS & (1 << 2)) ? nullptr : __func__, __LINE__)
 
#define AFIO_LOG_WARN(inst, message)   AFIO_V2_NAMESPACE::log().emplace_back(QUICKCPPLIB_NAMESPACE::ringbuffer_log::level::warn, (message), (unsigned) (uintptr_t)(inst), QUICKCPPLIB_NAMESPACE::utils::thread::this_thread_id(), (AFIO_LOG_BACKTRACE_LEVELS & (1 << 3)) ? nullptr : __func__, __LINE__)
 
#define AFIO_LOG_INFO(inst, message)
 
#define AFIO_LOG_FUNCTION_CALL(inst)   AFIO_LOG_INST_TO_TLS(inst)
 
#define AFIO_LOG_DEBUG(inst, message)
 
#define AFIO_LOG_ALL(inst, message)
 
#define AFIO_HEADERS_ONLY_FUNC_SPEC   inline
 Expands into the appropriate markup to declare an extern function exported from the AFIO DLL if not building headers only.
 
#define AFIO_HEADERS_ONLY_MEMFUNC_SPEC   inline
 Expands into the appropriate markup to declare a class member function exported from the AFIO DLL if not building headers only.
 
#define AFIO_HEADERS_ONLY_VIRTUAL_SPEC   inline virtual
 Expands into the appropriate markup to declare a virtual class member function exported from the AFIO DLL if not building headers only.
 

Typedefs

template<class T >
using afio_v2_xxx::result = OUTCOME_V2_NAMESPACE::result< T, error_info >
 
template<class T >
using afio_v2_xxx::outcome = OUTCOME_V2_NAMESPACE::outcome< T, error_info >
 
using afio_v2_xxx::log_level = QUICKCPPLIB_NAMESPACE::ringbuffer_log::level
 Enum for the log level.
 
using afio_v2_xxx::win::handle = void *
 
using afio_v2_xxx::win::dword = unsigned long
 

Functions

bool afio_v2_xxx::operator== (const error_info &a, const error_info &b)
 
bool afio_v2_xxx::operator!= (const error_info &a, const error_info &b)
 
std::ostream & afio_v2_xxx::operator<< (std::ostream &s, const error_info &v)
 
std::error_code afio_v2_xxx::make_error_code (error_info ei)
 
void afio_v2_xxx::throw_as_system_error_with_payload (const error_info &ei)
 
QUICKCPPLIB_NAMESPACE::ringbuffer_log::simple_ringbuffer_log< AFIO_LOGGING_MEMORY > & afio_v2_xxx::log () noexcept
 The log used by AFIO.
 
template<class R , class U >
function_ptr< R > afio_v2_xxx::detail::make_function_ptr (U &&f)
 
template<class R , class U , class... Args>
function_ptr< R > afio_v2_xxx::detail::emplace_function_ptr (Args &&... args)
 

Detailed Description

Configures a compiler environment for AFIO header and source code.

Macro Definition Documentation

◆ AFIO_LOG_FATAL

#define AFIO_LOG_FATAL (   inst,
  message 
)
Value:
{ \
AFIO_V2_NAMESPACE::log().emplace_back(QUICKCPPLIB_NAMESPACE::ringbuffer_log::level::fatal, (message), (unsigned) (uintptr_t)(inst), QUICKCPPLIB_NAMESPACE::utils::thread::this_thread_id(), (AFIO_LOG_BACKTRACE_LEVELS & (1 << 1)) ? nullptr : __func__, __LINE__); \
AFIO_LOG_FATAL_TO_CERR(message); \
}
QUICKCPPLIB_NAMESPACE::ringbuffer_log::simple_ringbuffer_log< AFIO_LOGGING_MEMORY > & log() noexcept
The log used by AFIO.
Definition: config.hpp:447
#define AFIO_LOG_BACKTRACE_LEVELS
Bit mask of which log levels should be stack backtraced which will slow those logs thirty fold or so...
Definition: config.hpp:68

◆ AFIO_LOG_FATAL_TO_CERR

#define AFIO_LOG_FATAL_TO_CERR (   expr)
Value:
fprintf(stderr, "%s\n", (expr)); \
fflush(stderr)