18 #ifndef FOEDUS_ERROR_STACK_BATCH_HPP_
19 #define FOEDUS_ERROR_STACK_BATCH_HPP_
42 error_batch_ = other.error_batch_;
46 #ifndef DISABLE_CXX11_IN_PUBLIC_HEADERS
53 error_batch_ = std::move(other.error_batch_);
61 error_batch_ = std::move(other.error_batch_);
64 #endif // DISABLE_CXX11_IN_PUBLIC_HEADERS
66 void clear() { error_batch_.clear(); }
75 error_batch_.push_back(error_stack);
78 #ifndef DISABLE_CXX11_IN_PUBLIC_HEADERS
84 if (!error_stack.is_error()) {
87 error_batch_.emplace_back(error_stack);
89 #endif // DISABLE_CXX11_IN_PUBLIC_HEADERS
92 bool is_error()
const {
return !error_batch_.empty(); }
100 while (!vec->empty()) {
101 if (vec->back()->is_initialized()) {
102 #ifndef DISABLE_CXX11_IN_PUBLIC_HEADERS
104 #else // DISABLE_CXX11_IN_PUBLIC_HEADERS
106 #endif // DISABLE_CXX11_IN_PUBLIC_HEADERS
125 std::vector<ErrorStack> error_batch_;
136 #define SUMMARIZE_ERROR_BATCH(x) x.summarize(__FILE__, __FUNCTION__, __LINE__)
138 #endif // FOEDUS_ERROR_STACK_BATCH_HPP_
ErrorStackBatch & operator=(ErrorStackBatch &&other)
Move assignment that steals the internal std::vector without copying.
void emprace_back(ErrorStack &&error_stack)
If the given ErrorStack is an error, this method adds it to the end of this batch.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
friend std::ostream & operator<<(std::ostream &o, const ErrorStackBatch &obj)
Brings error stacktrace information as return value of functions.
ErrorStackBatch & operator=(const ErrorStackBatch &other)
Non-move assignment.
ErrorStackBatch(const ErrorStackBatch &other)
Non-move copy constructor.
Batches zero or more ErrorStack objects to represent in one ErrorStack.
ErrorStack summarize(const char *filename, const char *func, uint32_t linenum) const
Instantiate an ErrorStack object that summarizes all errors in this batch.
ErrorStackBatch(ErrorStackBatch &&other)
Move constructor that steals the internal std::vector without copying.
bool is_error() const
Returns whether there was any error.
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.
void push_back(const ErrorStack &error_stack)
If the given ErrorStack is an error, this method adds it to the end of this batch.
bool is_error() const
Returns if this return code is not kErrorCodeOk.