18 #ifndef FOEDUS_INITIALIZABLE_HPP_
19 #define FOEDUS_INITIALIZABLE_HPP_
192 initialized_ =
false;
252 : target_(target), policy_(policy) {}
261 #endif // FOEDUS_INITIALIZABLE_HPP_
Policy
Defines the behavior of this scope guard.
The pure-virtual interface to initialize/uninitialize non-trivial resources.
Automatically calls if uninitialize() wasn't called when it gets out of scope, and just complains whe...
#define ERROR_STACK(e)
Instantiates ErrorStack with the given foedus::error_code, creating an error stack with the current f...
UninitializeGuard(Initializable *target, Policy policy=kAbortIfUninitializeError)
Automatically calls if uninitialize() wasn't called when it gets out of scope, and does nothing even ...
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
virtual ErrorStack initialize()=0
Acquires resources in this object, usually called right after constructor.
ErrorStack uninitialize() override final
Typical implementation of Initializable::uninitialize() that provides uninitialize-once semantics...
Brings error stacktrace information as return value of functions.
Terminates the entire program if uninitialize() wasn't called when it gets out of scope...
Typical implementation of Initializable as a skeleton base class.
Automatically calls if uninitialize() wasn't called when it gets out of scope, and terminates the ent...
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
virtual ErrorStack uninitialize_once()=0
Calls Initializable::uninitialize() automatically when it gets out of scope.
ErrorStack initialize() override final
Typical implementation of Initializable::initialize() that provides initialize-once semantics...
0x0003 : "GENERAL: Already initialized" .
#define CXX11_OVERRIDE
Used in public headers in place of "override" of C++11.
#define CXX11_FUNC_DELETE
Used in public headers in place of " = delete" of C++11.
virtual ErrorStack uninitialize()=0
An idempotent method to release all resources of this object, if any.
#define CHECK_ERROR(x)
This macro calls x and checks its returned value.
const ErrorStack kRetOk
Normal return value for no-error case.
virtual ~DefaultInitializable()
virtual ErrorStack initialize_once()=0
virtual bool is_initialized() const =0
Returns whether the object has been already initialized or not.
bool is_initialized() const override final
Returns whether the object has been already initialized or not.
bool is_error() const
Returns if this return code is not kErrorCodeOk.