OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OutOfMemory Class Reference

#include <BufferMgr.h>

+ Inheritance diagram for OutOfMemory:
+ Collaboration diagram for OutOfMemory:

Public Member Functions

 OutOfMemory (size_t num_bytes)
 
 OutOfMemory (const std::string &err)
 
 OutOfMemory (const std::string &err, size_t num_bytes)
 

Private Member Functions

std::string parse_error_str (const std::string &err, const size_t num_bytes=0)
 

Detailed Description

Definition at line 41 of file BufferMgr.h.

Constructor & Destructor Documentation

OutOfMemory::OutOfMemory ( size_t  num_bytes)
inline

Definition at line 43 of file BufferMgr.h.

References VLOG.

44  : std::runtime_error(parse_error_str("OutOfMemory", num_bytes)) {
45  VLOG(1) << "Failed to allocate " << num_bytes << " bytes";
46  VLOG(1) << boost::stacktrace::stacktrace();
47  };
std::string parse_error_str(const std::string &err, const size_t num_bytes=0)
Definition: BufferMgr.h:61
#define VLOG(n)
Definition: Logger.h:280
OutOfMemory::OutOfMemory ( const std::string &  err)
inline

Definition at line 49 of file BufferMgr.h.

References VLOG.

49  : std::runtime_error(parse_error_str(err, 0)) {
50  VLOG(1) << "Failed with OutOfMemory, condition " << err;
51  VLOG(1) << boost::stacktrace::stacktrace();
52  };
std::string parse_error_str(const std::string &err, const size_t num_bytes=0)
Definition: BufferMgr.h:61
#define VLOG(n)
Definition: Logger.h:280
OutOfMemory::OutOfMemory ( const std::string &  err,
size_t  num_bytes 
)
inline

Definition at line 54 of file BufferMgr.h.

References VLOG.

55  : std::runtime_error(parse_error_str(err, num_bytes)) {
56  VLOG(1) << "Failed to allocate " << num_bytes << " bytes with condition " << err;
57  VLOG(1) << boost::stacktrace::stacktrace();
58  };
std::string parse_error_str(const std::string &err, const size_t num_bytes=0)
Definition: BufferMgr.h:61
#define VLOG(n)
Definition: Logger.h:280

Member Function Documentation

std::string OutOfMemory::parse_error_str ( const std::string &  err,
const size_t  num_bytes = 0 
)
inlineprivate

Definition at line 61 of file BufferMgr.h.

References to_string().

61  {
62  if (num_bytes) {
63  return err + ": Failed to allocate " + std::to_string(num_bytes) + " bytes";
64  } else {
65  return "Failed to allocate memory with condition " + err;
66  }
67  }
std::string to_string(char const *&&v)

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: