Medial Code Documentation
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
base.h File Reference

defines configuration macros More...

#include <sys/types.h>
#include <inttypes.h>
#include <string>
#include <vector>
#include <dmlc/build_config_default.h>

Go to the source code of this file.

Namespaces

namespace  dmlc
 namespace for dmlc
 

Macros

#define DMLC_USE_GLOG   0
 whether use glog for logging
 
#define DMLC_LOG_FATAL_THROW   1
 whether throw dmlc::Error instead of directly calling abort when FATAL error occured NOTE: this may still not be perfect. do not use FATAL and CHECK in destructors
 
#define DMLC_LOG_BEFORE_THROW   0
 whether always log a message before throw This can help identify the error that cannot be catched.
 
#define DMLC_LOG_CUSTOMIZE   0
 Whether to use customized logger, whose output can be decided by other libraries.
 
#define DMLC_LOG_DEBUG   1
 Whether to enable debug logging feature.
 
#define DMLC_LOG_NODATE   0
 Whether to disable date message on the log.
 
#define DMLC_USE_HDFS   0
 whether compile with hdfs support
 
#define DMLC_USE_S3   0
 whether compile with s3 support
 
#define DMLC_USE_PS   0
 whether or not use parameter server
 
#define DMLC_USE_CXX11   (__cplusplus >= 201103L)
 whether or not use c++11 support
 
#define DMLC_STRICT_CXX11   (__cplusplus >= 201103L)
 strict CXX11 support
 
#define DMLC_CXX11_THREAD_LOCAL   (__cplusplus >= 201103L)
 Whether cxx11 thread local is supported.
 
#define DMLC_MODERN_THREAD_LOCAL   1
 Whether to use modern thread local construct.
 
#define DMLC_ENABLE_RTTI   1
 whether RTTI is enabled
 
#define DMLC_USE_FOPEN64   1
 whether use fopen64
 
#define DMLC_IO_USE_LITTLE_ENDIAN   1
 check for C++11 support
 
#define DMLC_ENABLE_STD_THREAD   DMLC_USE_CXX11
 Enable std::thread related modules, Used to disable some module in mingw compile.
 
#define DMLC_USE_REGEX   DMLC_STRICT_CXX11
 whether enable regex support, actually need g++-4.9 or higher
 
#define DMLC_ATTRIBUTE_UNUSED
 helper macro to supress unused warning
 
#define DMLC_SUPPRESS_UBSAN
 helper macro to supress Undefined Behavior Sanitizer for a specific function
 
#define DMLC_STR_CONCAT_(__x, __y)   __x##__y
 helper macro to generate string concat
 
#define DMLC_STR_CONCAT(__x, __y)   DMLC_STR_CONCAT_(__x, __y)
 
#define DISALLOW_COPY_AND_ASSIGN(T)
 Disable copy constructor and assignment operator.
 
#define DMLC_NO_INLINE   __attribute__((noinline))
 
#define DMLC_ALWAYS_INLINE   inline
 
#define DMLC_THROW_EXCEPTION
 
#define DMLC_NO_EXCEPTION
 

Functions

template<typename T >
T * dmlc::BeginPtr (std::vector< T > &vec)
 safely get the beginning address of a vector
 
template<typename T >
const T * dmlc::BeginPtr (const std::vector< T > &vec)
 get the beginning address of a const vector
 
char * dmlc::BeginPtr (std::string &str)
 get the beginning address of a string
 
const char * dmlc::BeginPtr (const std::string &str)
 get the beginning address of a const string
 

Detailed Description

defines configuration macros

Copyright (c) 2015 by Contributors

Macro Definition Documentation

◆ DISALLOW_COPY_AND_ASSIGN

#define DISALLOW_COPY_AND_ASSIGN (   T)
Value:
T(T const&); \
T& operator=(T const&)

Disable copy constructor and assignment operator.

If C++11 is supported, both copy and move constructors and assignment operators are deleted explicitly. Otherwise, they are only declared but not implemented. Place this macro in private section if C++11 is not available.

◆ DMLC_IO_USE_LITTLE_ENDIAN

#define DMLC_IO_USE_LITTLE_ENDIAN   1

check for C++11 support

Use little endian for binary serialization if this is set to 0, use big endian.