Stxxl
1.4.0
|
#include <sstream>
#include <cerrno>
#include <cstring>
#include <stxxl/bits/namespace.h>
#include <stxxl/bits/common/exceptions.h>
Go to the source code of this file.
Namespaces | |
namespace | stxxl |
| |
Defines | |
#define | _STXXL_STRING(x) # x |
#define | STXXL_PRETTY_FUNCTION_NAME __PRETTY_FUNCTION__ |
#define | STXXL_THROW(exception_type, location, error_message) |
#define | STXXL_THROW2(exception_type, error_message) |
#define | STXXL_THROW_INVALID_ARGUMENT(error_message) |
#define | STXXL_THROW_UNREACHABLE() |
#define | stxxl_function_error(exception_type) stxxl::stxxl_util_function_error<exception_type>(STXXL_PRETTY_FUNCTION_NAME) |
#define | check_pthread_call(expr) stxxl::helper_check_eq_0<stxxl::resource_error>(expr, STXXL_PRETTY_FUNCTION_NAME, _STXXL_STRING(expr), true) |
#define | stxxl_check_ge_0(expr, exception_type) stxxl::helper_check_ge_0<exception_type>(expr, STXXL_PRETTY_FUNCTION_NAME) |
#define | stxxl_check_ne_0(expr, exception_type) stxxl::helper_check_ne_0<exception_type>(expr, STXXL_PRETTY_FUNCTION_NAME) |
Functions | |
template<typename E > | |
void | stxxl::stxxl_util_function_error (const char *func_name, const char *expr=0, const char *error=0) |
template<typename E > | |
bool | stxxl::helper_check_success (bool success, const char *func_name, const char *expr=0, const char *error=0) |
template<typename E , typename INT > | |
bool | stxxl::helper_check_eq_0 (INT res, const char *func_name, const char *expr, bool res_2_strerror=false) |
template<typename E , typename INT > | |
bool | stxxl::helper_check_ge_0 (INT res, const char *func_name) |
template<typename E , typename INT > | |
bool | stxxl::helper_check_ne_0 (INT res, const char *func_name) |
#define _STXXL_STRING | ( | x | ) | # x |
Definition at line 26 of file error_handling.h.
#define check_pthread_call | ( | expr | ) | stxxl::helper_check_eq_0<stxxl::resource_error>(expr, STXXL_PRETTY_FUNCTION_NAME, _STXXL_STRING(expr), true) |
Definition at line 86 of file error_handling.h.
Referenced by stxxl::semaphore::decrement(), stxxl::onoff_switch::is_on(), stxxl::mutex::lock(), stxxl::mutex::mutex(), stxxl::onoff_switch::off(), stxxl::onoff_switch::on(), stxxl::onoff_switch::onoff_switch(), stxxl::state< request_state >::operator()(), stxxl::semaphore::operator++(), stxxl::semaphore::operator--(), stxxl::semaphore::semaphore(), stxxl::state< request_state >::set_to(), stxxl::request_queue_impl_worker::start_thread(), stxxl::state< request_state >::state(), stxxl::request_queue_impl_worker::stop_thread(), stxxl::mutex::unlock(), stxxl::state< request_state >::wait_for(), stxxl::onoff_switch::wait_for_off(), stxxl::onoff_switch::wait_for_on(), stxxl::mutex::~mutex(), stxxl::onoff_switch::~onoff_switch(), stxxl::semaphore::~semaphore(), and stxxl::state< request_state >::~state().
#define stxxl_check_ge_0 | ( | expr, | |
exception_type | |||
) | stxxl::helper_check_ge_0<exception_type>(expr, STXXL_PRETTY_FUNCTION_NAME) |
Definition at line 95 of file error_handling.h.
Referenced by stxxl::ufs_file_base::_size(), and stxxl::ufs_file_base::set_size().
#define stxxl_check_ne_0 | ( | expr, | |
exception_type | |||
) | stxxl::helper_check_ne_0<exception_type>(expr, STXXL_PRETTY_FUNCTION_NAME) |
Definition at line 104 of file error_handling.h.
Referenced by stxxl::config::init().
#define stxxl_function_error | ( | exception_type | ) | stxxl::stxxl_util_function_error<exception_type>(STXXL_PRETTY_FUNCTION_NAME) |
Definition at line 69 of file error_handling.h.
Referenced by stxxl::ufs_file_base::close(), stxxl::mutex::~mutex(), stxxl::onoff_switch::~onoff_switch(), stxxl::semaphore::~semaphore(), and stxxl::state< request_state >::~state().
#define STXXL_PRETTY_FUNCTION_NAME __PRETTY_FUNCTION__ |
Definition at line 31 of file error_handling.h.
Referenced by _(), dump_container_info(), dump_iterator_info(), stxxl::stream::materialize(), test_strategy(), stxxl::grow_shrink_stack< Config_ >::~grow_shrink_stack(), and stxxl::normal_stack< Config_ >::~normal_stack().
#define STXXL_THROW | ( | exception_type, | |
location, | |||
error_message | |||
) |
do { \ std::ostringstream msg_; \ msg_ << "Error in " << location << ": " << error_message; \ throw exception_type(msg_.str()); \ } while (false)
Definition at line 36 of file error_handling.h.
Referenced by stxxl::DiskAllocator::add_free_region(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::bulk_construction(), stxxl::create_file(), stxxl::config::init(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::insert_into_root(), stxxl::btree::node_cache< leaf_type, SelfType >::node_cache(), stxxl::priority_queue< Config_ >::refill_delete_buffer(), and stxxl::btree::iterator_map< SelfType >::unregister_iterator().
#define STXXL_THROW2 | ( | exception_type, | |
error_message | |||
) |
STXXL_THROW(exception_type, "function " << STXXL_PRETTY_FUNCTION_NAME, \ "Info: " << error_message << " " << strerror(errno))
Definition at line 43 of file error_handling.h.
Referenced by stxxl::ufs_file_base::lock(), stxxl::syscall_file::serve(), and stxxl::ufs_file_base::ufs_file_base().
#define STXXL_THROW_INVALID_ARGUMENT | ( | error_message | ) |
STXXL_THROW(std::invalid_argument, \ "function " << STXXL_PRETTY_FUNCTION_NAME, \ error_message)
Definition at line 47 of file error_handling.h.
Referenced by stxxl::request_queue_impl_1q::add_request(), stxxl::request_queue_impl_qwqr::add_request(), stxxl::request_queue_impl_1q::cancel_request(), and stxxl::request_queue_impl_qwqr::cancel_request().
#define STXXL_THROW_UNREACHABLE | ( | ) |
STXXL_THROW(stxxl::unreachable, \ "file: " << __FILE__ << ", line: " << __LINE__, \ "must be unreachable code")
Definition at line 52 of file error_handling.h.
Referenced by stxxl::stream::basic_runs_merger< sorted_runs_type, CompareType_, AllocStr_ >::fill_buffer_block(), stxxl::stream::basic_runs_merger< sorted_runs_type, CompareType_, AllocStr_ >::initialize(), and stxxl::sort_local::merge_runs().