libfoedus-core
FOEDUS Core Library
|
Definition at line 117 of file metadata.hpp.
#include <metadata.hpp>
Public Member Functions | |
MetadataSerializer () | |
MetadataSerializer (Metadata *data) | |
virtual | ~MetadataSerializer () |
ErrorStack | load_base (tinyxml2::XMLElement *element) |
common routine for the implementation of load() More... | |
ErrorStack | save_base (tinyxml2::XMLElement *element) const |
common routine for the implementation of save() More... | |
![]() | |
virtual ErrorStack | load (tinyxml2::XMLElement *element)=0 |
Reads the content of this object from the given XML element. More... | |
virtual ErrorStack | save (tinyxml2::XMLElement *element) const =0 |
Writes the content of this object to the given XML element. More... | |
virtual const char * | get_tag_name () const =0 |
Returns an XML tag name for this object as a root element. More... | |
virtual void | assign (const foedus::externalize::Externalizable *other)=0 |
Polymorphic assign operator. More... | |
ErrorStack | load_from_string (const std::string &xml) |
Load the content of this object from the given XML string. More... | |
void | save_to_stream (std::ostream *ptr) const |
Invokes save() and directs the resulting XML text to the given stream. More... | |
ErrorStack | load_from_file (const fs::Path &path) |
Load the content of this object from the specified XML file. More... | |
ErrorStack | save_to_file (const fs::Path &path) const |
Atomically and durably writes out this object to the specified XML file. More... | |
Static Public Member Functions | |
static ErrorStack | load_all_storages_from_xml (storage::StorageId largest_storage_id, tinyxml2::XMLElement *element, StorageControlBlock *blocks) |
static ErrorStack | save_all_storages_to_xml (storage::StorageId largest_storage_id, tinyxml2::XMLElement *element, StorageControlBlock *blocks) |
![]() | |
static ErrorStack | insert_comment (tinyxml2::XMLElement *element, const std::string &comment) |
static ErrorStack | append_comment (tinyxml2::XMLElement *parent, const std::string &comment) |
static ErrorStack | create_element (tinyxml2::XMLElement *parent, const std::string &name, tinyxml2::XMLElement **out) |
template<typename T > | |
static ErrorStack | add_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, T value) |
Only declaration in header. More... | |
template<uint MAXLEN, typename CHAR > | |
static ErrorStack | add_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, const assorted::FixedString< MAXLEN, CHAR > &value) |
template<typename T > | |
static ErrorStack | add_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, const std::vector< T > &value) |
vector version More... | |
template<typename ENUM > | |
static ErrorStack | add_enum_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, ENUM value) |
enum version More... | |
static ErrorStack | add_child_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, const Externalizable &child) |
child Externalizable version More... | |
template<typename T > | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, T *out, bool optional=false, T value=0) |
Only declaration in header. More... | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, std::string *out, bool optional=false, const char *value="") |
string type is bit special. More... | |
template<uint MAXLEN, typename CHAR > | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, assorted::FixedString< MAXLEN, CHAR > *out, bool optional=false, const assorted::FixedString< MAXLEN, CHAR > &value=assorted::FixedString< MAXLEN, CHAR >()) |
template<typename ENUM > | |
static ErrorStack | get_enum_element (tinyxml2::XMLElement *parent, const std::string &tag, ENUM *out, bool optional=false, ENUM default_value=static_cast< ENUM >(0)) |
enum version More... | |
template<typename T > | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, std::vector< T > *out, bool optional=false) |
vector version. More... | |
static ErrorStack | get_child_element (tinyxml2::XMLElement *parent, const std::string &tag, Externalizable *child, bool optional=false) |
child Externalizable version More... | |
Public Attributes | |
Metadata * | data_ |
|
inline |
Definition at line 118 of file metadata.hpp.
|
inlineexplicit |
Definition at line 119 of file metadata.hpp.
|
inlinevirtual |
Definition at line 120 of file metadata.hpp.
|
static |
Definition at line 125 of file metadata.cpp.
References ASSERT_ND, CHECK_ERROR, ERROR_STACK, foedus::externalize::Externalizable::get_element(), foedus::externalize::Externalizable::get_enum_element(), foedus::storage::kArrayStorage, foedus::kErrorCodeStrUnsupportedMetadata, foedus::storage::kExists, foedus::storage::kHashStorage, foedus::storage::kInvalidStorage, foedus::storage::kMasstreeStorage, foedus::storage::kNotExists, foedus::kRetOk, foedus::storage::kSequentialStorage, foedus::storage::load_from_xml_array(), foedus::storage::load_from_xml_hash(), foedus::storage::load_from_xml_masstree(), foedus::storage::load_from_xml_sequential(), foedus::storage::StorageControlBlock::meta_, and foedus::storage::StorageControlBlock::status_.
Referenced by foedus::snapshot::SnapshotMetadata::load().
ErrorStack foedus::storage::MetadataSerializer::load_base | ( | tinyxml2::XMLElement * | element | ) |
common routine for the implementation of load()
Definition at line 50 of file metadata.cpp.
References CHECK_ERROR, data_, foedus::externalize::Externalizable::get_element(), foedus::externalize::Externalizable::get_enum_element(), foedus::storage::Metadata::id_, foedus::kRetOk, foedus::storage::Metadata::name_, foedus::storage::Metadata::root_snapshot_page_id_, foedus::storage::Metadata::SnapshotThresholds::snapshot_keep_threshold_, foedus::storage::Metadata::snapshot_thresholds_, foedus::storage::Metadata::SnapshotThresholds::snapshot_trigger_threshold_, and foedus::storage::Metadata::type_.
Referenced by foedus::storage::sequential::SequentialMetadataSerializer::load(), foedus::storage::hash::HashMetadataSerializer::load(), foedus::storage::array::ArrayMetadataSerializer::load(), and foedus::storage::masstree::MasstreeMetadataSerializer::load().
|
static |
Definition at line 166 of file metadata.cpp.
References ASSERT_ND, CHECK_ERROR, ERROR_STACK, foedus::fs::exists(), foedus::storage::kArrayStorage, foedus::kErrorCodeStrUnsupportedMetadata, foedus::storage::kHashStorage, foedus::storage::kMasstreeStorage, foedus::kRetOk, foedus::storage::kSequentialStorage, foedus::storage::StorageControlBlock::meta_, foedus::storage::save_to_xml_array(), foedus::storage::save_to_xml_hash(), foedus::storage::save_to_xml_masstree(), foedus::storage::save_to_xml_sequential(), and foedus::storage::Metadata::type_.
Referenced by foedus::snapshot::SnapshotMetadata::save().
ErrorStack foedus::storage::MetadataSerializer::save_base | ( | tinyxml2::XMLElement * | element | ) | const |
common routine for the implementation of save()
Definition at line 66 of file metadata.cpp.
References foedus::externalize::Externalizable::add_element(), foedus::externalize::Externalizable::add_enum_element(), CHECK_ERROR, data_, foedus::storage::Metadata::id_, foedus::kRetOk, foedus::storage::Metadata::name_, foedus::storage::Metadata::root_snapshot_page_id_, foedus::storage::Metadata::SnapshotThresholds::snapshot_keep_threshold_, foedus::storage::Metadata::snapshot_thresholds_, foedus::storage::Metadata::SnapshotThresholds::snapshot_trigger_threshold_, and foedus::storage::Metadata::type_.
Referenced by foedus::storage::sequential::SequentialMetadataSerializer::save(), foedus::storage::hash::HashMetadataSerializer::save(), foedus::storage::array::ArrayMetadataSerializer::save(), and foedus::storage::masstree::MasstreeMetadataSerializer::save().
Metadata* foedus::storage::MetadataSerializer::data_ |
Definition at line 136 of file metadata.hpp.
Referenced by load_base(), and save_base().