libfoedus-core
FOEDUS Core Library
|
The pure-virtual interface to initialize/uninitialize non-trivial resources. More...
The pure-virtual interface to initialize/uninitialize non-trivial resources.
Definition at line 99 of file initializable.hpp.
#include <initializable.hpp>
Public Member Functions | |
virtual | ~Initializable () |
virtual ErrorStack | initialize ()=0 |
Acquires resources in this object, usually called right after constructor. More... | |
virtual bool | is_initialized () const =0 |
Returns whether the object has been already initialized or not. More... | |
virtual ErrorStack | uninitialize ()=0 |
An idempotent method to release all resources of this object, if any. More... | |
|
inlinevirtual |
Definition at line 101 of file initializable.hpp.
|
pure virtual |
Acquires resources in this object, usually called right after constructor.
If and only if the return value was not an error, is_initialized() will return TRUE. This method is usually not idempotent, but some implementation can choose to be. In that case, the implementation class should clarify that it's idempotent. This method is responsible for releasing all acquired resources when initialization fails. This method itself is NOT thread-safe. Do not call this in a racy situation.
Implemented in foedus::memory::PagePool, foedus::DefaultInitializable, foedus::Engine, foedus::thread::ThreadPool, foedus::soc::SocManager, foedus::thread::Thread, foedus::storage::StorageManager, foedus::log::LogManager, foedus::restart::RestartManager, foedus::proc::ProcManager, foedus::xct::XctManager, foedus::savepoint::SavepointManager, and foedus::snapshot::SnapshotManager.
|
pure virtual |
Returns whether the object has been already initialized or not.
Implemented in foedus::DefaultInitializable, foedus::memory::PagePool, foedus::Engine, foedus::thread::ThreadPool, foedus::soc::SocManager, foedus::thread::Thread, foedus::storage::StorageManager, foedus::log::LogManager, foedus::restart::RestartManager, foedus::proc::ProcManager, foedus::xct::XctManager, foedus::savepoint::SavepointManager, and foedus::snapshot::SnapshotManager.
Referenced by foedus::UninitializeGuard::~UninitializeGuard().
|
pure virtual |
An idempotent method to release all resources of this object, if any.
After this method, is_initialized() will return FALSE. Whether this method encounters an error or not, the implementation should make the best effort to release as many resources as possible. In other words, Do not leak all resources because of one issue. This method itself is NOT thread-safe. Do not call this in a racy situation.
Implemented in foedus::memory::PagePool, foedus::DefaultInitializable, foedus::Engine, foedus::thread::ThreadPool, foedus::soc::SocManager, foedus::thread::Thread, foedus::storage::StorageManager, foedus::log::LogManager, foedus::restart::RestartManager, foedus::proc::ProcManager, foedus::xct::XctManager, foedus::savepoint::SavepointManager, and foedus::snapshot::SnapshotManager.
Referenced by foedus::UninitializeGuard::~UninitializeGuard().