libfoedus-core
FOEDUS Core Library
|
Batches zero or more ErrorStack objects to represent in one ErrorStack. More...
Batches zero or more ErrorStack objects to represent in one ErrorStack.
This batching is useful in a context that might observe multiple errors while it can return only one ErrorStack object; e.g., Initializable::uninitialize().
Definition at line 34 of file error_stack_batch.hpp.
#include <error_stack_batch.hpp>
Public Member Functions | |
ErrorStackBatch () | |
ErrorStackBatch (const ErrorStackBatch &other) | |
Non-move copy constructor. More... | |
ErrorStackBatch & | operator= (const ErrorStackBatch &other) |
Non-move assignment. More... | |
ErrorStackBatch (ErrorStackBatch &&other) | |
Move constructor that steals the internal std::vector without copying. More... | |
ErrorStackBatch & | operator= (ErrorStackBatch &&other) |
Move assignment that steals the internal std::vector without copying. More... | |
void | clear () |
void | push_back (const ErrorStack &error_stack) |
If the given ErrorStack is an error, this method adds it to the end of this batch. More... | |
void | emprace_back (ErrorStack &&error_stack) |
If the given ErrorStack is an error, this method adds it to the end of this batch. More... | |
bool | is_error () const |
Returns whether there was any error. More... | |
template<class T > | |
void | uninitialize_and_delete_all (std::vector< T * > *vec) |
A convenience method to uninitialize and delete all Initializable objects in a vector, storing all errors in this batch. More... | |
ErrorStack | summarize (const char *filename, const char *func, uint32_t linenum) const |
Instantiate an ErrorStack object that summarizes all errors in this batch. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const ErrorStackBatch &obj) |
|
inline |
Definition at line 36 of file error_stack_batch.hpp.
|
inline |
Non-move copy constructor.
Definition at line 38 of file error_stack_batch.hpp.
|
inline |
Move constructor that steals the internal std::vector without copying.
This is more efficient than non-move copy constructor, but provided only when C++11 is supported.
Definition at line 52 of file error_stack_batch.hpp.
|
inline |
Definition at line 66 of file error_stack_batch.hpp.
|
inline |
If the given ErrorStack is an error, this method adds it to the end of this batch.
This method is more efficient than push_back() but provided only when C++11 is supported.
Definition at line 83 of file error_stack_batch.hpp.
Referenced by uninitialize_and_delete_all(), foedus::thread::ThreadPoolPimpl::uninitialize_once(), foedus::restart::RestartManagerPimpl::uninitialize_once(), foedus::memory::NumaNodeMemory::uninitialize_once(), foedus::memory::EngineMemory::uninitialize_once(), foedus::EnginePimpl::uninitialize_once(), foedus::storage::StorageManagerPimpl::uninitialize_once(), foedus::log::LogManagerPimpl::uninitialize_once(), foedus::xct::XctManagerPimpl::uninitialize_once(), foedus::thread::ThreadPimpl::uninitialize_once(), foedus::snapshot::SnapshotManagerPimpl::uninitialize_once(), and foedus::snapshot::LogReducer::uninitialize_once().
|
inline |
Returns whether there was any error.
Definition at line 92 of file error_stack_batch.hpp.
Referenced by summarize().
|
inline |
Non-move assignment.
Definition at line 41 of file error_stack_batch.hpp.
|
inline |
Move assignment that steals the internal std::vector without copying.
This is more efficient, but provided only when C++11 is supported.
Definition at line 60 of file error_stack_batch.hpp.
|
inline |
If the given ErrorStack is an error, this method adds it to the end of this batch.
Definition at line 71 of file error_stack_batch.hpp.
References foedus::ErrorStack::is_error().
Referenced by uninitialize_and_delete_all().
ErrorStack foedus::ErrorStackBatch::summarize | ( | const char * | filename, |
const char * | func, | ||
uint32_t | linenum | ||
) | const |
Instantiate an ErrorStack object that summarizes all errors in this batch.
Consider using SUMMARIZE_ERROR_BATCH(batch).
Definition at line 24 of file error_stack_batch.cpp.
References is_error(), foedus::kErrorCodeBatchedError, and foedus::kRetOk.
|
inline |
A convenience method to uninitialize and delete all Initializable objects in a vector, storing all errors in this batch.
Definition at line 99 of file error_stack_batch.hpp.
References emprace_back(), and push_back().
Referenced by foedus::thread::ThreadGroup::uninitialize_once(), foedus::memory::NumaNodeMemory::uninitialize_once(), and foedus::log::LogManagerPimpl::uninitialize_once().
|
friend |
Definition at line 43 of file error_stack_batch.cpp.