Enumerations | |
enum | memory_type { min_required, mb512, mb1024, mb2048, mb4096, mb8192, mb16384, mb32768, mb65536 } |
Functions | |
bool | is_prime (uint32_t number) |
uint32_t | next_prime (uint32_t number) |
template<typename T > | |
T | hash (const char *key, size_t length) |
template<> | |
uint16_t | hash< uint16_t > (const char *key, size_t length) |
template<> | |
uint32_t | hash< uint32_t > (const char *key, size_t length) |
template<> | |
uint64_t | hash< uint64_t > (const char *key, size_t length) |
template<typename T > | |
T | hash (const std::string &key) |
uint16_t | hash16 (const std::string &key) |
uint32_t | hash32 (const std::string &key) |
uint64_t | hash64 (const std::string &key) |
template<typename T > | |
bool | to_number (const std::string &value, T &number) |
template<typename T > | |
const T | to_number (const std::string &value) |
template<typename T > | |
std::string | to_string (T value) |
template<typename T > | |
std::string | format (const std::string &msg, const T &value) |
template<typename T > | |
void | throw_runtime_error (const std::string &msg, const T &value) |
template<typename T > | |
void | throw_invalid_argument (const std::string &msg, const T &value) |
template<typename T > | |
void | throw_out_of_range (const std::string &msg, const T &value) |
template<typename T > | |
void | throw_length_error (const std::string &msg, const T &value) |
template<typename T > | |
void | throw_logic_error (const std::string &msg, const T &value) |
template<typename T > | |
void | throw_domain_error (const std::string &msg, const T &value) |
void | throw_logic_error (const std::string &msg) |
void | throw_domain_error (const std::string &msg) |
void | throw_runtime_error (const std::string &msg) |
void | throw_overflow_error (const std::string &msg) |
void | throw_underflow_error (const std::string &msg) |
void | throw_invalid_argument (const std::string &msg) |
std::ostream & | print_timestamp_to (std::ostream &os) |
void | log_debug (const char *file, size_t line, const std::string &msg) |
template<typename T > | |
void | log_debug (const char *file, size_t line, const std::string &msg, const T &val) |
template<typename Iter > | |
void | log_debug (const char *file, size_t line, const std::string &msg, Iter first, Iter last) |
void | vlog_debug (const std::string &format, va_list args) |
void | logf_debug (const std::string &format,...) |
void | log_error (const std::string &message) |
template<typename T > | |
void | log_error (const std::string &message, const T &value) |
void | log_info (const std::string &message) |
template<typename T > | |
void | log_info (const std::string &message, const T &value) |
uint64_t | to_bytes (memory_type memory) |
std::string | to_string (memory_type memory) |
void | signal_error (const std::string &msg) |
template<typename T > | |
void | signal_error (const std::string &msg, const T &obj) |
uint64_t | directory_size (const bfs::path &dir) |
void | fclose (FILE *fs) |
FILE * | fopen (const bfs::path &path, const std::string &mode) |
void | fread (void *data, size_t size, size_t count, FILE *fs) |
void | fseek (FILE *fs, long offset, int origin) |
void | fwrite (const void *data, size_t size, size_t count, FILE *fs) |
size_t | ftell (FILE *fs) |
void | rewind (FILE *fs) |
FILE * | tmpfile () |
const bfs::path | tmpdir (const bfs::path &parent_dir) |
Definition at line 12 of file memory.hpp.
uint64_t aitools::util::directory_size | ( | const bfs::path & | dir | ) | [inline] |
Definition at line 36 of file systemio.hpp.
void aitools::util::fclose | ( | FILE * | fs | ) | [inline] |
Definition at line 55 of file systemio.hpp.
References signal_error().
Referenced by BOOST_AUTO_TEST_CASE(), aitools::bighashmap::core::builder< T >::build_hashfunc(), aitools::bighashmap::core::builder< T >::build_hashtable(), aitools::invertedindex::PostlistBuilder::clear(), aitools::invertedindex::StorageBuilder::close(), aitools::bighashmap::core::cmph_map< T >::cmph_map(), aitools::bighashmap::core::internal_map< T >::internal_map(), aitools::invertedindex::ExternalMergeSort::merge(), aitools::invertedindex::StorageSearcher::open(), test(), aitools::bighashmap::core::external_map< T >::~external_map(), aitools::invertedindex::Iterator::Page::~Page(), and aitools::invertedindex::PostlistBuilder::~PostlistBuilder().
FILE* aitools::util::fopen | ( | const bfs::path & | path, | |
const std::string & | mode | |||
) | [inline] |
Definition at line 94 of file systemio.hpp.
References signal_error().
Referenced by aitools::bighashmap::core::builder< T >::build_hashfunc(), aitools::bighashmap::core::builder< T >::build_hashtable(), aitools::bighashmap::core::cmph_map< T >::cmph_map(), aitools::bighashmap::core::external_map< T >::external_map(), aitools::invertedindex::System::fopen(), aitools::bighashmap::core::internal_map< T >::internal_map(), and test().
std::string aitools::util::format | ( | const std::string & | msg, | |
const T & | value | |||
) | [inline] |
Definition at line 19 of file exception.hpp.
Referenced by throw_domain_error(), throw_invalid_argument(), throw_length_error(), throw_logic_error(), throw_out_of_range(), and throw_runtime_error().
void aitools::util::fread | ( | void * | data, | |
size_t | size, | |||
size_t | count, | |||
FILE * | fs | |||
) | [inline] |
Definition at line 105 of file systemio.hpp.
References signal_error().
Referenced by aitools::invertedindex::System::fread(), aitools::bighashmap::core::internal_map< T >::internal_map(), aitools::invertedindex::ExternalMergeSort::merge(), aitools::value::value_traits< T >::read_from(), and aitools::invertedindex::Iterator::swap().
void aitools::util::fseek | ( | FILE * | fs, | |
long | offset, | |||
int | origin | |||
) | [inline] |
Definition at line 116 of file systemio.hpp.
References signal_error().
Referenced by aitools::bighashmap::core::external_map< T >::find(), aitools::invertedindex::System::fseek(), and aitools::invertedindex::Iterator::rewind().
size_t aitools::util::ftell | ( | FILE * | fs | ) | [inline] |
Definition at line 137 of file systemio.hpp.
References signal_error().
Referenced by BOOST_AUTO_TEST_CASE(), aitools::invertedindex::System::ftell(), and aitools::invertedindex::Iterator::Page::Page().
void aitools::util::fwrite | ( | const void * | data, | |
size_t | size, | |||
size_t | count, | |||
FILE * | fs | |||
) | [inline] |
Definition at line 126 of file systemio.hpp.
References signal_error().
Referenced by aitools::bighashmap::core::builder< T >::build_hashtable(), aitools::invertedindex::StorageBuilder::close(), aitools::invertedindex::System::fwrite(), aitools::invertedindex::ExternalMergeSort::swap_out(), aitools::invertedindex::PostlistBuilder::swap_out_values_(), and aitools::value::value_traits< T >::write_to().
size_t aitools::util::hash | ( | const std::string & | key | ) | [inline] |
Definition at line 90 of file checksum.hpp.
T aitools::util::hash | ( | const char * | key, | |
size_t | length | |||
) | [inline] |
Referenced by BOOST_AUTO_TEST_CASE(), and aitools::bighashmap::core::builder< T >::build_hashtable().
uint16_t aitools::util::hash16 | ( | const std::string & | key | ) | [inline] |
Definition at line 96 of file checksum.hpp.
References hash< uint16_t >().
uint32_t aitools::util::hash32 | ( | const std::string & | key | ) | [inline] |
Definition at line 102 of file checksum.hpp.
References hash< uint32_t >().
Referenced by aitools::bighashmap::core::big_hash_map< T >::find(), and aitools::bighashmap::core::builder< T >::scatter().
uint64_t aitools::util::hash64 | ( | const std::string & | key | ) | [inline] |
Definition at line 108 of file checksum.hpp.
References hash< uint64_t >().
uint16_t aitools::util::hash< uint16_t > | ( | const char * | key, | |
size_t | length | |||
) | [inline] |
uint32_t aitools::util::hash< uint32_t > | ( | const char * | key, | |
size_t | length | |||
) | [inline] |
uint64_t aitools::util::hash< uint64_t > | ( | const char * | key, | |
size_t | length | |||
) | [inline] |
bool aitools::util::is_prime | ( | uint32_t | number | ) | [inline] |
Definition at line 16 of file checksum.hpp.
Referenced by next_prime().
void aitools::util::log_debug | ( | const char * | file, | |
size_t | line, | |||
const std::string & | msg, | |||
Iter | first, | |||
Iter | last | |||
) | [inline] |
Definition at line 52 of file logging.hpp.
References print_timestamp_to().
void aitools::util::log_debug | ( | const char * | file, | |
size_t | line, | |||
const std::string & | msg, | |||
const T & | val | |||
) | [inline] |
Definition at line 43 of file logging.hpp.
References print_timestamp_to().
void aitools::util::log_debug | ( | const char * | file, | |
size_t | line, | |||
const std::string & | msg | |||
) | [inline] |
Definition at line 34 of file logging.hpp.
References print_timestamp_to().
Referenced by aitools::bighashmap::core::internal_map< T >::find(), and aitools::bighashmap::core::external_map< T >::find().
void aitools::util::log_error | ( | const std::string & | message, | |
const T & | value | |||
) | [inline] |
Definition at line 89 of file logging.hpp.
References print_timestamp_to().
void aitools::util::log_error | ( | const std::string & | message | ) | [inline] |
Definition at line 81 of file logging.hpp.
References print_timestamp_to().
Referenced by bhm_build(), bhm_open(), and aitools::bighashmap::core::external_map< T >::find().
void aitools::util::log_info | ( | const std::string & | message, | |
const T & | value | |||
) | [inline] |
Definition at line 104 of file logging.hpp.
References print_timestamp_to().
void aitools::util::log_info | ( | const std::string & | message | ) | [inline] |
Definition at line 96 of file logging.hpp.
References print_timestamp_to().
Referenced by aitools::bighashmap::core::builder< T >::build().
void aitools::util::logf_debug | ( | const std::string & | format, | |
... | ||||
) | [inline] |
Definition at line 72 of file logging.hpp.
References vlog_debug().
uint32_t aitools::util::next_prime | ( | uint32_t | number | ) | [inline] |
Definition at line 28 of file checksum.hpp.
References is_prime().
std::ostream& aitools::util::print_timestamp_to | ( | std::ostream & | os | ) | [inline] |
Definition at line 20 of file logging.hpp.
Referenced by log_debug(), log_error(), log_info(), and vlog_debug().
void aitools::util::rewind | ( | FILE * | fs | ) | [inline] |
Definition at line 149 of file systemio.hpp.
Referenced by BOOST_AUTO_TEST_CASE(), aitools::invertedindex::PostlistBuilder::build(), and aitools::invertedindex::ExternalMergeSort::merge().
void aitools::util::signal_error | ( | const std::string & | msg, | |
const T & | obj | |||
) | [inline] |
Definition at line 29 of file systemio.hpp.
References throw_runtime_error().
void aitools::util::signal_error | ( | const std::string & | msg | ) | [inline] |
void aitools::util::throw_domain_error | ( | const std::string & | msg | ) | [inline] |
Definition at line 75 of file exception.hpp.
void aitools::util::throw_domain_error | ( | const std::string & | msg, | |
const T & | value | |||
) | [inline] |
Definition at line 63 of file exception.hpp.
References format().
void aitools::util::throw_invalid_argument | ( | const std::string & | msg | ) | [inline] |
Definition at line 99 of file exception.hpp.
void aitools::util::throw_invalid_argument | ( | const std::string & | msg, | |
const T & | value | |||
) | [inline] |
Definition at line 35 of file exception.hpp.
References format().
Referenced by Java_de_aitools_aq_invertedindex_core_IndexBuilder_natBuild(), Java_de_aitools_aq_invertedindex_core_IndexSearcher_natInit(), and to_number().
void aitools::util::throw_length_error | ( | const std::string & | msg, | |
const T & | value | |||
) | [inline] |
Definition at line 49 of file exception.hpp.
References format().
void aitools::util::throw_logic_error | ( | const std::string & | msg | ) | [inline] |
Definition at line 69 of file exception.hpp.
void aitools::util::throw_logic_error | ( | const std::string & | msg, | |
const T & | value | |||
) | [inline] |
Definition at line 56 of file exception.hpp.
References format().
void aitools::util::throw_out_of_range | ( | const std::string & | msg, | |
const T & | value | |||
) | [inline] |
Definition at line 42 of file exception.hpp.
References format().
void aitools::util::throw_overflow_error | ( | const std::string & | msg | ) | [inline] |
Definition at line 87 of file exception.hpp.
void aitools::util::throw_runtime_error | ( | const std::string & | msg | ) | [inline] |
Definition at line 81 of file exception.hpp.
void aitools::util::throw_runtime_error | ( | const std::string & | msg, | |
const T & | value | |||
) | [inline] |
Definition at line 28 of file exception.hpp.
References format().
Referenced by aitools::bighashmap::core::builder< T >::build(), aitools::bighashmap::core::builder< T >::build_hashfunc(), aitools::bighashmap::core::builder< T >::build_hashtable(), aitools::bighashmap::core::builder< T >::build_map(), aitools::bighashmap::core::cmph_map< T >::cmph_map(), aitools::bighashmap::core::builder< T >::create_keyfile(), aitools::bighashmap::core::external_map< T >::find(), aitools::bighashmap::core::builder< T >::get_record_count(), aitools::bighashmap::core::internal_map< T >::internal_map(), aitools::bighashmap::core::internal_map< T >::open(), aitools::bighashmap::core::external_map< T >::open(), aitools::bighashmap::core::big_hash_map< T >::open(), aitools::bighashmap::core::builder< T >::scatter(), signal_error(), and aitools::invertedindex::System::tmpfile().
void aitools::util::throw_underflow_error | ( | const std::string & | msg | ) | [inline] |
Definition at line 93 of file exception.hpp.
const bfs::path aitools::util::tmpdir | ( | const bfs::path & | parent_dir | ) | [inline] |
Definition at line 167 of file systemio.hpp.
References signal_error().
FILE* aitools::util::tmpfile | ( | ) | [inline] |
Definition at line 156 of file systemio.hpp.
References signal_error().
Referenced by BOOST_AUTO_TEST_CASE(), aitools::invertedindex::PostlistBuilder::swap_out_values_(), and aitools::invertedindex::System::tmpfile().
uint64_t aitools::util::to_bytes | ( | memory_type | memory | ) | [inline] |
const T aitools::util::to_number | ( | const std::string & | value | ) | [inline] |
Definition at line 26 of file conversion.hpp.
References throw_invalid_argument().
bool aitools::util::to_number | ( | const std::string & | value, | |
T & | number | |||
) | [inline] |
Definition at line 19 of file conversion.hpp.
std::string aitools::util::to_string | ( | memory_type | memory | ) | [inline] |
std::string aitools::util::to_string | ( | T | value | ) | [inline] |
Definition at line 36 of file conversion.hpp.
Referenced by aitools::bighashmap::core::builder< T >::build(), record_generator< T >::operator()(), and test().
void aitools::util::vlog_debug | ( | const std::string & | format, | |
va_list | args | |||
) | [inline] |
Definition at line 63 of file logging.hpp.
References print_timestamp_to().
Referenced by logf_debug().